RE: [PHP-DEV] How much load... From: Stig Bakken (ssb <email protected>)
Date: 08/13/99

On Thu, 12 Aug 1999, Andres K?tt wrote:

> > > ... can PHP3/4 handle? Provided we have an Apache server and
> > > appropriate hardware, can PHP handle a load of >200 simultaneous
> > > connections? I have developed some small-scale PHP apps, but now we
> > > are looking for a tool to create heavily loaded database solutions for
> >
> > With the appropriate hardware, PHP can handle loads like that. The
> > question is really how much hardware is "appropriate"? It'll all depend
>
> Let's be more specific. We expect something like 50 users making
> 5000-row queries (Oracle database) on a _huge_ table simultaneously (
> plus more that 200 of them doing smaller ones). There are currently
> 200-300 new user connections per minute and it's growing. Hardware is
> not a problem, but I'm concerned about what happens to a
> Apache/PHP3(4) server handling that load (stability problems, certain
> bugs showing, etc?). Anyone wanna share experiences?

The highest-volume PHP-driven site I have experience with has around 30
hits per second. The first thing that hit me was the fact that reading
from socket file descriptors was done by one read system call for every
byte. Only the number of system calls per second were enough to choke the
service. This has since been fixed, but other parts of PHP may not have
been tested under such load, and it is possible we have room for more such
optimization.

If I were you, I would set up a test system and simulate the load to
identify whether you are bitten by any bottlenecks in PHP. As for Apache,
as long as you compile with a high enough HARD_SERVER_LIMIT (see
src/include/httpd.h) and have enough memory, it should not give you any
problems. There are some tricks though, take a look at
http://www.apache.org/docs/misc/perf-tuning.html.

> > on how much code has to be parsed and how heavy processing is done. It
> > sounds to me like you need PHP 4.0 and ZendPersistentRegistry.
>
> ZendPersistentRegistry? What's that? Does it allow to to have
> persistent variables that preserve their values while PHP parses
> several documents?

It stores the compiled version of files in memory in each httpd process,
so files are not re-parsed unless they are changed. It does not provide
persistent variables in the sense that they have the same value as when
another user "left" the same page or process. It simply lets PHP skip an
expensive step (parsing and compiling files) for most requests, at the
expense of some memory.

You'll have to ask the Zend team (zend <email protected>) for availability details.

> > PHP does currently not know CORBA, but several people have expressed
> > interst in implementing it.
>
> OK, but I need CORBA just for limiting the count of concurrent
> database connections and for intelligent request queuing. Are there
> any other (already implemented) solutions for that?

PHP has System V semaphore and shared memory support.

 - Stig

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>