Wow... 5.4 + APC = FAST

Permalink 4 users found helpful
My concrete sites have always been noticeably slower than my other sites, so I installed the APC opcode on my server after reading about the benefits here on the forum. I was a little disappointed after I first installed it and spent quite a bit of tweaking it to make sure the settings were correct. Then some more digging in the forums led me to this gem
define('CACHE_LIBRARY', 'apc');
which needs to be placed in site.php to get the full effect of APC. There is zero lag now, the combination of the new 5.4 and APC is incredible, definitely lives up to the hype, well done.

hursey013
 
okhayat replied on at Permalink Reply
okhayat
This is excellent news. Can you please provide a link to the site, if possible, to evaluate the speed?
hursey013 replied on at Permalink Reply
hursey013
This site's in development - but it's a fair size and has a considerable amount of javascript, etc -http://pimasheriff.org/. Just upgraded to 5.4, and its being hosted on a media temple (dv) server.
katz515 replied on at Permalink Reply
katz515
Cool.

I'm hosting this...

http://www.jffla.org

on (mt) dv hosting with eAccelarator 0.9.5.3.

But I may switch to APC after upgrading to 5.4.0 then.

Thank you for sharing!
Mnkras replied on at Permalink Reply
Mnkras
yea eaccelerator is being uninstall by all hosts as it is unstable with the new php version
bryanlewis replied on at Permalink Reply
bryanlewis
I have a (dv) Media Temple server as well. Can you post the link that showed you how to install APC on your server? I'd like to benefit from this too.
mario replied on at Permalink Reply
mario
we have a lot of sites on MT dv too. I second the request. ;)
hursey013 replied on at Permalink Reply
hursey013
Here is a great tutorial, specifically for Media Temple, however I don't see why the setup would be much different for other hosts, provided your on a linux setup:http://blog.tech4him.com/2009/12/installing-apc-on-mediatemple-dv-3...

I followed the directions step for step, the only area that may need to be adjusted to your own server is the php.ini line
apc.shm_size = 64
. This is the amount of shared memory APC will use. By default it is 30, 64 seems to accommodate my setup better, but it may be higher or lower for you.

When you download the APC package, it comes with a file called apc.php. You can upload this to a public folder on your site, and when you access it, it will give you a bunch of details and graphs about your APC installation. This is where you will be able to tell if you shared memory should be adjusted. Basically, if all of the allotted memory is shown as "used" you will need to increase the size until you can see all the cached pages fit within the memory comfortably.

And most importantly, once everything is set up, dont forget to add
define('CACHE_LIBRARY', 'apc');
to your site.php - this makes all the difference.
mario replied on at Permalink Reply
mario
thanks for the info!

EDIT: is this the correct link to download it?

http://pecl.php.net/get/APC-3.0.14.tgz...

got it offhttp://us3.php.net/apc

just want to make sure we'd be using the same version.
dibbc replied on at Permalink Reply
dibbc
Dude, your site is awesome, and the careers video is amazing, great work whoever did that!

http://pimasheriff.org/careers/...

What theme are you using, or did you custom make it? Looks nice.
hursey013 replied on at Permalink Reply
hursey013
Thanks for the compliments! The theme was custom designed by me, and the video was created with Adobe After Effects in house as well.
andrew replied on at Permalink Reply
andrew
Agreed. That's a very nice looking site. Kudos.
PerryGovier replied on at Permalink Reply
PerryGovier
wow, i installed apc a while back and saw a decent increase but with this added to the site.php, it's insane.

this is very seriously almost as fast as raw html...
i'm gonna declare any speed concerns i had officially dead.

Thanks, this is great news to me.
mario replied on at Permalink Reply
mario
we've got the e-commerce plug in a few of our sites. would intensive caching affect their cart, for example? this question is directed more at the c5 team.

@hursey once you install APC caching can we configure it to be applied on a site by site basis? sorry if my questions are ignorant, i'm not a server admin.
frz replied on at Permalink Reply
frz
Nope caching should work with all interactive elements just fine.
mario replied on at Permalink Reply
mario
thanks franz. the reason i asked is because Remo and a few other people were having a thread discussion re caching options. our developers brought it up as well as a potential issue.

