by frik · 10y ago · 0 comments
Also if an apache process dies it will not crash other requests
Instead, it's a "web application server", like Puma is for Rails apps: a server that runs your code in its own address space, where your code can crash the active worker process (which is usually handling multiple requests) for that server.
Puma ordinarily runs ~eight worker processes, and a crash will kill one of them causing it to take the time to re-fork, and discard any other sessions that were also scheduled on that worker. Erlang runs a million worker processes, and one of them crashing doesn't cause anything big to happen at all.
can you have 2m Apache processes on your machine ?
The whole point of this article is that there is an architecture behind this and that this architecture is believed to be generally useful.
MaxConnectionsPerChild defines how often the process is recycled
Now you're just moving a goalpost. We're talking about Erlang processes - you can have millions of them simultaneously.
> It wouldnt make much sense to recycle the process for each request however.
It does make a great deal of sense from the fault-tolerance perspective. It also helps security.
I have an unpleasant feeling that you don't know much about Erlang and its philosophy. The "one process per connection" architecture has many benefits; it's a canonical way of getting concurrency and parallelism on Unix systems, for example. The problem is the way OSes handle and schedule processes, it simply doesn't work with a very large number of them. Erlang implements its own kind of processes, which enforce the same constraints os OS-level processes without taking megs of RAM each and without being pressed after spawning a few thousand processes.
The long way of saying "No, I can't, but I really don't want to accept that there might be a better model for this than my out of the box Apache setup."
It's no secret that Apache isn't the leanest of HTTP daemons, but that's really a separate point to the argument of whether you can reasonably argue a process as a web server.