Re: apc improvements
| From: | Rasmus Lerdorf | Date: | Sat, 11 Jun 2005 07:26:38 +0000 |
| Subject: | Re: apc improvements | ||
| References: | 1 2 3 4 5 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-2463@lists.php.net to get a copy of this message | ||
garana@uolsinectis.com.ar wrote:
> indeed. My problem is not forking. The number of running processes,
> and context-switches, and kernel-mode-cpu-usage grows when I enable APC.
> I can't reproduce the problem right now (I'm off the office). Let me
> try this in a testbench and provide readprofile's output, to see where
> are all those kernel-mode cpu is going.
If your MaxClients were fixed and you prefork that many processes and
never kill any, nor fork new ones, then the number of processes can't
increase, period. You obviously don't have your server configured like
that.
>> And I don't see where APC can cause a thundering herd problem.
>
>
> As I stated in my previous post, I am just guessing there. But the
> symptoms are quite the same: lots of context switches (about 200 times
> bigger than without APC), kernel-mode-cpu usage grows signifficantly
> (which should be related somehow to the grouth of context switches).
>
>> An APC request finishes faster than a non-APC request,
>
> Not entirely correct, I'm afraid. I agree that an APC request should
> require less CPU cycles. The wall clock timing may be determined by
> other factors like task scheduling, for instance. Since APC uses locks,
> task scheduling is modified.
Well, it does on my servers. Between 15% and 40% faster. It obviously
will have no effect on static pages.
> Linux, debian (3.0). Kernel 2.4.X (don't remember the exact version
> number, I'm off the office :( ).
> I've tryied with fcntl and semaphores. Same result in both cases.
Perhaps try a spinlock instead. I am actually using a completely
different locking kernel-based locking scheme for my production servers.
> My web server is dual processor. I have 400 hits/sec (including static
> hits).
>
> I guess this is an obvious 'answer=yes' question, but: have anyone
> tested APC on SMP servers?
What happens if you turn one of those cpus off? Does the picture
change? Many locking mechanisms completely fall apart under crappy SMP
like the Linux 2.4 kernel has.
-Rasmus