Back to vBulletin 4.x Add-ons

XCache for vBulletin Caching
Mod Version: 0.9.1, by rossco_2005

vB Version: 4.x.x Rating: (6 votes - 4.67 average) Installs: 35
Released: 31 Jan 2012 Last Update: 27 May 2013 Downloads: 279
Not Supported Code Changes Additional Files Is in Beta Stage  

This mod will replace the default vB_Cache_Db class (database cache) used in vBulletin with an xCache implementation of it.
vBulletin has promised to implement this option themselves, but I'm sick of waiting, so I created this.

What are the benefits of using XCache for caching over MySQL (Database) ?

In theory, quicker page load times, lower server load. This will offload the duty of caching from mysql and throw it into the RAM.
It will also reduce your query count per page.

The most staggering difference you will notice is with the CMS, or any mods that make good use of the cache.
For instance, in my dev site using the default CMS content and settings, browsing as a guest, I was able to shave off an average of 0.06 seconds from the page generation time (0.23 -> 0.17 seconds) and 43 queries (86 -> 43)!
In a live site, the reduction in queries and overall time spent serving the page will have a large effect on overall performance in a busy site.

Make sure that you also have the datastore cache method set to xcache as well for further query reduction: https://www.vbulletin.com/docs/html/datastore
Also install "Load templates from XCache" for further query reduction: Load templates from XCache

Any drawbacks?

Other than a file edit required on every vBulletin upgrade, none that I can think of... If you think of one, post it.

What about other data caches ? (memcached, apc, etc.)

I could write those as well, if there is a demand for it, and they happen to work similar enough to xcache.

This is a beta!

This has been tested in a live forum for a few days, and no incidents/side-effects have been noticed or reported, but I cannot yet guarantee it is 100% perfect.

This mod requires one file edit

See http://tracker.vbulletin.com/browse/VBIV-13241 to find out why: http://tracker.vbulletin.com/browse/VBIV-13241

Requirements

This was designed to fail gracefully by falling back on the DB cache if there is an error, so if there is an error you will not even realize it.

Make sure these requirements are met:
  • XCache 1.3.2 installed (only version that I tested) (verify by viewing phpinfo page)
The following are in your XCache ini settings (php.ini usually):
  • xcache.var_size = 32M (32MB; at least)
  • xcache.var_slots = 8k (8000; at least)
  • Set xcache.admin.user and xcache.admin.pass to whatever you want (keep in mind that the pass must be MD5'd)

Restart after making any changes.

Another tip is to set your xcache.count and xcache.var_count to the number of CPU cores that you have.

See the documentation here: http://xcache.lighttpd.net/wiki/XcacheIni

After running this mod for a while, check your xcache admin page to ensure that your var_slots and var_size are large enough.

Install Instructions

1. Upload the contents of the UPLOAD folder in xcache.zip to your forum root

2. Open up your /includes/config.php file and add the following:

PHP Code:
/*
 * XCache Config
 */
$config['xcache']['user'] = 'user';
$config['xcache']['pass'] = 'pass'
Edit it to include your xcache admin username and password

3. This step will need to be repeated whenever you do a forum upgrade.
Open up /vb/cache.php.
Find:
PHP Code:
self::$instance vB_Cache_Db::instance(); 
Replace with:
PHP Code:
self::$instance fst_Cache_Xcache::instance(); 

Download

File Type: %1$s xcache-0.9.1.zip (3.7 KB, 152 downloads)

Similar Mods

Board Optimization datastore cache to XCache - boost your vBulletin vBulletin 3.6 Add-ons

vblts.ru supports vBulletin®, 2022-2024