Re: apc improvements
| From: | garana at uolsinectis dot com dot ar | Date: | Sat, 11 Jun 2005 03:49:41 +0000 |
| Subject: | Re: apc improvements | ||
| References: | 1 2 3 4 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-2461@lists.php.net to get a copy of this message | ||
Citado por Rasmus Lerdorf <rasmus@lerdorf.com>:
Gonzalo Arana 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.On Fri, Jun 10, 2005 at 02:19:21PM -0700, Rasmus Lerdorf wrote:Normally on a busy web server you fix the number of client processes and don't waste cycles killing any off and re-forking.Gonzalo Arana wrote:In fact, yes it does (at least I think). I gues this is a 'thunerding herd' problem (too many processes waiting for a rwlock, the lock is released, and all processes are awaked, but only one gets the lock). This would explain why the number of context switches have increased drastically.Hi, I've tested apc in one of my apaches, and I've got this results: context switches (from vmstat) w/out apc: 4k/sec with apc: 200k/sec running processes (from 'vmstat 1') w/out apc: 0-9 with apc: 20-100Wait a second, why do you have more running processes with APC? That makes no sense to me and makes all your other numbers rather meaninglesssince it doesn't look like you are comparing similar Apache configurations.Actually the figures are from the same web server, same apache configuration, and same http traffic. The only difference is with apc turned on and turned off.
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.
so if the traffic is the same you should be seeing less processes.Indeed. That's why my initial post to the list.
If the lock has that big of an effect on your system, there is a serious problem.Ditto.
Which OS are you on? And which locking mechanism did you build APC with?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.
Your numbers don't look anything like what I see on Linux and FreeBSD.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?
-RasmusGonzalo