logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> How-to's & Documentation & Tips View previous topic :: View next topic
Reply to topic   Topic: Tip: Speed php up, APC cache and php 5.1.6
Author
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Sat 03 Jun '06 13:45    Post subject: Tip: Speed php up, APC cache and php 5.1.6 Reply with quote

I like to share my experience with APC.

The Alternative PHP Cache (APC) is a free and open opcode cache for PHP. It was conceived of to provide a free, open, and robust framework for caching and optimizing PHP intermediate code.

It's amazing, it speeds up the page generation time here with the phpBB forum scripts about 50%, average from 0.0472 to 0.0234 seconds (you milage may vary).This accelerator might get even better, in the near future, since some of the PHP developers appear to also be involved with APC. I tried first to use eAccelerator with same results, but had issues with a Joomla site.

To make your live easy,
I packaged for you APC for Win32, compatible with PHP 5.1.6 and with latest Administrator interface script. At the download page here.

Installing is easy:

Note: APC is not compatible with Zend-Optimizer, so Do _NOT_ combine with APC-Cache!

- Copy the DLL in the zip to your php extensions folder.

- Enable this extension in your php.ini by adding the line:
extension=php_apc.dll

- Add the APC configuration directives to your php.ini, my configurtation is:

apc.enabled = 1
apc.shm_segments = 1
apc.shm_size = 64
apc.optimization = 0
apc.num_files_hint = 1000
apc.ttl = 0
apc.gc_ttl = 3600
apc.cache_by_default = On
apc.slam_defense = 0
apc.file_update_protection = 2
apc.enable_cli = 0
apc.stat=0

- Restart your web server.

- copy the apc.php script to somewhere in your docroot and load it up in your browser.
It provides you with a detailed look at what is happening in your cache. If you have GD enabled in PHP, it will even have pretty graphs.

The documentation you can find at http://nl3.php.net/apc

Enjoy and post how you go,

Steffen

Admin note:
If you have issues with APC, please do not post in this thread. Post it in the "Software Installation & Programming" forum
Back to top
Kanashii



Joined: 17 Jul 2006
Posts: 155
Location: Porando

PostPosted: Thu 20 Jul '06 14:20    Post subject: Reply with quote

Hmm nice but what about PHP Encoding its lots of commercial Encoders Like Zend or Phpshield but you have to to pay for this. Its in APC function to encoding one time my script directory or only Caching from source ?
Back to top
shnazz



Joined: 22 Sep 2006
Posts: 7

PostPosted: Thu 28 Sep '06 16:08    Post subject: Reply with quote

Thanks for the instructions. I've manged to install apc pretty easily and its working great. I have a couple of questions for anyone who is using Steffen's configuration in php.ini or just APC in general:

with apc.stat=0, new pages are not cached when they are added, or modified ( I may be mistaken ). As a result I enabled it, but noticed some performance decreases. What are you doing to re-cache when scripts are modified or added? is it as simple as auto-rebooting apache, or is there some kind of configuration that does this without checking the script on each request?

- shnazz
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3092
Location: Hilversum, NL, EU

PostPosted: Thu 28 Sep '06 18:45    Post subject: Reply with quote

You can use it within apc.php, there is a button "Clear opcode Cache".

Steffen
Back to top


Reply to topic   Topic: Tip: Speed php up, APC cache and php 5.1.6 View previous topic :: View next topic
Post new topic   Forum Index -> How-to's & Documentation & Tips