|
Posted by Chung Leong on 10/20/06 14:31
CptDondo wrote:
> I've got a problem with performance...
>
> I'm working on a fairly slow embedded platform (a 200 MHz ARM board).
> We run a browser and a webserver on the same platform.
>
> I've timed the performance, and the webserver takes between 5 and 6
> seconds to generate the page. Most of this time is spent running php.
> The webserver is buysbox's httpd daemon, which invokes php every time a
> page is served.
>
> I'm guessing that I could save a few seconds of this time by keeping php
> resident in memory so rather than incurring the overhead of starting it
> every time.
>
> So... Is this a right guess? How long does it take to load php? Is
> there some way to daemonize PHP so that it doesn't have to load up every
> time?
PHP initialization is fairly expensive. A couple megs of code have to
be loaded into ram; the ini file has to be parsed; a couple thousand
built-in functions have to be initialized (a lot of memory allocation).
Depending on the performance of the storage system, it could take a
while.
> I am looking for any and all suggestions to speed this beast up....
As suggested, use FastCGI to avoid having to start PHP every time.
Beyond that I don't know what more could be done. Since it's an
embedded system, there probably isn't a whole lot of memory to go
around. The low performance could simply be the result of swapping.
Five seconds to generate a page sounds excessive even on a slow CPU. It
could also simply be that your PHP code is inefficient.
Navigation:
[Reply to this message]
|