PDA

View Full Version : APC, Memcache, and xcache


Kaelon
07 Aug 2008, 20:37
Hi Everyone,


I have a "big board" (30,000 active users, 1.3 million posts, around 500 concurrent users at normal peaks), but never used (or know much about) PHP Accelerators / Caches. In a recent conversation over at vB.com, it was suggested that future versions of vBulletin will make great use of APC and Memcache. So I installed both APC and Memcache, and I set the config.php Datastore to APC.
Can I use both APC and Memcache? Does this make sense?
I have heard a lot of talk about xcache. Is this preferrable to either or both?
How can I make sure that vBulletin is using APC, Memcache, and/or xcache?Thanks!

Edit: This particular site is running on a single Enterprise Intel Quad Core Xeon Server.

ssslippy
09 Aug 2008, 03:29
On a single server setup you are better off running xcache. Xcache has a web utility that lets u see its usage I am unsure on the others.

Also you only want to run one cache system.

Memcache is the recommended for a multi server network as you can then run one memcache server that stores all the cache for all your servers making life allot easier.

I am not a pro but this is what I get from most readings or conversations.

djxcee
10 Aug 2008, 10:18
The only thing I have on my dedi server is XCache and it's working fine.

Kaelon
10 Aug 2008, 22:45
Great, thanks, Everyone. I ditched Memcache, and switched from APC to Xcache. I've noticed some mods -- like PhotoPost vBGallery -- are incompatible with Xcache, tragically. Just something I will have to watch out for in the future. :)

ssslippy
13 Aug 2008, 22:51
Photopost should still be able to run even xcache it just doesnt fully utlilize the API. If it doesnt I would complain to the mod maker.

Kaelon
13 Aug 2008, 23:19
Photopost should still be able to run even xcache it just doesnt fully utlilize the API. If it doesnt I would complain to the mod maker.
Yep, already done. They say that they currently don't support it, so made it throw in an exclusionary if/then statement into my config.php to disable Xcache on Photopost pages.

ssslippy
14 Aug 2008, 00:21
Ah sounds like they are not following vbulletin standards for coding and having conflicts with it. Interesting to know.

Jafo232
14 Aug 2008, 18:56
On a single server setup you are better off running xcache. Xcache has a web utility that lets u see its usage I am unsure on the others.


They all have the utility and APC's is the best as far as that goes. It breaks things down into graphs, etc..

Either way, any of them will do the trick as far as opcode caching is concerned. APC is handled by the same developers who work on PHP, so that might have something to say for it.

ssslippy
14 Aug 2008, 21:07
Xcache currently beats APC as far as which one is faster. Until you start running a dedicated cache machine then memcache becomes superior.

Jafo232
14 Aug 2008, 23:02
Xcache currently beats APC as far as which one is faster. Until you start running a dedicated cache machine then memcache becomes superior.

Memcache really has nothing to do with opcode caching, it is a memory object caching system so not sure how you compare either against it. We currently run all three (Xcache, eAcc, and APC) on different machines and they all use memcache.

As far as which one is faster, I have seen different results, but this benchmark is pretty accurate:

http://2bits.com/articles/benchmarking-drupal-with-php-op-code-caches-apc-eaccelerator-and-xcache-compared.html


Requests per Second | Single Request (milliseconds) | Memory (Max, MB) | Memory (Min, MB)
None: 10.41 96.08 24 24
eAccelerator: 31.26 31.99 23 18
XCache: 30.28 33.02 29 19
APC: 30.45 32.84 21 21


Conclusions

From the above results, one can come to the following conclusions:

* All op-code caches provide a noticable improvement for Drupal over a default PHP installation.
* The speed gain is about 3X.
* eAccelerator is marginally better than the XCache or APC both in terms of speed and memory utilization.
* Installation of each op-code cache is different: one has a Debian package, the other is installed from source and the third is via PECL.
* The configuration for each is also different. Some work well with a default install, others require more tweaking.



However, one must consider the fact that APC is actively maintained by PHP core developers, whereas Xcache is maintained by one person and what happens when he loses interest or otherwise moves on?

Myself, I tend to stick with APC just because the knowledge of the authors when it comes to PHP is intimate.

Zia
28 Jan 2009, 03:01
, whereas Xcache is maintained by one person and what happens when he loses interest or otherwise moves on?
.

xcache dev. is still going on.......

|Jordan|
29 May 2009, 09:09
How much ram is recommended when using a cache? My dedicated server has 1Gb, is that too little for it?

Dismounted
29 May 2009, 12:07
It depends on the cache time, cache size, and general size of the board.

|Jordan|
30 May 2009, 09:28
Well im going to put a new website/forum on the server. I expect it to generate a lot of traffic. The part of the website that will be using the most traffic/resources will be a perl script that reads data from remote servers and compiles statistics.

What cache time and cache size should i initially use? I have another server computer that i use for game servers, it has 4GB of memory and 3GB are free most of the time. Can i install memcache on that one and have it share with the web server? Both servers are in the same location (a few meters away from each other).