Using memcached With Your vBulletin Forum To Reduce Server Load (Debian Etch)
Using memcached With Your vBulletin Forum To Reduce Server Load (Debian Etch)Version 1.0 In this article I will explain how you can reduce server load by using memcached together with your vBulletin forum software (I'm assuming you are running vBulletin on Apache2 with mod_php5). memcached is a daemon that can store objects in the system's memory (e.g. results of database queries) which can speed up your web site tremendously. You can use memcached over a network (i.e., install your web application on one server and memcached on another server), but usually you install both on one server to avoid the networking overhead. It should be noted the memcached is no out-of-the-box solution for speeding up your web applications. Typically you have to adjust your scripts (PHP, Perl, etc.) to work with memcached, so this requires a little bit of work. Fortunately, vBulletin has built-in support for memcached - all you need to do is modify vBulletin's config.php file. I do not issue any guarantee that this will work for you!
1 Preliminary NoteI'm assuming that you have vBulletin installed in the directory /var/www/www.example.com/web/forums, so config.php is located in /var/www/www.example.com/web/forums/includes.
2 Installing memcached And The PHP5 memcache Modulememcached and the PHP5 memcache module are available as packages for Debian Etch, so we can install them as follows: apt-get install memcached php5-memcache After the installation, memcached should already be running. You can check that by typing netstat -tap | grep memcached server1:~# netstat -tap | grep memcached As you see, memcached is running on port 11211 (the default memcached port), and it's listening on all interfaces on the system. As memcached has no built-in authentication mechanisms (in order to not give up on speed), this means that anyone can connect to it from outside and use it. To avoid this, you can either close port 11211 in your firewall, or you configure memcached to listen on localhost only. I will use the latter method here. To do this, open the memcached configuration which is stored in /etc/memcached.conf: vi /etc/memcached.conf Add -l 127.0.0.1 to the configuration (you can also adjust the other settings if you like - the file contains explanations for each setting):
Restart memcached... /etc/init.d/memcached restart ... and run netstat -tap | grep memcached again. As you see, memcached is now listening on localhost only: server1:~# netstat -tap | grep memcached Then open /etc/php5/apache2/php.ini... vi /etc/php5/apache2/php.ini ... and make sure that you have something like this in it (probably at the end):
Afterwards, we restart Apache so that our new PHP configuration takes effect: /etc/init.d/apache2 restart
3 Configure vBulletinNext open vBulletin's config.php file: cd /var/www/www.example.com/web/forums/includes/ You should find something like this in it:
The /* ... */ means the section is commented out. Remove /* and */ from that section and save the file:
(If your memcached is running on another server or port, you must adjust these settings!) That's it. Your vBulletin is now using memcached!
4 Links
|
www.seamlessenterprise.com
One number. One voicemail. Seize the lead. Sprint Mobile Integration.
www.seamlessenterprise.com
One Number. One Voicemail.
Make it easier for clients to reach you. Turn your desk phone and mobile phone into one with Sprint Mobile Integration.
www.seamlessenterprise.com
One number. One voicemail. Sprint Mobile Integration.
www.seamlessenterprise.com
AT&T Synaptic Compute as a Service. Boost your power on demand.
Trial: IBM Cognos Express Reporting, Analysis & Planning
Learn benefits of Simpana software.
View the Gartner Video







Recent comments
12 hours 13 min ago
12 hours 25 min ago
16 hours 8 min ago
16 hours 10 min ago
16 hours 13 min ago
17 hours 56 min ago
1 day 1 hour ago
1 day 2 hours ago
1 day 12 hours ago
1 day 12 hours ago