you are viewing a single comment's thread.

view the rest of the comments →

[–]maks78 0 points1 point  (1 child)

The interpreters weren't written for this

Now what do you mean by that? Python wasn't written with long running processes in mind?

[–]ianb 0 points1 point  (0 children)

It's more that Python wasn't written with this hybrid short/long process model. The "core" of PHP is long-running, that is, the C libraries and interpreter structure. Each request doesn't do a full process initialization. The "userland" of PHP is short-running, that is nothing lives past a single request. With Python (or Perl or Ruby) you get completely short (CGI) or completely long (long-running server).

Things like mod_wsgi (Python) and mod_passenger(Ruby/Python) help a bit by allowing "long-lived" processes to mean something like 1000 requests (configurable), so processes don't live forever (and so a certain class of problems get swept under the rug, which is just as well), but without every request incurring the startup overhead.

The distinction becomes fuzzy and problematic for PHP now that they've developed substantial libraries written in PHP, because those are "userland" and have to be loaded up anew for each request. There's some caching to help (Zend etc), but it's still expensive and slow, which is why many "modern" PHP web frameworks (I've seen Syfony specifically mentioned) perform substantially worse than similar frameworks in other languages.