php accelerator

php accelerator

by Genner Cerna -
Number of replies: 19
php accelerator for php 5.1+ is ther available out there?
Average of ratings: -
In reply to Genner Cerna

Re: php accelerator

by Justin Tan -
I have tested eaccelerator 0.9.5 beta 2 with php 5.1. however things doesn't work out. The beta version doest work on moodle 1.5.3+ . I dun know about other version of moodle. But the eaccelerator halt when loading some php page. It just hang there and i need to restart the server.
I hope someone can do something about it. I going to test on APC.
Anyone tested it. Doest it work well ?
In reply to Justin Tan

Re: php accelerator

by Genner Cerna -
i do agree that eaccelerator doesnt work weel with php5+
In reply to Genner Cerna

Re: php accelerator

by Justin Tan -
Initial test of APC with PHP 5.1 working fine with performance increase more than 500%. I dint test for long run yet. 
In reply to Justin Tan

Re: php accelerator

by Genner Cerna -
i did installed APC still observing... thanks, hope nothing breaks...
In reply to Genner Cerna

Re: php accelerator

by tm tm -

from where i can download APC for php 4.3.11?????

i have used eacaclerator but pages are breaking....

In reply to tm tm

Re: php accelerator

by Justin Tan -
if i not mistaken APC support PHP 4.X and 5.X. So just get the latest version
In reply to tm tm

Re: php accelerator

by Ken Wilson -

Download from here http://pecl.php.net/package/APC.

Remember that there is a processor overhead and adjust the php.ini settings according to this formula:

Free memory = apc.shm_segments * apc.shm_size

Example: with 512Mb physical RAM free on the server, I have apc.shm_segments = 4 and apc.shm_size = 128 (or any combination but the more segments the better - you need to experiment.) If this is not set properly, your server will start to page files to disk, which decreases performance.

Ken

In reply to Justin Tan

Re: php accelerator

by Kenny Backus -
APC works great for me, too, as does eaccelerator 0.9.5 beta 2, BUT...

If I turn the "apc.stat" variable to 0 (do not check to see changes in PHP scripts... supposedly would give a significant performance boost but require an apache restart in order to update scripts, which is okay as I don't plan to change any of the scripts), then my frontpage becomes blank. I can still access other php scripts like apc.php, and strangely there are no PHP errors on the screen OR dumped to apache logs. This is really bothering me because I have somewhat limited hardware and the user load is going to increase several times when the Fall comes. I need every bit of performance for when people want to hold quizzes or other heavy-load activities.
In reply to Kenny Backus

Re: php accelerator

by Ken Wilson -
I'd leave apc.stat = 1 (as default). Looking on the php dev mailing list, there is a recent discussion showing no big gains in setting it to 0, which is contrary to the official docs.

Ken
In reply to Ken Wilson

Re: php accelerator - apc fragmentation

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers

I'm running Apache/2.0.55 (Ubuntu) PHP/5.1.2 mod_ssl/2.0.55 OpenSSL/0.9.8a with the following APC settings. I have started to see some (what appears to me) significant fragmentation occuring when I look at the apc.php. I was wondering what I might do in terms of configuration to avoid fragmentation and when should I get concerned about fragmentation? How are other Moodlers handling/monitoring this? For the time being, I have opened up the page so that it can be seen at http://moodle.jesuitcp.org/apc.php - any advice would be greatly appreciated.

APC Runtime Settings

apc.cache_by_default 1
apc.enable_cli 0
apc.enabled 1
apc.file_update_protection 2
apc.filters
apc.gc_ttl 3600
apc.max_file_size 1M
apc.mmap_file_mask /tmp/apc.G60RtP
apc.num_files_hint 1024
apc.optimization 0
apc.shm_segments 1
apc.shm_size 64
apc.slam_defense 0
apc.stat 1
apc.ttl 7200
apc.user_entries_hint 100
apc.user_ttl 7200
In reply to Kenny Backus

Re: php accelerator

by Justin Tan -
mind to share what version of php you are using.
I have tried eaccelerator on php 5.1.4 but many pages just hang halfway. No error in apache log and i dun know where to debug. U are using eaccelerator 0.9.5 beta 2 for windows or for linux ? I am using it for windows platform
In reply to Justin Tan

Re: php accelerator

by Ken Wilson -
Justin

Here's the output from 'php -v':

C:\>php -v
PHP 5.1.4 (cli) (built: May  4 2006 10:35:22)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies

The windows binary is a download from here http://pecl4win.php.net/ext.php/php_apc.dll. I'm using the php-5.1.2 version and it seems stable.

Ken



In reply to Ken Wilson

Re: php accelerator

by tm tm -

hi

i have just downlaoded APC binary for php 4.3.11. could anybody give me the settings to be made in php.ini and in APC whose APC is running successfully??

 

Regards,

Tahir

In reply to Ken Wilson

Re: php accelerator

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
Ken - If you have a moment, would you mind taking a quick look at http://moodle.jesuitcp.org/apc.php and let me know if I should be concerned about the level of fragmentation and perhaps any recommendations you might have to avoid it? I'm new to the who php acceleration and APC thing. Peace.
In reply to Anthony Borrow

Re: php accelerator

by Ken Wilson -
Anthony

The fragmentation figure may be a red herring. APC has an efficient algorithm for reducing fragmentation and uses a simple offset-based linked list to store cache entries.

Take a look at the cache full count. In the last 3 days the cache has been purged twice, so its getting full and cleaning-out the old entries (those not accessed in the Time To Live time= 3600secs).

Try increasing the apc.shm_size first, but check that you have enough free memory (use the free value in 'top'). 128M is a good size - but it all depends on how much shared memory has been allocated in your system - again use 'top' to guide you on this.

If it works for you, set apc.stat to 0 (but note that there's controversy over this setting at the moment), and try increasing the number of apc.shm_segments (although Rasmus - the lead developer and the guy who invented PHP uses only 1 segment wink).

It would be interesting to hear how you get on, so please report back.

Ken

In reply to Ken Wilson

Re: php accelerator

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
Ken - Thanks for getting back with me and for the feedback. When I get back to the school I will increase the size to 128M. We have 4 gig on the machine so I am sure we can spare 128M. I will also switch the number of segments to 4. For the time being I will leave stat at 1 and see what happens. The server ran for several days with no problems but it is something I want to keep an eye on and I will report back how things go. I should have a good idea with the server getting loaded as school begins. 
In reply to Genner Cerna

Re: php accelerator

by Eric Schewe -
I personally we keep it simple using Zend Optimizer v3.0.1 which now supports PHP 5.1.4.
In reply to Eric Schewe

Re: php accelerator

by Chris Potter -
Same here. It wasn't a 'huge' performance boost, but it helped. Anything is better than nothing.