New driver for Net_Server
| From: | luca\.mariano\@email\.it | Date: | Mon, 03 Nov 2003 13:35:02 +0000 |
| Subject: | New driver for Net_Server | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-23203@lists.php.net to get a copy of this message | ||
I wrote a new driver for the Net_Server package (named Thread).
Actually Net_Server has the sequential driver (one process, uses socket_select to switch between
clients) and the fork one (one process wait for incominig clients, then forks a new manager for each
connection).
My propose is an adaptative Pool of managers like the Apache one; developer can assign a minumun
number of threads, and they will be all placed into accept() status on the socket; this is done by
forking the socket listener before the socket_accept().
If the start pool is not enought, the pool sizer automatically forks new childs and places them on
accept status; a maximun number of forkable processes is used to avoid system oveload.
My first test with this new implementation reveal that the system response is faster, because we
have not to do a fork at every request, but we use a thread pool that can be dinamically resized at
every moment.
See source for this driver at:
http://www.lucamariano.it/packages/Thread.phps
See the latest version of my Thread class at:
http://www.lucamariano.it/packages/threadClass.phps
Ing. Luca Mariano
-------------------------------
---------
- email:
luca.mariano@email.it
- cell: 347/56.03.614
- web:
http://www.lucamariano.it
-------------------------------
---------
--
Email.it, the professional e-mail, gratis per te: http://www.email.it/f
Sponsor:
Impara i trucchi di Posizionamento sui motori di ricerca, pubblicita'
on-line, email marketing!.
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=1817&d=3-11