August 3rd, 2000, 03:18 PM
I need to verify for my boss that PHP is not single-threaded like CGI because we're developing an internet-based application that will potentially handle MANY simultaneous hits (to a database/php3 files, etc). Isn't it true that PHP is multi-threade when compiled as an Apache module (otherwise what would be the point of using php with multithreaded databases like postgreSQL?) Someone please confirm this for me!!
August 3rd, 2000, 03:42 PM
Apache itself at present is not multithreaded (the next version will be). While I know many people grasp at 'multithreaded' as a catchword for high-performance computing, the multiple process model has been doing very well for Apache even now.
On the other hand, I know that PHP4.0 will work with multithreaded servers also. I believe PHP is multithreaded, but I couldn't say for sure what methods they use. At least it doesn't need to start up a new process every time PHP code is executed from a page (THE major drawback of CGI). I will say, that with PHP4, using the Zend Optimizer, and using persistent database connections, you will probably NOT find a more efficient way to serve web content. Maybe server-side Java with Oracle, on very high-end Sun Machines could outpace PHP in this area, but not much else comes close. Other than that, the only thing faster would be custom server software.
If you want an example, the Lycos MP3 search site is powered by PHP. (http://www.zend.com/zend/cs/lycos.php)