thanks for the reply hursey. we'll look into it too :)
chunksmurray replied on at Permalink Reply
chunksmurray
For those on Windows environments, I found this tutorial a little while ago and it works well:http://docs.moodle.org/en/Installing_APC_in_Windows...
hursey013 replied on at Permalink Reply
hursey013
That I am not sure of... I installed it at a server level, however you may be able to have it disabled by default and then use an .htaccess or php.ini on a site by site basis to enable it - I would have to look into APC a little more to see exactly how it works though.
olacom replied on at Permalink Reply
olacom
Anyone know a good shared hosting provider with APC activated ?
olacom replied on at Permalink Reply
olacom
I've tried a website that is cache managed by Zend and it was 4.4 seconds in response time total.

Same website on APC: 0.42 seconds in response time total.

It super fast!!!

So happy.

Cheers,
RadiantWeb replied on at Permalink Reply
RadiantWeb
http://www.a2hosting.com/web-development/apc-hosting

these guys seem pretty good. I've been thinking about giving them a go.

I will probably try them out for my next project.

C
pakigreenl replied on at Permalink Reply
pakigreenl
So I checked out the A2hosting. They don't show anything on APC but do have Zend optimizer. So which works better ZO or APC. Or do they do equally well. According to some of the post can C5 even use Zend Optimizer?
Fernandos replied on at Permalink Reply
Fernandos
I have compiled and installed APC on my servers last week and it's noticably faster now. Great!
myFullFlavour replied on at Permalink Reply
myFullFlavour
Has anyone come across any problems with the methods described in this thread where they are hosting multiple concrete5 sites on one server?
hursey013 replied on at Permalink Reply
hursey013
I'm on a dedicated virtual with 10 or so c5 sites, only a couple are 5.4 however. What problems are you experiencing?
myFullFlavour replied on at Permalink Reply
myFullFlavour
In the Beta testing forums, some comments were made that you could only have one website utilizing APC in a shared hosting environment (without specifying extra code).
hursey013 replied on at Permalink Reply
hursey013
Well if that is the case, any additional details on the topic you can provide would be very helpful. I was planning on utilizing apc on several sites on the same server, so if there are additional steps needed to do this properly I'd like to know!

Thanks for the info.
hursey013 replied on at Permalink Reply
hursey013
You're right, it doesn't work. I guess it kind of makes sense though since APC will be caching multiple instances of the same files and they probably all get mixed up...bummer. Seems like a solution might be to run multiple sites off of one core installation, however I wonder if that would even solve the problem.
myFullFlavour replied on at Permalink Reply
myFullFlavour
I think the solution is to do with defining a unique instance per site... Will keep you posted!
synlag replied on at Permalink Reply 2 Attachments
synlag
Might be good for parallel requests, see loading time concrete5 attached.
mose replied on at Permalink Reply
mose
Already discussed here with a possible solution. Cache entries need to be unique for each site.

http://www.concrete5.org/community/forums/chat/cacheand039ing-andam...
PassionForCreative replied on at Permalink Reply
PassionForCreative
Hate to ask a dumb question, but where is site.php located?
chunksmurray replied on at Permalink Reply
chunksmurray
site.php is located in the /config directory.
PassionForCreative replied on at Permalink Reply
PassionForCreative
in my version of 5.4.0 the only file in the /config file is site_theme_paths.php. Is this the right file to edit?
mose replied on at Permalink Reply
mose
site_theme_paths.php is not the correct file to edit. It should be site.php. site.php is created in the config directory during the installation of Concrete5.

After unzipping the Concrete5 installation file in the correct location, you would use a web browser to visit the website. A screen appears with multiple checks on it. Make sure they are all green. Enter information in the boxes about the database server/user/password and such. Click the button to install. More details are available in the documentation.

