Linux The Choice of GNU Generation
1 Star2 Stars3 Stars4 Stars5 Stars (6 votes, average: 4.67 out of 5)
Loading ... Loading ...

Speed up Vbulletin Forum with Memcached

By admin • June 5, 2010 • Filed in: Articles

Memcached is a memory caching system. This will help to increase speed of your vbforum . Vb have default support for integrating memchached. I already wrote a document for using memcached with Openx software. Please see the steps below, to see how you can configure memcached in your server and integrate to vbulletin

Install memcached server

Download the memcached server from http://memcached.org/

# wget -c  http://memcached.googlecode.com/files/memcached-1.4.5.tar.gz
# tar -xzf  memcached-1.4.5.tar.gz
# cd memcached-1.4.5/
# yum -y install libevent libevent-devel
# ./configure --prefix=/opt/memcached
# make
# make install

Now install init script . I wrote an init script for redhat and centos servers , you can use it to start/stop memcached.

# wget -c http://downloads.sherin.co.in/memcached.redhar.rc.txt
# mv -f memcached.redhar.rc.txt /etc/init.d/memcached
# chmod 750 /etc/init.d/memcached
# /etc/init.d/memcached start

To start Memcached automatically during reboot add the following lines to /etc/rc.local

# /etc/init.d/memcached start

Next we need to install and configure php-pecl module for memcached.

Install php-pecl memcache

Download the latest stable memcached from http://pecl.php.net/package/memcache

# wget -c http://pecl.php.net/get/memcache-2.2.5.tgz
# tar -xzf  memcache-2.2.5.tgz
# cd memcache-2.2.5/
# phpize
# ./configure
# make
# make install

Now restart apache and create a phpinfo page and test whether the memcache options is showing or not. If it is there then you installed php module . If not you need to check your php.ini settings and enable memcache module

Now we need to configure vbulletin software as follows

Configure Vbulletin

Edit the Vb configuration file includes/config.php and uncomment the following lines

$config['Datastore']['class'] = 'vB_Datastore_Memcached';
$i = 0;
// First Server
$i++;
$config['Misc']['memcacheserver'][$i]           = '127.0.0.1';
$config['Misc']['memcacheport'][$i]                     = 11211;
$config['Misc']['memcachepersistent'][$i]       = true;
$config['Misc']['memcacheweight'][$i]           = 1;
$config['Misc']['memcachetimeout'][$i]          = 1;
$config['Misc']['memcacheretry_interval'][$i] = 15;

Now restart apache server . Your vbulletin now works with memcached. You can see the performance difference within 1 to 2 hours.

Popularity: 30%

Comments

What a relief! After spending 3 days trying to install memcache and looking at countless tutorials, I finally found one that works. Thanks for your help

Hi,

thanks for your tips!
Actually I was disappointed, that memcached does not help so much. I got vbulletin 4.1.1PL2 with cms suite. Memcached gets only 1.4mb of stuff it can cache. So this does not boost performance so much.
having 2700 simulatan users i thought there will be like 100 mb in the datastore.

Is there any trick to get more stuff into memcached?

best regards, Me ;)

May be we can help you , check our vb optimization plan from http://syslint.com/VBulletin-Management

I followed your instruction verbatim…got no errors but can get memcached started due to this error:

[root@speedwake init.d]# /etc/init.d/memcached start
Starting memcached: stat: cannot stat `/var/run/memcached’: No such file or directory
chown: cannot access `/var/run/memcached’: No such file or directory
[ OK ]

use the following ,

# mkdir -p /var/run/memcached
This will fix your issue

Trackbacks

 

« | Home | »