Reply to Re: [PHP] Eliminating CLI overhead

Your name:

Reply:


Posted by Richard Lynch on 03/14/05 19:37

> I intend to run a lot of PHP scripts, all the time, on a Linux machine.
> The scripts were designed for CLI environment, since they will handle
> the entire management of the machine, being started by init and then
> effectively and completely taking over.
>
> I'm wondering whether starting up the PHP interpreter for every script
> hurts performance, if there's anything I can do about it, and if possible,
> would the potential gain be noticeable? We're talking a machine in the
> range of 1 GHz CPU speed, with IDE disk drives. I've already considered
> all kinds of Linux-specific "tricks", I'm interested in the pure PHP
> aspect of the issue.

You'll want to build your PHP binary lean and mean, of course, including
only the Modules you *need* for those scripts to run.

If there is some HUGE module that you need only rarely, and only for one
script, you could even compile two binaries, and only use the fat one when
you need it.

I suspect, though, that the OS will cache all of PHP binary for the most
part, and you're needlessly worrying, instead of testing/benchmarking.

Try it and see.

If all that doesn't work...

I suppose you could create a PHP script with an endless loop in it,
reading from some socket or STDIN, and which does an http://php.net/eval
on the data given to it... I really doubt that this is a Good Idea, much
less that you need it in the first place. Could be fun to try it, though.

--
Like Music?
http://l-i-e.com/artists.htm

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация