4 ms·
> Erlang is mostly used in servers i think they might see this as a good compromise. I'm not sure what the differences will be but start up time is still a ver
by nickjj 6y ago
> Erlang is mostly used in servers i think they might see this as a good compromise.
I'm not sure what the differences will be but start up time is still a very big deal for web servers.
For example I can start up a non-Dockerized Python / gunicorn app with 8,000 lines of code and 50+ package dependencies in about 400ms on a $5 a month DigitalOcean server without doing any type of optimizations.
For someone who just wants to deploy a project to 1 server that means there's only 400ms of down time when I restart my server.
If a runtime takes let's say 10 seconds to start up, that could be enough of a deterrent to not use it if you know you're going down the route of a single server deploy.
- cmrdporcupine 6y agoI don't think we're talking "start time" so much as "warm up time"; if I understand these things correctly it's likely the VM would start almost immediately, but would take a little bit of time for hot code paths to JIT and become highly performant. I don't think that would be much of a concern in your example.
- lawik 6y agoFrom my conversation with them on Elixir Mix I don't believe warm-up is the issue. In this case the JIT is simpler than that. But the BEAM VM isn't the quickest starter in the world.
- dnautics 6y ago> For someone who just wants to deploy a project to 1 server that means there's only 400ms of down time when I restart my server. Erlang already gives you robust primitives to do things like blue-green deploys, and even graceful transfer of server state even across versioning changes. If downtime between releases is an something you care about, you should use those, and it's likely that your downtime can be in the microseconds range regardless of the vm startup latency.
- nickjj 6y agoI don't think hot reloads in Elixir are used that often for web apps due to how much complexity / state changes need to take place. I'm basing that on replies I've seen from a lot of folks in the forums who say it's not really worth the trouble due to how much can go wrong and how involved it would be to do such a thing. Which blue-green deploy primitives are you referencing btw?
- dnautics 6y agoNot referring to hot reloads. To do a simple blue green deploy you just have to use the builtin node system to make a cluster, and use :global to detect if there are any downversion nodes, if the current node is up version, it slays a downversion node and your external restart mechanism (either erlangs heart, systemd, kubernetes, or Amazon elb, or whatever brings back the node but with the newer code).
- nickjj 6y agoDo you happen to have a working example of that posted somewhere? A blog post with code perhaps? I'm unable to find a single example of that because every search around this topic turns up things like hot reloading and a bunch of people saying not to use it.