http://www.concrete5.org/documentation/installation/installing_conc...
PassionForCreative replied on at Permalink Reply
PassionForCreative
cool. I was looking at the files downloaded to my machine for the site.php file. Does anyone have an idiots guide step by step for doing the install for APC?
mdzoidberg replied on at Permalink Reply
mdzoidberg
freestylemovement replied on at Permalink Reply
freestylemovement
have you found a workaround for caching multiple site on one server yet? would love to implement this, if you even have a starting point maybe i could put in some time
hursey013 replied on at Permalink Reply
hursey013
check out the solution by mose in this thread:http://www.concrete5.org/community/forums/chat/cacheand039ing-andam...
wizardontherun replied on at Permalink Reply
wizardontherun
has anyone used this on a windows 2003 server? and know a good download site?
chassa2556 replied on at Permalink Reply
chassa2556
I have it confirmed that my server is using the accelerator Zend optimizer. Does anyone know how to configure this so it works with C5. I urgently need to know as my sites are soooo slow - thanks
adamjohnson replied on at Permalink Reply
adamjohnson
I thought that it was this:
define('CACHE_LIBRARY', 'zend');

...but I just tried it and it does not seem to work. Also tried 'zend_optimizer' and some others with no success.

I remember this being available on this site six months ago but can't find any mention of it at the moment. Anyone know what the correct code is?

More on the syntax here:http://www.concrete5.org/documentation/developers/system/caching...

Ps - Why no example documentation of this code on the above page?

Thanks in advance for the help.
jbx replied on at Permalink Reply
jbx
Unfortunately, integrating the Zend Server caching wont work at the moment. This appears to be a victim of the differences in naming conventions between Zend and Concrete5.

The caching libraries in the Zend Framework are mostly all single CamelCased files in the Cache/Backend directory. In order to reference CamelCased filenames, C5 uses an underscore, so 'Two_Levels' will translate to TwoLevels.php. There is a ZendServer.php backend, which could be referenced using 'Zend_Server'. This is where we hit a problem. The class inside ZendServer.php is an abstract class, which can't be instatiated. this is because you actually need to instantiate one of the classes in Cache/Backend/ZendServer/Disk.php or Cache/Backend/ZendServer/ShMem.php. Zend uses the underscore to indicate a new directory, so you would normally call 'ZendServer_Disk', but C5 needs to use the underscore to camelcase and has no way of interpreting the subdirectory here. So we appear to be stuck.

Sorry, that was a bit heavy, hope you stayed with me...

@Andrew - could you possibly confirm whether what I've written is correct, and is there a workaround for it? Would be great to use, as all my C5 sites run on Zend Server.

In the meantime, I'm gonna have another play with APC, but I didn't have great results running it on PHP5.3 last time I tried :S

Jon
jbx replied on at Permalink Reply
jbx
Managed to get APC running nicely and it really does make a huge difference! On one of my sites, the slowest page was always going to be the home page, as it pulls in a number of external feeds. However, these feeds are not updated often, so I've enabled full page caching for this page and piped everything through APC and now the load time for that page has reduced from around 5s to under a second (that's a real world "time to display in a browser" time).

Liking this page caching stuff :)

Would be nice to try the Zend Server option tho as everything else in my setup is based around Zend...

Jon
PatrickHeck replied on at Permalink Reply
PatrickHeck
Why not be a little more carefull when defining the cache library and check if APC is enabled first? That way your site won't break if APC will suddenly get disabled by your host for some reason.
if ( extension_loaded('apc') && ini_get('apc.enabled') == "1") {
   define('CACHE_LIBRARY', 'apc');
}
whereb replied on at Permalink Reply
whereb
Wow from me too - I just installed apc and put this in the config/site.php on an ecommerce site running 5.5.1 which was experiencing load times in the 30+ seconds (still in developer mode so C5 page caching was off), now even the heaviest pages are loading in around three seconds - what a difference!

It will be interesting to see what further speeds we can get once development is over and the page caching is turned on.

Thanks for this post - saved the day over here...

:)
zoinks replied on at Permalink Reply
What hosting provider are you using? Are you on MediaTemple, too?
webicine replied on at Permalink Reply
webicine
I'm wondering the same thing. What hosts are people using that are supporting APC? I'm currently using Dreamhost and Bluehost and am not happy with my load times.