Re: Refactoring our IO multiplexing layer

From: Date: Tue, 17 Jun 2014 12:35:48 +0000
Subject: Re: Refactoring our IO multiplexing layer
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-74945@lists.php.net to get a copy of this message
CCing internals On Tue, Jun 17, 2014 at 2:37 PM, Martin Pelikan <martin.pelikan@gmail.com> wrote: >> Yes, libevent seems to be the API we need. >> Regading Nginx, I'm not sure we need file AIO, for PHP, network AIO >> could be enough to implement. Still, our FPM IO multiplexing layer is >> stable now. >> >> The problem of binding a lib is that you add one more dependency, you >> have to check for licence compatibility, and check for the dependency >> when building. Not talking about bugs in the lib impacting our >> codebase. This is a tradeoff. > > All these are very good with libevent compared to other libraries. > I try to avoid dependencies a lot (more than most people do) and I wrote > that e-mail because in this case that was the wrong thing to do. > > Doing it once is easy. Doing it for many systems quickly becomes a pain > in the arse, because you're just solving issues. That's not programming. > > But again, I don't know what exactly PHP needs. That is another question. Actually, from a user POV, only stream_select() is available. It is a "silly" wrapper over select(), and that's all. It works, but suffers from the same problems as select(). I'm not sure userland needs that perf so that select() becomes the bottleneck. It is known to become notably slow starting from several hundreds of fd. I cant believe one would use stream_select() in userland with that quantity of fds , better code in C such parts. But, where performance start becoming critical is into FPM. FPM is a fastcgi handler that needs to juggle with FastCGI clients. Here, the needs are barely the same as a webserver like NginX : fast, performant, the most CPU bound as possible, no blocking waits , etc... FPM developed for that its own layer, which actually (AFAIR) , fits the need. What I think is pitty, is that there is no consistence in PHP. FPM AIO layer is good (but obviously could be improved), but only FPM can use it actually , there is no shared API other parts of PHP could consume. Thus my questions. Julien

« previous php.internals (#74945) next »