darnoldy
23rd November 2007, 10:04 AM
Over at vBSEO they've just published an article. Here's a quick summery of it. Go check it out :)
Title: Installing Xcache on your server
Author: SemperFideles
Published: Thu, 22 Nov 2007 04:03:51 GMT
Full Article: http://www.vbseo.com/f34/installing-xcache-your-server-18498/
Not meant to be comprehensive but I did want to provide the instructions for installing xCache on your server to take advantage of vBSEO's features to use this cache system. After trying a couple of the other cache systems, I found that this one worked without causing httpd to regularly crash (something eAccelerator kept causing).
My server is an x686 with CentOS linux running on it. Some of your file locations might be different (or settings in php.ini) but these locations were exactly were mine were located.
Log into root and create a directory called src and browse to it
Code:
~/src $
get the latest version of xcache (in this case 1.2.1 and untar/gunzip it:
Code:
~/src $ wget http://xcache.lighttpd.net/pub/Releases/1.2.1/xcache-1.2.1.tar.gz
~/src $ tar -zxf xcache-1.2.1.tar.gz
Browse to the xcache directory and follow these steps to install:
Code:
~/src $ cd xcache
~/src/xcache $ phpize
~/src/xcache $ ./configure --enable-xcache
~/src/xcache $ make
~/src/xcache $ su
~/src/xcache $ make install
Now you need to edit your php.ini file. If you have Zend installed then it's in the Zend subdirectory (/usr/local/Zend/etc for me) but there are also shortcuts to the php.ini file usually located in /usr/local that you can edit.
Now, you'll see a number of different Xcache settings to add to your php.ini file. This is what works for me. Note that I have a pretty large forum (about 500K posts). The "trick" is to get your xcache size sufficiently large to avoid OOM's. Play around with the size until you don't get any OOM's. Also, in the documentation, it won't mention that you need to have a var size but this is required or you'll get some strange errors with vBSEO if you don't have a var.size established. My var.size is much smaller than the xcache size but both are optimum for my site.
Here is my config (I place this *above* my calling of the Zend optimizer in my php.ini file):
Code:
[xcache-common]
zend_extension = /usr/local/lib/php/extensions/no-debug-non-zts-20020429/xcache.so
; required for >=php5.1 if you turn XCache on
auto_globals_jit = Off
[xcache.admin]
xcache.admin.user = "admin"
; paste the output of md5("password") below
xcache.admin.pass = "******"
[xcache]
xcache.shm_scheme = "mmap"
xcache.size = 140M
xcache.count = 2
xcache.slots = 1K
xcache.readonly_protection = Off
xcache.mmap_path = "/dev/zero"
xcache.stat = On
xcache.cacher = On
xcache.ttl = 3600
xcache.gc_interval = 300
; same as aboves but for variable cache
xcache.var_size = 2M
xcache.var_count = 2
xcache.var_slots = 1K
; default ttl
xcache.var_ttl = 3600
xcache.var_maxttl = 7200
xcache.var_gc_interval = 300
A few admin notes:
You don't have to specify an admin password but I recommend it. Pick a password and then use an MD5 generator to fill in this field (here is a free one: MD5 generator - Calculate MD5 for the typed string. (http://www.adamek.biz/md5-generator.php))
Browsing to your xcache status is then as simple as uploading your files from the downloaded file above into a web addressable space. Download that tar.gz file above (xcache-1.2.1.tar.gz) to a place on your computer where you can extract it and upload the directory with the admin tools to a subdirectory on your forum's page for instance. Alternatively, you can use some linux commands to move the directory in the ~/src/xcache directory to a space where your web space is. I have mine at: http://www.forumurl.com/xcache so it's easy to get to)
I then use the results (particularly the OOM to see how it's going). If you have a small forum you can probably get away with much smaller than 140M. Also, keep in mind that my xcache.count=2 and xcache.var.count=2 settings refer to the number of CPU's I have so set that accordingly for your site.
I hope this was not too obscure. I'm trying to save you from some addtional time this took me.
One last thing - after you've gotten all of this set up, I recommend installing this additional mod: datastore cache to XCache - boost your vBulletin - vBulletin.org Forum (http://www.vbulletin.org/forum/showthread.php?t=141005)
I found that it only affected the xcache.var.size by about 1MB on my site (changed from 1MB to 2MB after installing it) but the performance benefit was really good. Putting this mod together with the vBSEO mod has really increased performance.
(affiliate link)
http://www.vbseo.com/aff/banners/banner_vbseo_468x60_01.gif (http://www.vbseo.com/295_1_1_4/)
Title: Installing Xcache on your server
Author: SemperFideles
Published: Thu, 22 Nov 2007 04:03:51 GMT
Full Article: http://www.vbseo.com/f34/installing-xcache-your-server-18498/
Not meant to be comprehensive but I did want to provide the instructions for installing xCache on your server to take advantage of vBSEO's features to use this cache system. After trying a couple of the other cache systems, I found that this one worked without causing httpd to regularly crash (something eAccelerator kept causing).
My server is an x686 with CentOS linux running on it. Some of your file locations might be different (or settings in php.ini) but these locations were exactly were mine were located.
Log into root and create a directory called src and browse to it
Code:
~/src $
get the latest version of xcache (in this case 1.2.1 and untar/gunzip it:
Code:
~/src $ wget http://xcache.lighttpd.net/pub/Releases/1.2.1/xcache-1.2.1.tar.gz
~/src $ tar -zxf xcache-1.2.1.tar.gz
Browse to the xcache directory and follow these steps to install:
Code:
~/src $ cd xcache
~/src/xcache $ phpize
~/src/xcache $ ./configure --enable-xcache
~/src/xcache $ make
~/src/xcache $ su
~/src/xcache $ make install
Now you need to edit your php.ini file. If you have Zend installed then it's in the Zend subdirectory (/usr/local/Zend/etc for me) but there are also shortcuts to the php.ini file usually located in /usr/local that you can edit.
Now, you'll see a number of different Xcache settings to add to your php.ini file. This is what works for me. Note that I have a pretty large forum (about 500K posts). The "trick" is to get your xcache size sufficiently large to avoid OOM's. Play around with the size until you don't get any OOM's. Also, in the documentation, it won't mention that you need to have a var size but this is required or you'll get some strange errors with vBSEO if you don't have a var.size established. My var.size is much smaller than the xcache size but both are optimum for my site.
Here is my config (I place this *above* my calling of the Zend optimizer in my php.ini file):
Code:
[xcache-common]
zend_extension = /usr/local/lib/php/extensions/no-debug-non-zts-20020429/xcache.so
; required for >=php5.1 if you turn XCache on
auto_globals_jit = Off
[xcache.admin]
xcache.admin.user = "admin"
; paste the output of md5("password") below
xcache.admin.pass = "******"
[xcache]
xcache.shm_scheme = "mmap"
xcache.size = 140M
xcache.count = 2
xcache.slots = 1K
xcache.readonly_protection = Off
xcache.mmap_path = "/dev/zero"
xcache.stat = On
xcache.cacher = On
xcache.ttl = 3600
xcache.gc_interval = 300
; same as aboves but for variable cache
xcache.var_size = 2M
xcache.var_count = 2
xcache.var_slots = 1K
; default ttl
xcache.var_ttl = 3600
xcache.var_maxttl = 7200
xcache.var_gc_interval = 300
A few admin notes:
You don't have to specify an admin password but I recommend it. Pick a password and then use an MD5 generator to fill in this field (here is a free one: MD5 generator - Calculate MD5 for the typed string. (http://www.adamek.biz/md5-generator.php))
Browsing to your xcache status is then as simple as uploading your files from the downloaded file above into a web addressable space. Download that tar.gz file above (xcache-1.2.1.tar.gz) to a place on your computer where you can extract it and upload the directory with the admin tools to a subdirectory on your forum's page for instance. Alternatively, you can use some linux commands to move the directory in the ~/src/xcache directory to a space where your web space is. I have mine at: http://www.forumurl.com/xcache so it's easy to get to)
I then use the results (particularly the OOM to see how it's going). If you have a small forum you can probably get away with much smaller than 140M. Also, keep in mind that my xcache.count=2 and xcache.var.count=2 settings refer to the number of CPU's I have so set that accordingly for your site.
I hope this was not too obscure. I'm trying to save you from some addtional time this took me.
One last thing - after you've gotten all of this set up, I recommend installing this additional mod: datastore cache to XCache - boost your vBulletin - vBulletin.org Forum (http://www.vbulletin.org/forum/showthread.php?t=141005)
I found that it only affected the xcache.var.size by about 1MB on my site (changed from 1MB to 2MB after installing it) but the performance benefit was really good. Putting this mod together with the vBSEO mod has really increased performance.
(affiliate link)
http://www.vbseo.com/aff/banners/banner_vbseo_468x60_01.gif (http://www.vbseo.com/295_1_1_4/)