> 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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to