php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #57964 APC performance improvement hint
Submitted: 2007-12-11 19:30 UTC Modified: 2007-12-11 19:43 UTC
From: Ninzya at inbox dot lv Assigned:
Status: Closed Package: APC (PECL)
PHP Version: Irrelevant OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: Ninzya at inbox dot lv
New email:
PHP Version: OS:

 

 [2007-12-11 19:30 UTC] Ninzya at inbox dot lv
Description:
------------
Hello.

I very apreciate the work you guys have done to get APC working for PHP, it's the best opcode cacher available out there, keep up going this high!

I'm developing large, high-performance websites written in PHP on WAMP, supported by APC. A couple of weeks ago i started to improve my code by optimizing it, and also, getting all the best out of PHP + APC performance. The main discovery that i made while i was trying to get over a 3 millisecond middle-sized page generation on 2.15GHZ Core2DUO processor is that the bottleneck is a hard disk! What does APC? with apc.stat =0 completely eliminates all php's accesses to hard disk drive by caching php scripts into RAM. This improves performance fantastically, even if i had only 10 files to include in my web page with apc.stat =1. I mean, 10 accesses to hdd cost to me about 10 milliseconds of execution time. After the fact i have faced, i started to worry about every include i got in my scripts, and, every potential hdd access due web page request processing. I downloaded Process Monitor, the program that is able to monitor filesystem activities of specific processes. What i saw on php is that due to every request to web page with apc installed, apc does lots of locking and unlocking of lock files in windows temporary directory. I have downloaded the lastest source code (version 3.0.15) and actually found that APC is using a filesystem for synchronizing itself! And i have a question about that. Why is APC using filesystem for synchronization? Isn't it possible to build into APC a semaphore, lock, spin lock or something, that will operate in memory of current process? This one can make APC A LOT FASTER. If implementation of "non-filesystem" locks in APC is possible, i would be very glad if you make this come true. The key to performance is to remove all access to hard disk.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-12-11 19:43 UTC] shire@php.net
This is all already implemented, I recommend testing out pthread mutex locking, however for the more brave I'd love feed back on the spin locking as well.

./configure --enable-apc-pthreadmutex 
or
./configure --enable-apc-spinlocks

pthreadmutex locking should become the default in an upcomming apc release.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 18:01:32 2024 UTC