3 ms·
You'll need the go process to complete all ongoing requests before restarting it. Whether that be RPC, HTTP, WS, etc. And this is behind a load balancer, so di
by Can_Not 9y ago
You'll need the go process to complete all ongoing requests before restarting it. Whether that be RPC, HTTP, WS, etc. And this is behind a load balancer, so did you just go offline, or are you doing this one at a time? With PHP, you don't have to restart php-fpm or modapache. Just git-pull or FTP the new files in and the next HTTP request will automatically user the new version. Zero downtime. Honestly though, I expect something like AWS and GCE to already have our to be building a solution to handle the go scenario efficiently for you.
- _ph_ 9y agoThis would be easily achievable by having 2 processes: one, which accepts the socket connections and relays them to the subprocess which does the actual work. New subprocesses could be started any time for updates, without killing existing connections. All new connections would be handled by the new subprocess.
- Can_Not 9y agoSo, basically what you get for free in erlang and PHP, but not in golang?
- _ph_ 9y agoRight, as Go is compiled into a static executable, you can't do code updates on the fly that easy. A small price to pay in a production environment. On the other side, you do have all compiler checks run while building.
- heavenlyblue 9y agoHow do you deal with changes to multiple files at the same time? What if a subset of users see updated file A but not file B? You don't have such things in other languages simply because they have not been initially created as glorified templating engines. More importantly: for example, Django in debugging mode allows you to swap templates on the fly, so is with the executable code. Except nobody does it because that's considered ridiculous.