httpd w/PHP performance

Michael Conrad mconrad at intellitree.com
Thu Jun 21 17:10:21 UTC 2012


On 6/21/2012 8:39 AM, Gary Altenberg wrote:
> On 6/21/2012 5:01 AM, Laurent Bercot wrote:
>>
>>> There might also be some downsides to repeated alloc/free in the
>>> embedded environment.
>>   Not at all. As long as you have enough memory to serve the 
>> requests, and
>> dynamic allocations are kept to a reasonable level, there's no 
>> problem in
>> performing several of them in an embedded environment. If anything, the
>> fork+exec approach makes memory management easier on the programmer (and
>> on the kernel to some extent) since every exec and every process death
>> trigger automatic garbage collection for the late process.
>
> Doesn't this depend on what CPU you are using? If you are using a NO 
> MMU CPU doesn't a lot of alloc/free calls leave your memory very 
> fragmented?
>

Not if you free *everything* when you're done.

(It's a moot point anyway, since PHP runs every request with a fresh 
variable-space, and the strategies of "deallocate everything" and 
"exit/fork-a-new-process" are nearly identical)


More information about the busybox mailing list