Re: apc improvements
| From: | Rasmus Lerdorf | Date: | Fri, 10 Jun 2005 21:03:21 +0000 |
| Subject: | Re: apc improvements | ||
| References: | 1 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-2455@lists.php.net to get a copy of this message | ||
Gonzalo Arana wrote:
> 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-100
>
> Cpu usage
> with aps: 30% user, 60% system
> w/out aps: 50% user, 10% system
>
> I suspect this figures may be the result of the fact that apc uses only
> a rwlock (it does not implement nor use rw/ro locks).
>
> Therefore, internal structures are always locked in a mutex-style, even
> in the case of a hit.
>
> In my opinion, apc needs a read-write/read-only locking strategy to
> boost performance. With this implemented, in case of a hit to apc's
> cache, the running process would not be rescheduled by the kernel.
> Right now, if the lock is held by another process (even in case of a
> hit to apc's cache), the running process would get scheduled.
>
> I would like to work on this. Does a feature like this have any chance
> to get into apc's official source code?
But there is a write on every hit for counters and the last accessed
timestamp so I am not sure where a read-only lock would be applied.
-Rasmus