View Full Version : How-To: Installing XCache on your RHEL or CentOS 4 Server
jason|xoxide
Wed 20th Dec '06, 5:59pm
I decided to whip out another tech tips article before I left for vacation. This one is on installing XCache using an src.rpm file I created. Most of the configuration options are set automatically so you should be able to build, install, and run with it.
PHP Caching and Acceleration with XCache (http://www.jasonlitka.com/2006/12/20/php-caching-and-acceleration-with-xcache/)
Digg this story (http://www.digg.com/linux_unix/PHP_Caching_and_Acceleration_with_XCache)
Update #1: Comment removed as it no longer applies.
Update #2: For those of you NOT using RPM-based distros, please see the link below.
How-To: Compiling XCache from Source (http://www.jasonlitka.com/2007/01/30/how-to-compiling-xcache-from-source/)
Update #3: CPanel is trash, stop paying good money for a program that compiles major programs from source on an RPM-based distro. For those of you that ignore that warning, you'll either need to compile from source or edit the xcache.spec file to remove the dependency on the 'php' and 'php-devel' packages before building my src.rpm.
Update #4: The src.rpm package has been updated to patch out the bug here (http://trac.lighttpd.net/xcache/ticket/71).
Update #5: 1.2.1 has been released. Check out my notes on XCache 1.2.1 (http://www.jasonlitka.com/2007/07/03/xcache-packages-updated-to-121/).
eva2000
Fri 22nd Dec '06, 5:50am
Excellent Jason :)
Bulent Tekcan
Sat 23rd Dec '06, 6:21am
Can you explain step by step ? Because it is ony script :)
Thanks
jason|xoxide
Wed 27th Dec '06, 12:16pm
The src.rpm on my site is a ready-to-go package (the config is fairly-well optimized for vBulletin sites), all you would need to do is build it to suit your specific version of PHP.
In order to do that, follow the rough procedure below.
Make sure that you have all of the common development tools installed on your server (gcc, make, autoconf, etc.).
Download the src.rpm from my site.
Install the src.rpm by typing "rpm -ivh filename".
You might need to create and chmod 777 the folder /usr/src/redhat if it doesn't already exist.
Run "rpmbuild -bb /usr/src/redhat/SPECS/php-xcache.spec" and wait for the build to finish.
Remove eAccelerator or APC if installed (simply commenting out their lines in php.ini will do).
Run "rpm -Uvh /usr/src/redhat/RPMS/i386/filename" (where filename will start with "php-xcache" and end with the version and .rpm).
Optional: Edit /etc/php.d/xcache.ini and set an admin login & password so you can use the admin panel that gets copied to "/var/www/html/xcache".
Restart httpd with "service httpd restart".Building from the source on the XCache website is also possible but be aware that the config file shipped with that tar.gz file does NOT work out of the box and will need to be modified (the src.rpm on my site will automatically modify the config file so that it will work for 95% of all setups without any changes).
Building an RPM in the manner above will also allow you to easily remove the package if you don't like it.
Bulent Tekcan
Wed 27th Dec '06, 2:45pm
Thanks for this info...
Our site running XCache since 3 days...Any idea for settings our high traffic server ?
Thanks
jason|xoxide
Wed 27th Dec '06, 3:23pm
You don't need to have the cache size anywhere near that large. You should consider dropping it down to half that (or so).
Also, if you built from source (and not my src.rpm), make sure that you enabled both the cacher and the optimizer (the latter makes a pretty big difference) by running "./configure" with "--enable-xcache" and "--enable-xcache-optimizer" and then turning the optimizer on in the config file (of course, none of this is necessary if you're using my src.rpm).
Bulent Tekcan
Wed 27th Dec '06, 4:17pm
I installed from source...But now reinstall again with optimizer.
Thanks
Bob Isaac
Wed 27th Dec '06, 4:18pm
At what point does installing APC, XCache or whatever become beneficial? I have APC installed on our RHESL-4 ProLiant DL360 database server but from my PC I have not seen any difference in response times.
Bob
jason|xoxide
Wed 27th Dec '06, 5:12pm
I installed from source...But now reinstall again with optimizer.
Thanks
Good, don't forget to enable the optimizer in the xcache.ini config file.
At what point does installing APC, XCache or whatever become beneficial? I have APC installed on our RHESL-4 ProLiant DL360 database server but from my PC I have not seen any difference in response times.
Bob
APC, eAccelerator, and XCache are PHP caches (and optimizers in the case of the second and third). If your machine does not see "heavy" use as a web server then you won't see any real gain.
Since you mentioned that you installed it on your database server and not your web server, you're not going to see any improvement. If you want to optimize your DB server then you should start a new thread and post the info that is requested here (http://www.vbulletin.com/forum/showthread.php?t=70117).
Bulent Tekcan
Wed 27th Dec '06, 6:50pm
My phpinfo shows like that...
Version 1.2.0
Modules Built cacher optimizer
Readonly Protection N/A
Opcode Cache enabled, 134,217,728 bytes, 4 split(s), with 16384 slots each
Variable Cache disabled
Shared Memory Schemes malloc, mmap
I think it is OK..
Bob Isaac
Wed 27th Dec '06, 6:59pm
[quote=jason|
Since you mentioned that you installed it on your database server and not your web server, you're not going to see any improvement. If you want to optimize your DB server then you should start a new thread and post the info that is requested here (http://www.vbulletin.com/forum/showthread.php?t=70117).[/quote]
The DL360 G3/4 are classed as database servers but can be used as a normal server to server up web sites as well. I use it for both.
Bob
jason|xoxide
Wed 27th Dec '06, 7:28pm
The DL360 G3/4 are classed as database servers but can be used as a normal server to server up web sites as well. I use it for both.
Bob
Ah, I understand now. I'm not terribly familiar with that brand of server and how they're named.
In any case, a PHP cache will reduce the load of your web server by keeping PHP from constantly compiling scripts on every hit and instead compiling once, caching, and then only recompiling if there is a file change.
If the server is not very busy, you many not be able to notice the difference. Similarly, if the bottleneck on your server is NOT PHP compilation (meaning that MySQL, a lack of RAM, your disk subsystem, etc., are the weak link) then you may not notice any improvement.
Bob Isaac
Wed 27th Dec '06, 7:41pm
I have noticed a drop in server load with APC but nothing much in terms of performance. Everything else is optimised. We have a reasonably powerful box just for one site so it is not under any great strain.
I looked at the XCache site and most of the versions are shown as unstable, is that correct. I don't use PHP5 so your rpm is no use to me, I'd need to compile from source.
Bob
eva2000
Thu 28th Dec '06, 7:59am
Yeah i compiled from source too Xcache v1.03 for my PHP 4.4.4 centOS server, works fine and seems slightly speedier than APC 3.08 i had. Had a few hiccups on installation since the web site install instructions and included INSTALL file for tarball differ slightly - one set of instructions tell you to compile/build source outside of the source directory while other set of instructions build it as normal inside the source directory.
Just remember for source compiles the default php.ini entries added don't have a correctly named link to loading the zend extension xcache.so file so after you you have make'd and given the location to xcache.so copy and paste that into the zend_extension location in php.ini
i.e. by default php.ini would have the following after passing xcache.ini settings into php.ini
zend_extension = /usr/local/lib/php/extensions/non-debug-non-zts-xxx/xcache.so
I had to change mine to
zend_extension = /usr/local/lib/php/extensions/no-debug-non-zts-20020429/xcache.so
Can Xcache http://trac.lighttpd.net/xcache/ 1.2 be used for PHP 4.4.4 or is it better to stick with Xcache 1.03 http://trac.lighttpd.net/xcache/wiki/Release-1.0.3 for PHP 4.4.4 ?
jason|xoxide
Thu 28th Dec '06, 10:48am
XCache 1.2.0 is marked as "unstable" but I haven't seen anything that would lend weight to that label. Many developers have a similar practice where their newest release is marked as "unstable" and the prior release is marked as "stable". In any case, if you're running PHP 5.1 or 5.2 then you need to run 1.2.0.
As to running 1.2.0 on PHP 4.x, I don't know. I'll give it a try in a VE and see how it goes.
EDIT: I just built 1.2.0 from source and installed it on a VE running PHP 4.3.9. There were no problems (a few warnings popped up during the 'phpize' but no errors) so I would assume that 4.4.4 would work fine as well.
jason|xoxide
Thu 28th Dec '06, 1:00pm
I have noticed a drop in server load with APC but nothing much in terms of performance. Everything else is optimised. We have a reasonably powerful box just for one site so it is not under any great strain.
I looked at the XCache site and most of the versions are shown as unstable, is that correct. I don't use PHP5 so your rpm is no use to me, I'd need to compile from source.
Bob
I just fiddled with the spec file a bit and now the src.rpm will build under PHP 4 and 5. The newest version is available on my site. I've tested with PHP 4.3.9 from CentOS as well as 5.1.6 and 5.2.0 from my tutorials.
If anyone happened to install the original version on PHP 5, don't worry about the update, the only thing that was changed was to allow it to build under PHP 4.
adrianchew
Thu 28th Dec '06, 2:45pm
I've got Xcache 1.2.0 running with PHP 5.2.0 FastCGI on RHEL3, with lighttpd 1.4.13.
The difference I've noticed is the sites never seem to hang anymore - in the past there was once in a while I'd get vB not coming up and have to Refresh, but none of that anymore. Previously had APC running.
1.2.0 doesn't seem unstable to me. :cool:
jw00dy
Sat 30th Dec '06, 6:43pm
Very interesting. I'm guessing that their shouldn't be a problem with this on CentOS 3.x (latest).
Also, are any of you using vBSEO with this? I'm wondering if it will work or not. I think I'll post a question over on vBSEO's site.
jason|xoxide
Tue 2nd Jan '07, 12:01pm
I run vBSEO on all of my sites and haven't had a problem with XCache.
As to RHEL3, I haven't tested the src.rpm on that distro, so there may be deps that can't be met. That said, there shouldn't be any reason why you couldn't build from source if it doesn't work.
kerplunk
Tue 2nd Jan '07, 5:36pm
Hey Jason,
What settings do you recommend for XCache in php.ini?
I am currently testing it on a friend's server/site/VPS and I'm using these settings:
[xcache-common]
extension = xcache.so
[xcache.admin]
xcache.admin.user = "admin"
xcache.admin.pass = "<md5 here>"
[xcache]
xcache.shm_scheme = "mmap"
xcache.size = 32M
xcache.count = 2
xcache.slots = 8K
xcache.ttl = 7200
xcache.gc_interval = 3600
xcache.var_size = 0M
xcache.var_count = 1
xcache.var_slots = 8K
xcache.var_ttl = 0
xcache.var_maxttl = 0
xcache.var_gc_interval = 300
xcache.test = Off
xcache.readonly_protection = Off
xcache.mmap_path = "/tmp/xcache.XXXXXX"
xcache.coredump_directory = ""
xcache.cacher = On
xcache.stat = On
xcache.optimizer = Off
[xcache.coverager]
xcache.coverager = Off
xcache.coveragedump_directory = ""Is there anything I should change?
The APC settings I used to use for him were:
extension = apc.so
apc.enabled = 1
apc.shm_segments = 1
apc.optimization = 0
apc.shm_size = 32
apc.ttl = 7200
apc.user_ttl = 7200
apc.num_files_hint = 1024
apc.mmap_file_mask = /tmp/apc.XXXXXX
apc.enable_cli = 1
jason|xoxide
Tue 2nd Jan '07, 5:39pm
Well, "count" should be set to the number of cores in the system. If that box has 2 then that's fine. If not, set it to the appropriate number. The only thing that really sticks out at me though is that you have the Optimizer disabled. If you compiled it in then turn it on. If you didn't, rebuild and then turn it on.
kerplunk
Tue 2nd Jan '07, 5:53pm
That server has 2 cores, so I'm good there. Good info for the future, though.
Optimizer is disabled... do you know the configure line option to enable that? I just used './configure --enable-xcache' I believe. What is the point of the optimizer? I have never used Zend Optimizer in the past or anything. :)
One last thing, the "xchat.var*" settings... those are fine? Do you know what the var stuff is?
BTW, thanks... you're the man. ;) I think I saw this thread listed on XCache's homepage!
kerplunk
Tue 2nd Jan '07, 5:58pm
./configure --help showed me the optimizer option is --enable-xcache-optimizer
Any other recommended options?
jason|xoxide
Tue 2nd Jan '07, 6:06pm
That server has 2 cores, so I'm good there. Good info for the future, though.
Optimizer is disabled... do you know the configure line option to enable that? I just used './configure --enable-xcache' I believe. What is the point of the optimizer? I have never used Zend Optimizer in the past or anything. :)
One last thing, the "xchat.var*" settings... those are fine? Do you know what the var stuff is?
BTW, thanks... you're the man. ;) I think I saw this thread listed on XCache's homepage!
The optimizer can be enabled by running the ./configure with "--enable-xcache-optimizer" (along with whatever else you enabled). Once you've done so you should see it listed as a module in the XCache section of your phpinfo(). You'll also want to change the "Off" to "On" in the php.ini.
The var* options are for a variable cache. Unless you're using a custom application with xcache_get and xcache_set functions (think memcached) it's not going to do you a bit of good. Go ahead and leave it at 0M (disabled).
kerplunk
Tue 2nd Jan '07, 6:54pm
I am very impressed by XCache already. Things feel much faster on our production site. No problems so far. :)
I'll keep you guys updated...
I wish it showed how many caches per second it was getting.
Bob Isaac
Wed 3rd Jan '07, 10:01am
rpmbuild - command not found
I have checked the packages on Redhat's site, is this the one I need:
rpm-build-4.3.3-18_nonptl.i386
I have RH ES4 with PHP 4.3.9.
Bob
jason|xoxide
Wed 3rd Jan '07, 11:39am
That will work, yes. If you're using RHEL4 then you should be able to install the newest version simply by running "up2date -u rpm-build".
Aside from that, do you have a complete set of development tools installed (gcc, make, autoconf, etc.)? If not, you'll need those as well.
Bob Isaac
Wed 3rd Jan '07, 1:20pm
Thanks, all installed. Two issues:
1]
[xcache-common]
;; install as zend extension (recommended), normally "$extension_dir/xcache.so"
zend_extension = /usr/lib/php4/xcache.so
; zend_extension_ts = /usr/local/lib/php/extensions/non-debug-zts-xxx/xcache.so
;; For windows users, replace xcache.so with php_xcache.dll
zend_extension_ts = c:/php/extensions/php_xcache.dll
;; or install as extension, make sure your extension_dir setting is correct
; extension = xcache.so
;; or win32:
; extension = php_xcache.dll
I presume I only need line 2
2]
Tried to open /var/www/html/xcache/ and gotFatal error: xcache_count(): unexpect 8 bytes of xcache.admin.pass, expected 32 bytes, the password after md5() in /var/www/html/xcache/xcache.php on line 100
I put in my username and password.
Bob
jason|xoxide
Wed 3rd Jan '07, 1:29pm
Only the "[xcache-common]" and uncommented "zend_extension" lines are needed, you can get rid of the rest of the stuff at the top if you'd like. They don't harm anything though so you can leave them.
As to the login name and password requested, you don't enter your actual password in the file. You should type something like "admin" as the user and then the md5 hash of the password you want in pass. For example, if the password you wanted was "cheese" then you would enter "fea0f1f6fede90bd0a925b4194deac11".
EDIT: You can find a quick MD5 generator here (http://www.adamek.biz/md5-generator.php).
Bob Isaac
Wed 3rd Jan '07, 1:59pm
All working now, thanks.
Bob
Bob Isaac
Wed 3rd Jan '07, 2:22pm
My memory % box shows 0%, do I need to change and of the settings created by your rpm?
xcache.shm_scheme = "mmap"
xcache.size = 32M
xcache.count = 2
xcache.slots = 8K
xcache.ttl = 0
xcache.gc_interval = 0
xcache.var_size = 0M
xcache.var_count = 1
xcache.var_slots = 8K
xcache.var_ttl = 0
xcache.var_maxttl = 0
xcache.var_gc_interval = 300
xcache.test = Off
xcache.readonly_protection = Off
xcache.mmap_path = "/dev/zero"
xcache.coredump_directory = ""
xcache.cacher = On
xcache.stat = On
xcache.optimizer = On
Bob
jason|xoxide
Wed 3rd Jan '07, 2:30pm
The RPM should have automatically given you a total of 32MB of cache broken into as many groups as you have logical CPUs. The Cacher and Optimizer should also be active out of the box.
As to the "%" column, that's supposed to be a little bar graph but it doesn't work very well for me (being only about 4 pixels high). If you're getting "hits" on your caches then it's working right. You should also see the "Avail" column decreasing as your site receives more hits. You can check the "List PHP" page to see exactly what is being cached.
If your OOMs column is higher than zero then you should either raise the total amount of allocated memory or enable ttl and garbage collection. The former would be better than the latter, assuming that you have the memory to spare.
Bob Isaac
Wed 3rd Jan '07, 2:47pm
Yep, 32Mb with 16Mb each for php#0 and php#1. There is 5.44Kb (php#0) and 1.79kb (php#1) in the Avail column. OOMs is 93 and 713. That suggests I need to increase xcache.size= to 64Mb and then review? I had 128Mb in APC.
Bob
jason|xoxide
Wed 3rd Jan '07, 3:31pm
Actually, when running a multi-cache setup, you might need slightly more than you did with APC or eAccelerator. The reason is that one cache may fill up faster than the other. You shouldn't have too many problems with 2 caches but I'm using 8...
EDIT: If you were filling up that 128MB in APC then you'll probably want to just go straight there. Alternatively, as I mentioned, you can enable ttl and garbage collection.
Bob Isaac
Wed 3rd Jan '07, 4:28pm
Since setting xcache.size=64Mb it has settled at 2/3 of the memory used with 130,000 hits. I'll see how things go before thinking about any changes.
xcache.ttl=0
xcache.var_gc_interval=300
These were set by the rpm. I've tried to find some info on the garbage collection function, but very little. I presume it clears old/deleted cache? But if ttl=0 then none will be deleted. Is this correct?
I presume if memory availability allows to hold as much for as long as possible this is better.
Bob
jason|xoxide
Wed 3rd Jan '07, 4:44pm
Well, the var* options aren't used by default so you can ignore that one.
The two I was writing about are 'xcache.ttl' & 'xcache.gc_interval'. You could set the first to something like '3600' (1 hour) and the second to '1800' (30 minutes) to cause the GC to run every 30 minutes to looks for cached entries that haven't been accessed in 60 minutes or more.
Of course, as was mentioned, if you have the extra memory, it would be better to keep both of those values at '0' and to just increase 'xcache.size'.
Bob Isaac
Wed 3rd Jan '07, 4:52pm
Well, the var* options aren't used by default so you can ignore that one.
The two I was writing about are 'xcache.ttl' & 'xcache.gc_interval'. You could set the first to something like '3600' (1 hour) and the second to '1800' (30 minutes) to cause the GC to run every 30 minutes to looks for cached entries that haven't been accessed in 60 minutes or more.
Of course, as was mentioned, if you have the extra memory, it would be better to keep both of those values at '0' and to just increase 'xcache.size'.
Thanks, this is starting to make sense now. All I need to do now is try to address the very high CPU spikes being caused by MySQL.
Bob
Bob Isaac
Wed 3rd Jan '07, 6:41pm
Mem: 2074968k total, 1929892k used, 145076k free, 21284k buffers
Swap: 2031608k total, 1972k used, 2029636k free, 1121668k cached
The 64Mb is almost all used up and there is a lot more swapping going on. This didn't happen with APC. Swap used was about 140k before. Any ideas?
Bob
EDIT. I have set xcache.size=128Mb and restarted httpd. That has reduced the swap back to normal, I'll see how it goes.
jason|xoxide
Wed 3rd Jan '07, 7:18pm
The 64Mb is almost all used up and there is a lot more swapping going on. This didn't happen with APC. Swap used was about 140k before. Any ideas?
Bob
EDIT. I have set xcache.size=128Mb and restarted httpd. That has reduced the swap back to normal, I'll see how it goes.
Swap usage of small amounts is normal. If you start swapping 50MB or more for a good portion of the day then you should be worried.
Oh, and you should always check memory usage with 'free -m'. The line that says "-/+ buffers/cache" is the line you really want to pay attention to.
eva2000
Thu 4th Jan '07, 1:23am
i'm using 1.03 xcache and so far been very good :)
Bulent Tekcan
Thu 4th Jan '07, 2:19am
Hello,
This setting from my high traffic boards (http://www.big-boards.com/board/1319/).Any idea my settings ?
[xcache-common]
extension = xcache.so
[xcache.admin]
xcache.admin.user = "xxxxxxxxxxxx"
xcache.admin.pass = "xxxxxxxxxxxx"
[xcache]
xcache.shm_scheme = "mmap"
xcache.size = 128M
xcache.count = 4
xcache.slots = 16K
xcache.ttl = 3600
xcache.gc_interval = 1800
xcache.var_size = 0M
xcache.var_count = 0
xcache.var_slots = 0K
xcache.var_ttl = 0
xcache.var_maxttl = 0
xcache.var_gc_interval = 300
xcache.test = Off
xcache.readonly_protection = Off
xcache.mmap_path = "/tmp/xcache.XXXXXX"
xcache.coredump_directory = ""
xcache.cacher = On
xcache.stat = On
xcache.optimizer = On
[xcache.coverager]
xcache.coverager = Off
xcache.coveragedump_directory = ""
And also this report from xcache admin for 2,403 online users.
Bob Isaac
Thu 4th Jan '07, 5:28am
Swap usage of small amounts is normal. If you start swapping 50MB or more for a good portion of the day then you should be worried.
Oh, and you should always check memory usage with 'free -m'. The line that says "-/+ buffers/cache" is the line you really want to pay attention to.
It's been running overnight now and the swap is up again. 60% of the 128Mb is free but it's quieter overnight, see how the day goes.Mem: 2074968k total, 1869732k used, 205236k free, 55144k buffers
Swap: 2031608k total, 2256k used, 2029352k free, 1085396k cached
This free -m
total used free shared buffers cached
Mem: 2026 1821 204 0 53 1059
-/+ buffers/cache: 707 1318
Swap: 1983 2 1981
Bob
jason|xoxide
Thu 4th Jan '07, 12:31pm
Hello,
This setting from my high traffic boards (http://www.big-boards.com/board/1319/).Any idea my settings ?
And also this report from xcache admin for 2,403 online users.
According to that screen shot, you've got WAY too much space allocated for the cache. Ideally you would want as close to "0" in the available column without increasing the "OOM" column.
hawamer
Sat 6th Jan '07, 9:21am
Hello ..
when i type rpm -ivh php-xcache-1.2.0_0.2.src.rpm
the result is :
1:php-xcache warning: user brewbuilder does not exist - using root
########################################### [100%]
so what can i do now ?
Thank You
Bob Isaac
Sat 6th Jan '07, 9:30am
Ignore it, continue.
Bob
stamoulis
Sat 6th Jan '07, 1:20pm
I installed 1.20 since I have PHP5 running with those parameters:
xcache.size = 32M
xcache.var_size = 32M
should I take off the var_size cache?
I think my board runs better now but time will tell.....
edit: It seems to work very well! Congrats!
hawamer
Sat 6th Jan '07, 2:09pm
Ignore it, continue.
Bob
rpmbuild -bb /usr/src/redhat/SPECS/php-xcache.spec
error: Failed build dependencies:
php is needed by php-xcache-4.4.4_1.2.0-0.2.i386
php-devel is needed by php-xcache-4.4.4_1.2.0-0.2.i386
jason|xoxide
Sat 6th Jan '07, 7:02pm
I installed 1.20 since I have PHP5 running with those parameters:
xcache.size = 32M
xcache.var_size = 32M
should I take off the var_size cache?
I think my board runs better now but time will tell.....
edit: It seems to work very well! Congrats!
If you are not using XCache as a variable cache (you'd know if you were) then leave the variable cache turned off.
rpmbuild -bb /usr/src/redhat/SPECS/php-xcache.spec
error: Failed build dependencies:
php is needed by php-xcache-4.4.4_1.2.0-0.2.i386
php-devel is needed by php-xcache-4.4.4_1.2.0-0.2.i386
Install php & php-devel RPMs.
neuromancer11
Sat 6th Jan '07, 7:07pm
The src.rpm on my site is a ready-to-go package (the config is fairly-well optimized for vBulletin sites), all you would need to do is build it to suit your specific version of PHP.
In order to do that, follow the rough procedure below.
Make sure that you have all of the common development tools installed on your server (gcc, make, autoconf, etc.).
Download the src.rpm from my site.
Install the src.rpm by typing "rpm -ivh filename".
You might need to create and chmod 777 the folder /usr/src/redhat if it doesn't already exist.
Run "rpmbuild -bb /usr/src/redhat/SPECS/php-xcache.spec" and wait for the build to finish.
Remove eAccelerator or APC if installed (simply commenting out their lines in php.ini will do).
Run "rpm -Uvh /usr/src/redhat/RPMS/i386/filename" (where filename will start with "php-xcache" and end with the version and .rpm).
Optional: Edit /etc/php.d/xcache.ini and set an admin login & password so you can use the admin panel that gets copied to "/var/www/html/xcache".
Restart httpd with "service httpd restart".Building from the source on the XCache website is also possible but be aware that the config file shipped with that tar.gz file does NOT work out of the box and will need to be modified (the src.rpm on my site will automatically modify the config file so that it will work for 95% of all setups without any changes).
Building an RPM in the manner above will also allow you to easily remove the package if you don't like it.
root@host [~]# rpmbuild -bb /usr/src/redhat/SPECS/php-xcache.spec
error: Failed build dependencies:
php is needed by php-xcache-4.4.4_1.2.0-0.2.i386
php-devel is needed by php-xcache-4.4.4_1.2.0-0.2.i386
I get that error. How can I solve that problem ?
jason|xoxide
Sat 6th Jan '07, 7:23pm
root@host [~]# rpmbuild -bb /usr/src/redhat/SPECS/php-xcache.spec
error: Failed build dependencies:
php is needed by php-xcache-4.4.4_1.2.0-0.2.i386
php-devel is needed by php-xcache-4.4.4_1.2.0-0.2.i386
I get that error. How can I solve that problem ?
Do you have RPMs for PHP 4.4.4 installed or did you compile from source?
jw00dy
Sun 7th Jan '07, 4:47am
I've got the same thing, and php was compiled from source.
jw00dy
Sun 7th Jan '07, 6:38am
I ran buildrpm -bb --nodeps php-xcache...
It seemed to install fine, but when I try and load it as an extension httpd won't start. :(
So I tried doing it from source... Added all the information to php.ini and same thing.
Any idea?
I'll admit it, I'm completely lost. I installed Zend Optimizer tonight, and maybe that's the problem? Sp maybe I'm confused about what it is exactly that I need. I installed Zend Optimizer for vBSEO Zend encoded files.
I know zend has a cacher too, but as far as I know it's not installed? Maybe it is? Maybe I need to disable it? I have no idea, as previously stated, I'm a little lost at this point, so any help is really appreciated.
jw00dy
Sun 7th Jan '07, 6:43am
Oh, and in case this helps, here is the current information including the Zend stuff.
and yes Extension_Dir = is set correctly.
[Zend]
zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.2.0
zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.2.0
zend_optimizer.version=3.2.0
zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so
[xcache-common]
;extension = xcache.so
[xcache.admin]
;xcache.admin.user = "jw00dy"
;xcache.admin.pass = "ee83e312b0cce7938d70d1afb9ab5b29"
[xcache]
;xcache.shm_scheme = "mmap"
;xcache.size = 32M
;xcache.count = 1
;xcache.slots = 8K
;xcache.ttl = 7200
;xcache.gc_interval = 3600
;xcache.var_size = 0M
;xcache.var_count = 1
;xcache.var_slots = 8K
;xcache.var_ttl = 0
;xcache.var_maxttl = 0
;xcache.var_gc_interval = 300
;xcache.test = Off
;xcache.readonly_protection = Off
;xcache.mmap_path = "/tmp/xcache.XXXXXX"
;xcache.coredump_directory = ""
;xcache.cacher = On
;xcache.stat = On
;xcache.optimizer = On
[xcache.coverager]
;xcache.coverager = Off
;xcache.coveragedump_directory = ""
vissa
Sun 7th Jan '07, 9:52am
I run vBSEO on all of my sites and haven't had a problem with XCache.
As to RHEL3, I haven't tested the src.rpm on that distro, so there may be deps that can't be met. That said, there shouldn't be any reason why you couldn't build from source if it doesn't work.
Do you use the ioncube or Zend version of vbseo along with Xcache? Did you have to make any modifications to Zend if you used that?
-vissa
jason|xoxide
Sun 7th Jan '07, 10:35am
Zend is crap so I stay as far away as possible. I use the ioncube loaders on my site and have never had a problem with them interfering with other extensions. That said, I know people here have used Zend with XCache so that probably isn't it unless it's a conflict with the version you're using.
My src.rpm will only work out of the box if you have installed PHP using RPMs that provide "php" and "php-devel" (the whole point of an RPM-based distro is that you DON'T have to compile from source). If you installed from source and have compiled all of the functionality that would normally be provided by those two packages, you can either add a "--nodeps" to the rpmbuild command or remove the "Requires" lines from the php-xcache.spec file.
jw00dy, what is the error reported in the httpd error_log when you tried to start httpd?
P.S. - How many of you have compiled PHP from source and would be interested in an RPM-based method for 4.4.4?
Bob Isaac
Sun 7th Jan '07, 11:27am
Jason,
If the next RH ES4 update due soon increases the PHP version (and I hope they do) will XCache have to be reinstalled, I have 4.3.9 at the moment.
Bob
jason|xoxide
Sun 7th Jan '07, 4:33pm
Jason,
If the next RH ES4 update due soon increases the PHP version (and I hope they do) will XCache have to be reinstalled, I have 4.3.9 at the moment.
Bob
In all likelihood, RH will keep the PHP version at 4.3.9. That's the whole point of backporting patches to a stable platform. If you want a newer version then you'll need to upgrade to RHEL 5 when it comes out or build your own version either from raw source, an src.rpm (see my site), or from a third-party RPM.
PHP extensions are tied to the version of PHP that was installed when they were compiled. For the most part, you're OK if only the last digit changes. If they/you were to move to 4.4.x or 5.x then you'd need to rebuild, just as you would with APC or eAccelerator.
hawamer
Sun 7th Jan '07, 4:44pm
Install php & php-devel RPMs.
how to do that ?
Thank You
Bob Isaac
Sun 7th Jan '07, 6:00pm
In all likelihood, RH will keep the PHP version at 4.3.9. That's the whole point of backporting patches to a stable platform. If you want a newer version then you'll need to upgrade to RHEL 5 when it comes out or build your own version either from raw source, an src.rpm (see my site), or from a third-party RPM.
PHP extensions are tied to the version of PHP that was installed when they were compiled. For the most part, you're OK if only the last digit changes. If they/you were to move to 4.4.x or 5.x then you'd need to rebuild, just as you would with APC or eAccelerator.
My ISP said it was RH's policy to keep the versions the same for the life of the server. So what is the life of a server?
We've had this server just under 18 months and things like PHP and MySQL are running ahead, and the likes of vB are moving forward with their minimum version requirements of PHP and MySQL. Have we got to the stage where servers get old and outdated as quickly as cars?
Upgrading ES4 to ES5 sounds like a possiblity but our ISP don't sound too pleased to do it. I really don't want to move to another server, again. They won't upgrade the current versions as it would break the warranty, etc..
Bob
jw00dy
Sun 7th Jan '07, 6:21pm
Zend is crap so I stay as far away as possible. I use the ioncube loaders on my site and have never had a problem with them interfering with other extensions. That said, I know people here have used Zend with XCache so that probably isn't it unless it's a conflict with the version you're using.
My src.rpm will only work out of the box if you have installed PHP using RPMs that provide "php" and "php-devel" (the whole point of an RPM-based distro is that you DON'T have to compile from source). If you installed from source and have compiled all of the functionality that would normally be provided by those two packages, you can either add a "--nodeps" to the rpmbuild command or remove the "Requires" lines from the php-xcache.spec file.
jw00dy, what is the error reported in the httpd error_log when you tried to start httpd?
P.S. - How many of you have compiled PHP from source and would be interested in an RPM-based method for 4.4.4?
That's the goofy part, it doesn't say anything :( Segfault is what I got in syslog though.
I think I'll dump Zend and go with Ioncube as well.
My only question is do I only need the ioncube loader? I'm guessing I don't need the encoder? Or do I?
I'd be interested in an rpm version, though I don't mind compiling from source at all. I just needed to know what needed to be changed if you do compile from source.
adrianchew
Sun 7th Jan '07, 7:13pm
should I take off the var_size cache?
I have mine set at 0 - from the stats screen, it seems the variable cache is not used at the moment by vB... it might also be a development feature at the moment in Xcache. If you want to leave it enabled, set it small like 2M or something.
The php cache size of 32M should be enough for most people with just a single vB forum running. If you've got multiple boards or other PHP pages, then increase it and use the admin stats page to determine if its too little (Deleted 0 means none of the cached pages got deleted which will happen once it starts running out of memory).
jw00dy
Mon 8th Jan '07, 3:22am
one set of instructions tell you to compile/build source outside of the source directory while other set of instructions build it as normal inside the source directory.
Which way worked, or did it make a difference.
BTW, Mine is working now. Zend is not my friend right now :)
jason|xoxide
Mon 8th Jan '07, 11:41am
how to do that ?
Thank You
If you are running RHEL4 then you can run "up2date -u php-php-devel php-gd php-mysql". That would be for 4.3.9.
If you are running CentOS4 then you can get the same packages with "yum". The centosplus repo has packages for 5.0.4 and 5.1.6 as well.
Alternatively, for either, you can follow the instructions on my site for building 5.1.6 or 5.2.0. I'm considering doing a post on 4.4.4 as well but that would be a bit later in the week.
My ISP said it was RH's policy to keep the versions the same for the life of the server. So what is the life of a server?
We've had this server just under 18 months and things like PHP and MySQL are running ahead, and the likes of vB are moving forward with their minimum version requirements of PHP and MySQL. Have we got to the stage where servers get old and outdated as quickly as cars?
Upgrading ES4 to ES5 sounds like a possiblity but our ISP don't sound too pleased to do it. I really don't want to move to another server, again. They won't upgrade the current versions as it would break the warranty, etc..
Bob
RHEL versions are on a 5-year support cycle. That means that unless there is no alternative in avoiding a bug or exploit, the same versions will be used for all 5 years.
There is nothing stopping you from installing something newer on your own though (most people do it).
You can check out the PHP tutorials on my site if you're interested. Because they let you build as RPMs, if you don't like it, just remove it with 'rpm -e' and reinstall the stock version.
That's the goofy part, it doesn't say anything :( Segfault is what I got in syslog though.
I think I'll dump Zend and go with Ioncube as well.
My only question is do I only need the ioncube loader? I'm guessing I don't need the encoder? Or do I?
I'd be interested in an rpm version, though I don't mind compiling from source at all. I just needed to know what needed to be changed if you do compile from source.
Yes, you only need the loader. You can load it dynamically as vBSEO suggests but I think that that is stupid if all you have on your site is vBulletin (where it would be loaded dynamically on EVERY page). I just toss the loader in as a zend_extension in my php.ini file.
Bob Isaac
Mon 8th Jan '07, 1:28pm
Thanks for your helpfull reply. I will wait for update 5 and see what is in it, then will consider asking our ISP to upgrade to ES5.
Bob
jason|xoxide
Mon 8th Jan '07, 2:11pm
Thanks for your helpfull reply. I will wait for update 5 and see what is in it, then will consider asking our ISP to upgrade to ES5.
Bob
You can wait if you want but I wouldn't count on a new version of PHP being in there. an upgrade outside of the 4.3.x chain would break compatibility with any plugins that users might have installed.
Bob Isaac
Mon 8th Jan '07, 4:59pm
Enterprise Server 4 -> Enterprise Server 5 will probably be the order of the day then.
Bob
jw00dy
Mon 8th Jan '07, 8:36pm
Yes, you only need the loader. You can load it dynamically as vBSEO suggests but I think that that is stupid if all you have on your site is vBulletin (where it would be loaded dynamically on EVERY page). I just toss the loader in as a zend_extension in my php.ini file.
That's exactly what I did. Supposedly, loading it from php.ini is faster as well, so that's what I'm doing.
It's working well at this point.
BTW, Question. I don't have a dual core, or multi proc server, but with xcache, I believe I read something about virtual processors, and with Intel's HT I'm running mine with 2, even though, in reality it's only one proc.
Thought?
BTW (2) thanks for the help. I really appreciate it.
jason|xoxide
Tue 9th Jan '07, 11:13am
If you have a single core with HT enabled then you should be using two xcache bins, not one.
HT will not offer huge performance gains in multi-threaded/multi-process apps but it will help a bit in most cases (I believe the numbers I've seen are 10-20% as opposed to 60-80% for dual-core/dual-processor).
jw00dy
Tue 9th Jan '07, 8:30pm
Cool, thanks. I've had it at 2 since the get go, and it seems to be working well, so that's a good sign.
curriertech
Tue 9th Jan '07, 10:05pm
Will XCache work with phpsuexec enabled? I'm guessing not but I have to ask. :)
curriertech
Tue 9th Jan '07, 11:35pm
Will XCache work with phpsuexec enabled? I'm guessing not but I have to ask. :)
I'm impatient as usual (not a complaint) so I canned phpsuexec and setup xcache. So far it seems to work great - page generation times are down...but it's a slow time of day for my server.
jason|xoxide
Wed 10th Jan '07, 11:50am
Will XCache work with phpsuexec enabled? I'm guessing not but I have to ask. :)
No idea. I would have to say "yes" if either APC or eAccelerator work and "no" if neither does.
curriertech
Wed 10th Jan '07, 5:08pm
No idea. I would have to say "yes" if either APC or eAccelerator work and "no" if neither does.
I'd have to agree. :)
Is 16k or 8k better for slots? I've seen both in the php.ini settings listed here. Mine is set to 16k now and is running fine. Is there any performance gain for one over the other?
jason|xoxide
Wed 10th Jan '07, 5:25pm
I'd have to agree. :)
Is 16k or 8k better for slots? I've seen both in the php.ini settings listed here. Mine is set to 16k now and is running fine. Is there any performance gain for one over the other?
Slots is the number of file entries you plan to need for each cache bin. 8K and 16K are both way too high for a single vBulletin site. The only time you'd need anywhere near that many entries is if you run a couple dozen sites on a single server.
To be honest, I don't believe that the number you enter matters one bit (the docs say it's a "suggestion" only).
curriertech
Fri 12th Jan '07, 9:58am
While this seems to be working great, I have the mmap path set to /tmp/xcache.XXXXXX but I don't see anything like that in /tmp. Is that normal? :confused:
jason|xoxide
Fri 12th Jan '07, 11:58am
While this seems to be working great, I have the mmap path set to /tmp/xcache.XXXXXX but I don't see anything like that in /tmp. Is that normal? :confused:
Yes, I believe that's normal.
ArAb4NoKiA
Fri 12th Jan '07, 12:53pm
XCache is not loaded
Please check /usr/local/lib/php.ini
why ??
jason|xoxide
Fri 12th Jan '07, 12:58pm
XCache is not loaded
Please check /usr/local/lib/php.ini
why ??
You're not really giving us much to work with. Did you install using my src.rpm or did you build from source? If my src.rpm, did it build and install successfully? When you start httpd, are there any messages in the httpd error_log?
ArAb4NoKiA
Fri 12th Jan '07, 1:13pm
no there was no errors
and i installed this :
http://www.jasonlitka.com/media/files/php-xcache-1.2.0_0.2.src.rpm
Regards,
jason|xoxide
Fri 12th Jan '07, 1:17pm
And once you installed the src.rpm, did you build the actual RPMs and then install those? Were there any errors (either during the build or during the install)?
If you did install successfully, did you restart httpd? If you view your phpinfo(), are there any references to XCache?
EDIT: What exactly is giving you that message?
aspcoder
Fri 12th Jan '07, 2:20pm
Hi,
I installed Xcache on Cent 4.4 - php 4.4 and Cpanel server.
XCache
XCache Supportenabled
Version 1.2.0
Modules Built cacher optimizer coverager
Readonly Protection N/A
Opcode Cache disabled
Variable Cache disabled
Shared Memory Schemes malloc, mmap
Coverage Auto Dumper disabled
DirectiveLocal ValueMaster Value
xcache.cacherOnOn xcache.coredump_directoryno valueno value xcache.count11 xcache.coveragedump_directoryno valueno value xcache.coveragerOffOff xcache.gc_interval00 xcache.mmap_path/dev/zero/dev/zero xcache.optimizerOnOn xcache.readonly_protection00 xcache.shm_schememmapmmap xcache.size00 xcache.slots8K8K xcache.statOnOn xcache.test00 xcache.ttl00 xcache.var_count11 xcache.var_gc_interval120120 xcache.var_maxttl00 xcache.var_size00 xcache.var_slots8K8K xcache.var_ttl00
How can I change these values? I wrote on php.ini but nothing changes ( I restarted httpd )
jason|xoxide
Fri 12th Jan '07, 2:32pm
Hi,
I installed Xcache on Cent 4.4 - php 4.4 and Cpanel server.
XCache
XCache Supportenabled
Version 1.2.0
Modules Built cacher optimizer coverager
Readonly Protection N/A
Opcode Cache disabled
Variable Cache disabled
Shared Memory Schemes malloc, mmap
Coverage Auto Dumper disabled
DirectiveLocal ValueMaster Value
xcache.cacherOnOn xcache.coredump_directoryno valueno value xcache.count11 xcache.coveragedump_directoryno valueno value xcache.coveragerOffOff xcache.gc_interval00 xcache.mmap_path/dev/zero/dev/zero xcache.optimizerOnOn xcache.readonly_protection00 xcache.shm_schememmapmmap xcache.size00 xcache.slots8K8K xcache.statOnOn xcache.test00 xcache.ttl00 xcache.var_count11 xcache.var_gc_interval120120 xcache.var_maxttl00 xcache.var_size00 xcache.var_slots8K8K xcache.var_ttl00
How can I change these values? I wrote on php.ini but nothing changes ( I restarted httpd )
If you built an RPM from my src.rpm (which it doesn't look like you did) then everything should be set to appropriate values.
If you built from source then I believe that the instructions tell you to copy the entire sample config to the bottom of your php.ini file. Alternatively, you can dump the xcache.ini file into your /etc/php.d folder and it should be parsed automatically. In either case, those are the settings you would want to edit.
hawamer
Fri 12th Jan '07, 3:12pm
If you are running RHEL4 then you can run "up2date -u php-php-devel php-gd php-mysql". That would be for 4.3.9.
If you are running CentOS4 then you can get the same packages with "yum". The centosplus repo has packages for 5.0.4 and 5.1.6 as well.
Alternatively, for either, you can follow the instructions on my site for building 5.1.6 or 5.2.0. I'm considering doing a post on 4.4.4 as well but that would be a bit later in the week.
I have CentOS 4.4
what is the command ?
jason|xoxide
Fri 12th Jan '07, 4:05pm
I have CentOS 4.4
what is the command ?
I already told you, you can use 'yum' to install packages on CentOS4. If you need more instruction than that then you should really start by reading the man pages (type "man yum" at the command line).
However, since I'm in a good mood, the command you'd want is:
yum install php php-devel php-gd php-mysqlKeep in mind though that if the version of PHP you have was compiled by a third-party admin panel (such as CPanel) that this may break your server.
You're probably just best off either disabling the requirements check by editing the spec file or compiling from source and then editing the config file on your own.
ArAb4NoKiA
Fri 12th Jan '07, 5:54pm
And once you installed the src.rpm, did you build the actual RPMs and then install those? Were there any errors (either during the build or during the install)?
If you did install successfully, did you restart httpd? If you view your phpinfo(), are there any references to XCache?
EDIT: What exactly is giving you that message?
i did the steps that you wrote, no there was no errors
yes i restarted the httpd, no there is no thing in the phpinfo
Regards,
jason|xoxide
Fri 12th Jan '07, 6:01pm
i did the steps that you wrote, no there was no errors
yes i restarted the httpd, no there is no thing in the phpinfo
Regards,
It sounds like your system is not parsing the /etc/php.d folder when it parses the php.ini file. Try taking all of the text in the /etc/php.d/xcache.ini file and tossing it at the bottom of your php.ini file.
ArAb4NoKiA
Fri 12th Jan '07, 6:06pm
when i put it
i have
Internal Server Error
in all sites
jason|xoxide
Fri 12th Jan '07, 6:38pm
... and there is nothing in /var/log/httpd/error_log that might explain why?
If so, there's really nothing more that I can do to help. I don't have any idea as to why it might not work for you.
XtAzY
Fri 12th Jan '07, 9:29pm
hmm why cant i enter the administration area. I cant get past the http auth box. I had the right md5 password in the xcache.ini, but it still say i got the wrong login info.
jason|xoxide
Sat 13th Jan '07, 12:21pm
hmm why cant i enter the administration area. I cant get past the http auth box. I had the right md5 password in the xcache.ini, but it still say i got the wrong login info.
How did you generate the MD5 hash? Are you sure that you didn't have an extra space or something at the beginning or end?
I usually use this site:
http://www.adamek.biz/md5-generator.php
XtAzY
Sat 13th Jan '07, 6:41pm
yes i did use that site and i just cut and paste the result. I also got the same result if i just ran md5("somepassword") It still wont let me log in for some reason. Oh im using FreeBSD not CentOS but it should work the same way.
NeutralizeR
Sun 14th Jan '07, 12:51am
I haven't removed eAccelerator and installed XCache yet but i'm going to do it asap.
PHP Bytecode Cacher Review October 2006 (http://itst.net/wp-content/uploads/2006/10/PHP%20Bytecode%20Cacher%20Review.html)
jason|xoxide
Mon 15th Jan '07, 11:06am
yes i did use that site and i just cut and paste the result. I also got the same result if i just ran md5("somepassword") It still wont let me log in for some reason. Oh im using FreeBSD not CentOS but it should work the same way.
That's strange. I assume that when you said you ran "md5("somepassword")" that you mean that you ran that from a PHP script, right? When you pasted it into the xcache.ini, you had the value inside of double-quotes, right?
XtAzY
Mon 15th Jan '07, 5:27pm
That's strange. I assume that when you said you ran "md5("somepassword")" that you mean that you ran that from a PHP script, right? When you pasted it into the xcache.ini, you had the value inside of double-quotes, right?
yep i got the password from the site u gave me and i ran md5("somepassword") on the server to compare the values. They're both the same
[xcache-common]
;; install as zend extension (recommended), normally "$extension_dir/xcache.so"
zend_extension = /etc/php.d/xcache.so
;auto_globals_jit = Off
[xcache.admin]
xcache.admin.user = "admin"
xcache.admin.pass = "cac7bc2ce1af4ce7d7aed7f7ffcc4394"
[xcache]
; ini only settings, all the values here is default unless explained
; select low level shm/allocator scheme implemenation
xcache.shm_scheme = "mmap"
; to disable: xcache.size=0
; to enable : xcache.size=64M etc (any size > 0) and your system mmap allows
xcache.size = 32M
jason|xoxide
Mon 15th Jan '07, 5:56pm
yep i got the password from the site u gave me and i ran md5("somepassword") on the server to compare the values. They're both the same
[xcache-common]
;; install as zend extension (recommended), normally "$extension_dir/xcache.so"
zend_extension = /etc/php.d/xcache.so
;auto_globals_jit = Off
[xcache.admin]
xcache.admin.user = "admin"
xcache.admin.pass = "cac7bc2ce1af4ce7d7aed7f7ffcc4394"
[xcache]
; ini only settings, all the values here is default unless explained
; select low level shm/allocator scheme implemenation
xcache.shm_scheme = "mmap"
; to disable: xcache.size=0
; to enable : xcache.size=64M etc (any size > 0) and your system mmap allows
xcache.size = 32M
Did you rename "config.php.example" to "config.php" (in the folder with the xcache admin panel)? If so, that might be the problem as that is something that is NOT done in my RPM.
XtAzY
Mon 15th Jan '07, 6:05pm
no... it remained as config.php.example. Im pretty sure it's not ur RPM problem, probably my server related. I was wondering if anyone know how to fix this issue.
Indy
Thu 18th Jan '07, 10:04am
hmm why cant i enter the administration area. I cant get past the http auth box. I had the right md5 password in the xcache.ini, but it still say i got the wrong login info.
I had the same problem, but backwards from you. I don't recall were I read the instructions, but I located the login info in my php.ini and entered it there. Just like you, I could not get into xcache.php. After reading through this thread, I located and entered the same info in the xcache.ini and the admin panel opens every time. So, I have the info in two places. I haven't tried removing it from php.ini yet to see what happens.
Hope that helps.
Dan
Bob Isaac
Thu 18th Jan '07, 6:09pm
If a file is called a lot will it still die after the set ttl period has expired, or only files that have not been called in that period will die?
Bob
jason|xoxide
Thu 18th Jan '07, 6:25pm
If a file is called a lot will it still die after the set ttl period has expired, or only files that have not been called in that period will die?
Bob
The TTL counter is for files that have not been accessed. Each access will reset the TTL for that object.
Bob Isaac
Thu 18th Jan '07, 6:37pm
Thanks, that helps with my config settings. FYI I have tried 4K slots and I kept getting OOM's so I went back to 8K. The only thing I have failed to prevent is swap usage. Never had it until I installed XCache 1.2.0. It does not go over about 8Mb but just cannot stop it.
Bob
ArAb4NoKiA
Thu 18th Jan '07, 8:14pm
root@host [~]# rpm -Uvh /usr/src/redhat/RPMS/i386/php-xcache-4.4.4_1.2.0-0.2.i386.rpm
error: cannot open Packages index using db3 - Permission denied (13)
error: cannot open Packages database in /var/lib/rpm
jason|xoxide
Fri 19th Jan '07, 12:24pm
Thanks, that helps with my config settings. FYI I have tried 4K slots and I kept getting OOM's so I went back to 8K. The only thing I have failed to prevent is swap usage. Never had it until I installed XCache 1.2.0. It does not go over about 8Mb but just cannot stop it.
Bob
Bob, 8MB of swap is not a problem on a modern system, just ignore it.
root@host [~]# rpm -Uvh /usr/src/redhat/RPMS/i386/php-xcache-4.4.4_1.2.0-0.2.i386.rpm
error: cannot open Packages index using db3 - Permission denied (13)
error: cannot open Packages database in /var/lib/rpm
This is not an XCache issue but one with your system as a whole. Normally that error would show up if you tried to install an RPM as a non-root user. However, since the above quote states that you were 'root', that would lead me to believe that your RPM database is missing or damaged.
You might try the procedure at the link below. Scroll down about 1/3 of the way (right below the second <hr>) and start from there.
http://www.rpm.org/hintskinks/repairdb/
ArAb4NoKiA
Fri 19th Jan '07, 3:32pm
Hello,
i have the same problem :(
root@host [/var/lib/rpm]# rpm --rebuilddb
error: failed to replace old database with new database!
error: replace files in /var/lib/rpm with files from /var/lib/rpmrebuilddb.2718 to recovererror: failed to remove directory /var/lib/rpmrebuilddb.2718: Directory not empty
jason|xoxide
Fri 19th Jan '07, 4:01pm
Hello,
i have the same problem :(
root@host [/var/lib/rpm]# rpm --rebuilddb
error: failed to replace old database with new database!
error: replace files in /var/lib/rpm with files from /var/lib/rpmrebuilddb.2718 to recovererror: failed to remove directory /var/lib/rpmrebuilddb.2718: Directory not empty
If a rebuild didn't fix it then there is something seriously wrong with your RPM database. You may need to do an OS reload to fix it.
ArAb4NoKiA
Fri 19th Jan '07, 5:07pm
Hello,
root@host [~]# rpm -Uvh /usr/src/redhat/RPMS/i386/php-xcache-4.4.4_1.2.0-0.2.i386.rpm
Preparing... ########################################### [100%]
package php-xcache-4.4.4_1.2.0-0.2 is already installed
root@host [~]# service httpd restart
/etc/init.d/httpd restart: httpd restarted
and there is nothing in the php.ini file about xcache
can you give me the code to add it to the php.ini
Regards,
jason|xoxide
Fri 19th Jan '07, 5:17pm
Hello,
root@host [~]# rpm -Uvh /usr/src/redhat/RPMS/i386/php-xcache-4.4.4_1.2.0-0.2.i386.rpm
Preparing... ########################################### [100%]
package php-xcache-4.4.4_1.2.0-0.2 is already installed
root@host [~]# service httpd restart
/etc/init.d/httpd restart: httpd restarted
and there is nothing in the php.ini file about xcache
can you give me the code to add it to the php.ini
Regards,
If you used my src.rpm then a foile called xcache.ini will be installed in the /etc/php.d/ folder. On normal RHEL/CentOS systems this folder is automatically parsed and XCache will work out of the box. If your system is not loading the items in that folder then you'll need to copy all of the info from that file into the bottom of your php.ini.
ArAb4NoKiA
Fri 19th Jan '07, 6:05pm
when i paste it into the bottom of php.ini the httpd unabled to start
root@host [/etc/php.d]# cat error_log
[20-Jan-2007 01:03:03] PHP Fatal error: [Zend Optimizer] Zend Optimizer 3.0.0 is incompatible with XCache 1.2.0 in Unknown on line 0
[20-Jan-2007 01:03:13] PHP Fatal error: [Zend Optimizer] Zend Optimizer 3.0.0 is incompatible with XCache 1.2.0 in Unknown on line 0
[20-Jan-2007 01:03:26] PHP Fatal error: [Zend Optimizer] Zend Optimizer 3.0.0 is incompatible with XCache 1.2.0 in Unknown on line 0
jason|xoxide
Fri 19th Jan '07, 6:10pm
when i paste it into the bottom of php.ini the httpd unabled to start
root@host [/etc/php.d]# cat error_log
[20-Jan-2007 01:03:03] PHP Fatal error: [Zend Optimizer] Zend Optimizer 3.0.0 is incompatible with XCache 1.2.0 in Unknown on line 0
[20-Jan-2007 01:03:13] PHP Fatal error: [Zend Optimizer] Zend Optimizer 3.0.0 is incompatible with XCache 1.2.0 in Unknown on line 0
[20-Jan-2007 01:03:26] PHP Fatal error: [Zend Optimizer] Zend Optimizer 3.0.0 is incompatible with XCache 1.2.0 in Unknown on line 0
Read the error message, it's telling you what the problem is. You'll have to make a choice between the two. If you need Zend, you can't use XCache. If you don't, you shouldn't have it installed anyway.
ArAb4NoKiA
Fri 19th Jan '07, 6:15pm
:(
so if i used XCache the zended files will not work :( ?
dsotmoon
Fri 19th Jan '07, 6:23pm
please excuse the noobie question but I asked my server co to install this for me, phpinfo now shows
This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies with XCache v1.2.0, Copyright (c) 2005-2006, by mOo
and
Version 1.2.0
Modules Built cacher optimizer coverager
Readonly Protection N/A
Opcode Cache enabled, 33,554,432 bytes, 2 split(s), with 8192 slots each
Variable Cache disabled
Shared Memory Schemes malloc, mmap
Coverage Auto Dumper disabled
Directive Local Value Master Value
xcache.cacher On On
xcache.coredump_directory no value no value
xcache.count 2 2
xcache.coveragedump_directory no value no value
xcache.coverager Off Off
xcache.gc_interval 0 0
xcache.mmap_path /tmp/xcache.XXXXXX /tmp/xcache.XXXXXX
xcache.optimizer On On
xcache.readonly_protection no value no value
xcache.shm_scheme mmap mmap
xcache.size 32M 32M
xcache.slots 8K 8K
xcache.stat On On
xcache.test no value no value
xcache.ttl 0 0
xcache.var_count 1 1
xcache.var_gc_interval 300 300
xcache.var_maxttl 0 0
xcache.var_size 0M 0M
xcache.var_slots 8K 8K
xcache.var_ttl 0 0
does this look correct?
thanks in advance and thanks for taking the time to make this easy Jason, great job
jason|xoxide
Fri 19th Jan '07, 6:59pm
:(
so if i used XCache the zended files will not work :( ?
Yes, that is correct. Keep in mind though that many vendors that sell Zend-encoded plugins will also have Ioncube versions available. XCache will work with Ioncube.
please excuse the noobie question but I asked my server co to install this for me, phpinfo now shows
and
Version 1.2.0
Modules Built cacher optimizer coverager
Readonly Protection N/A
Opcode Cache enabled, 33,554,432 bytes, 2 split(s), with 8192 slots each
Variable Cache disabled
Shared Memory Schemes malloc, mmap
Coverage Auto Dumper disabled
Directive Local Value Master Value
xcache.cacher On On
xcache.coredump_directory no value no value
xcache.count 2 2
xcache.coveragedump_directory no value no value
xcache.coverager Off Off
xcache.gc_interval 0 0
xcache.mmap_path /tmp/xcache.XXXXXX /tmp/xcache.XXXXXX
xcache.optimizer On On
xcache.readonly_protection no value no value
xcache.shm_scheme mmap mmap
xcache.size 32M 32M
xcache.slots 8K 8K
xcache.stat On On
xcache.test no value no value
xcache.ttl 0 0
xcache.var_count 1 1
xcache.var_gc_interval 300 300
xcache.var_maxttl 0 0
xcache.var_size 0M 0M
xcache.var_slots 8K 8K
xcache.var_ttl 0 0
does this look correct?
thanks in advance and thanks for taking the time to make this easy Jason, great job
Yes, that seems fine.
Zero Tolerance
Fri 19th Jan '07, 7:34pm
Just installed this over eAccelerator, and wow such a great difference, some pages have gone from 1 seconds processing to 0.05, damn good :)
I wonder if vBulletin will enable a datastore system for this cache? I sure hope so :)
- Zero Tolerance
langtoner
Fri 19th Jan '07, 10:31pm
I have installed the src.rpm on a CentOS system and am getting the following error on apache error_log:
---------------------------------------------------
PHP Fatal error: Cannot open file set by xcache.mmap_path in Unknown on line 0
PHP Fatal error: XCache: Cannot create shm in Unknown on line 0
PHP Fatal error: XCache: Cannot init in Unknown on line 0
PHP Fatal error: Unable to start XCache module in Unknown on line 0
/dev/zero: Permission denied
Cannot open file set by xcache.mmap_path
--------------------------------------------------
Apache then fails. Any ideas?
langtoner
Fri 19th Jan '07, 10:56pm
Just to answer my own question, in case anybody else has this problem:
In xcache.ini, I changed:
xcache.mmap_path = "/dev/zero"
To
xcache.mmap_path = "/tmp/xcache"
Now Apache is working.
jason|xoxide
Sat 20th Jan '07, 9:30pm
Just to answer my own question, in case anybody else has this problem:
In xcache.ini, I changed:
xcache.mmap_path = "/dev/zero"
To
xcache.mmap_path = "/tmp/xcache"
Now Apache is working.
Are you on a VPS? There might not have been a /dev/zero (or at least not one that you have access to). In any case, I'm glad you figured it out.
Bob Isaac
Mon 22nd Jan '07, 2:21pm
Sometime this week we are having a second CPU fitted. Will XCache need to be reinstalled, or xcache.size changed?
Bob
jason|xoxide
Mon 22nd Jan '07, 2:29pm
Sometime this week we are having a second CPU fitted. Will XCache need to be reinstalled, or xcache.size changed?
Bob
You don't need to rebuild. Just edit the xcache.ini file and change xcache.count to the number of cores in your system.
You may also want to increase xcache.size because the above change will decrease the available cache in each chunk. Personally, I'd change the count and then just wait on the size until you see if you're reaching OOM on any bin.
Bob Isaac
Mon 22nd Jan '07, 4:13pm
Thanks, but I am confused with xcache.count. When I installed your rpm it set xcache.count=2. AFAIK the server has only one Xeon 3.06 CPU, so what would it be with the extra CPU, 3 or 4?
Bob
curriertech
Mon 22nd Jan '07, 4:15pm
Thanks, but I am confused with xcache.count. When I installed your rpm it set xcache.count=2. AFAIK the server has only one Xeon 3.06 CPU, so what would it be with the extra CPU, 3 or 4?
Bob
That number should equal the number of processors. If you have one, xcache.count=1, etc.
jason|xoxide
Mon 22nd Jan '07, 4:35pm
Thanks, but I am confused with xcache.count. When I installed your rpm it set xcache.count=2. AFAIK the server has only one Xeon 3.06 CPU, so what would it be with the extra CPU, 3 or 4?
Bob
It was set as "2" because your CPU has hyper-threading enabled. If you installed a second single-core CPU with HT then it should be set to "4" for the most benefit.
Bob Isaac
Mon 22nd Jan '07, 4:53pm
Thanks, that explains why cat /proc/cpuinfo shows processor:0 and processor:1.
Bob
Bob Isaac
Fri 26th Jan '07, 11:24am
I am using http://www.volvoclub.org.uk/forum/external.php?type=RSS2 but the page never refreshes unless you use the browser refresh button. Is it likely this caused by XCache holding it in cache.
Bob
jason|xoxide
Fri 26th Jan '07, 11:30am
I am using http://www.volvoclub.org.uk/forum/external.php?type=RSS2 but the page never refreshes unless you use the browser refresh button. Is it likely this caused by XCache holding it in cache.
Bob
XCache does not cache content, only compiled opcode. The information on that page will be fetched on demand unless your browser tells it otherwise.
In all likelihood, that page is cached by your browser and pressing the "Refresh" button after the page has already loaded is forcing it to request a clean copy.
Steve Machol
Fri 26th Jan '07, 2:14pm
FYI: We have seen confirmed reports of problems with XCache. At this time I would not recommending using it. Here is some more info:
http://forum.lighttpd.net/topic/3854
Indy
Fri 26th Jan '07, 2:56pm
My experience with XCache: http://www.vbulletin.com/forum/showthread.php?t=217286
I removed everything from php.ini and restarted Apache and my problems went away! Many thanks to the vB team for helping me track this down!!
jason|xoxide
Fri 26th Jan '07, 3:00pm
FYI: We have seen confirmed reports of problems with XCache. At this time I would not recommending using it. Here is some more info:
http://forum.lighttpd.net/topic/3854
Have you had people report this issue directly to you or are you just going off of that thread? If directly reported, what httpd server were they using? PHP? XCache?
Regardless, all I can say is that I have had great success with XCache and I have not personally seen this issue with httpd 2.2.x/PHP 5.2.0/XCache 1.2.0 or with lighttpd 1.4.13/PHP 5.1.6/XCache 1.2.0.
The users on my boards tend to be pretty picky so if it was affecting me, they would have reported it by now.
EDIT: I just read Indy's thread and he was also using PHP 4.x. Steve, are any of the other reports you've received from PHP 4.x users? Has anyone running PHP 5.1 or 5.2 had problems?
Indy
Fri 26th Jan '07, 3:45pm
jason|xoxide,
If you need any further information from my setup, please don't hesitate to ask. I'll provide you with whatever I can if you are interested. The main reason that I went with XCache in the first place is because of the many recommendations that I saw in the forums.
Perhaps my xcache install needed to be tweaked???? I'm certainly no expert. I did download your rpm and that was used. Many thanks! I did not install personally, but rather the tech people at ThePlanet.
dsotmoon
Fri 26th Jan '07, 7:23pm
oh wow, i came here to ask a question about the xCache settings and just found my answer to another problem, I am getting the Fatal Error while trying to add a new hack, back to APC I guess :confused:
jw00dy
Fri 26th Jan '07, 8:28pm
Same thing for me. Guess xCache isn't quite ready :(
I love it though, and it works really well otherwise.
dsotmoon
Sat 27th Jan '07, 12:19pm
I am getting the Fatal Error while trying to add a new hack, back to APC I guess :confused:
just as an update: I uninstalled xCache and installed APC again and the problem went away
Indy
Sat 27th Jan '07, 1:52pm
Last night I installed APC (APC-3.0.12p2). I still have XCache onboard for future use if it is determined what the problems are. The reason that I have so much faith in XCache is because of all of the recommendations to use it and those who say it works for them. Someone will figure it out eventually!
jw00dy
Sat 27th Jan '07, 3:47pm
I did the same thing both of you did. I left xcache installed (not loaded) so I can go back to it later. It's is faster then APC, as I can tell already.
eva2000
Sat 27th Jan '07, 8:43pm
jason|xoxide,
If you need any further information from my setup, please don't hesitate to ask. I'll provide you with whatever I can if you are interested. The main reason that I went with XCache in the first place is because of the many recommendations that I saw in the forums.
Perhaps my xcache install needed to be tweaked???? I'm certainly no expert. I did download your rpm and that was used. Many thanks! I did not install personally, but rather the tech people at ThePlanet.
could be problems with the rpm binary used for your setup ? tried source install ? or with vB 3.6.x ?
no probs here with Xcache 1.03 compiled from source for CentOS 4.x server with vB 3.5.x and vB 3.0.x forums with PHP 4.4.4 and MySQL 4.0.27
what did your apache error log have regarding Xcache related errors if any ?
Indy
Sun 28th Jan '07, 12:30am
could be problems with the rpm binary used for your setup ? tried source install ? or with vB 3.6.x ?I used the file that jason|xoxide has on his site.
I'm running 3.6.4 (Full setup shown in my signature)
what did your apache error log have regarding Xcache related errors if any ?Just had a look. Nothing.
Thanks eva2000!
Bob Isaac
Sun 28th Jan '07, 6:04am
Since going back to APC things have been smoother. I tried many combinations of settings. One issue I had with XCache was the ever-growing swap size, it never went down again. With APC it never moves from its 144K size.
PHP Version4.3.9
Server SoftwareApache/2.0.52 (Red Hat)
Bob
ComputerVitals
Mon 29th Jan '07, 12:56pm
While running xcache we recieved this error while trying to upload pictures to the image hosting.
Fatal error: Direct Instantiation of vB_Image_Abstract prohibited.
in /includes/class_image.php on line 190
And line 190 is.
trigger_error('Direct Instantiation of vB_Image_Abstract prohibited.',
E_USER_ERROR);
Any ideas on how to fix that. As soon as I disable xcache the problem goes away.
jason|xoxide
Mon 29th Jan '07, 1:09pm
While running xcache we recieved this error while trying to upload pictures to the image hosting.
And line 190 is.
trigger_error('Direct Instantiation of vB_Image_Abstract prohibited.',
E_USER_ERROR);
Any ideas on how to fix that. As soon as I disable xcache the problem goes away.
What version of PHP are you using?
ComputerVitals
Mon 29th Jan '07, 1:23pm
php 4.4.4
jason|xoxide
Mon 29th Jan '07, 2:30pm
php 4.4.4
That's three people running PHP 4.x with XCache problems. I'm going to edit the original post saying that there may be some problems with XCache and PHP 4.
ComputerVitals
Mon 29th Jan '07, 2:37pm
I'll keep it disabled till we figure it out..
Thanks.
nixor
Mon 29th Jan '07, 11:35pm
Switched from APC to Xcache and I have one question. We had vB_Datastore_APC uncommented in the config file before. Is there a similar one for XCache?
Mike Warner
Tue 30th Jan '07, 9:11am
Since installing the template cache hack at vbulletin.org, the number of php files has grown considerably. Now I am getting lots of OOMs. I'm already set to 64mb cache size, I guess I need to increase the size. Do I need to go to 128mb, or can I use any number - i.e. 80mb?
See attachment. :)
Many thanks.
Mike
jason|xoxide
Tue 30th Jan '07, 11:14am
Switched from APC to Xcache and I have one question. We had vB_Datastore_APC uncommented in the config file before. Is there a similar one for XCache?
No, but you can use the file datastore (which will then be cached).
Since installing the template cache hack at vbulletin.org, the number of php files has grown considerably. Now I am getting lots of OOMs. I'm already set to 64mb cache size, I guess I need to increase the size. Do I need to go to 128mb, or can I use any number - i.e. 80mb?
See attachment. :)
Many thanks.
Mike
Yeah, that plugin significantly increases the number of PHP items available to be cached. You can use any number, but if you're using multiple caches, neatness-sake would require that the total size be evenly divisible by the number of caches.
jason|xoxide
Tue 30th Jan '07, 8:20pm
I've just updated the first post with a link to installing XCache (both 1.2.0 & 1.0.3) from source. This may be useful to those of you not running an RPM-based distro.
To those running PHP 4 who had problems with 1.2.0, if you would, please give 1.0.3 a try and see if you still have problems. If you still do, try editing the config and disabling the Optimizer as that could be what is causing the problem.
How-To: Compiling XCache from Source (http://www.jasonlitka.com/2007/01/30/how-to-compiling-xcache-from-source/)
Indy
Tue 30th Jan '07, 9:11pm
jason|xoxide,
I switched back to XCache a day or two ago for further testing. Since it was not affecting my live, public forums (for some strange reason) I felt that I could run with it and see what happens. I still encountered the same problem when trying to view threads/posts in my dev forum and I would also receive an error when trying to install a product. (class_dbalter).
I saw your above post and thought that I would set optimizer = Off and continue with 1.2.0. To my surprise, some of my problems seem to have gone away. I can now use my dev forum with no errors when I try to read a thread/post but still received dbalter error when trying to install product. I think you may have hit the nail on the head with the optimizer thing. (At least it seems to be helping with the class_postbit error.
I will continue to run "as is" and watch things. I'll keep you updated. Keep your fingers crossed!
Dan
ps - Thanks for your assistance!!!
Indy
Tue 30th Jan '07, 9:16pm
BTW - for informational purposes....
I'm set at: 64M/16K on size/slots. 500 users online. Server load is great!!
Screen shot xcache.php attached.
eva2000
Wed 31st Jan '07, 1:46am
Last night I installed APC (APC-3.0.12p2). I still have XCache onboard for future use if it is determined what the problems are. The reason that I have so much faith in XCache is because of all of the recommendations to use it and those who say it works for them. Someone will figure it out eventually!
Interesting i experienced my first instance of the error but it only occured when Mod_security was enabled today with a default configuration set... without mod_security no probs. Still using 1.03 xcache compiled from source on WHM/Cpanel based server with PHP 4.4.4
jason|xoxide
Wed 31st Jan '07, 11:34am
I saw your above post and thought that I would set optimizer = Off and continue with 1.2.0. To my surprise, some of my problems seem to have gone away. I can now use my dev forum with no errors when I try to read a thread/post but still received dbalter error when trying to install product. I think you may have hit the nail on the head with the optimizer thing. (At least it seems to be helping with the class_postbit error.
I will continue to run "as is" and watch things. I'll keep you updated. Keep your fingers crossed!
Dan
ps - Thanks for your assistance!!!
Do you have mod_security installed?
Interesting i experienced my first instance of the error but it only occured when Mod_security was enabled today with a default configuration set... without mod_security no probs. Still using 1.03 xcache compiled from source on WHM/Cpanel based server with PHP 4.4.4
When you got that error while using mod_security, did you have the XCache Optimizer enabled?
Indy
Wed 31st Jan '07, 1:00pm
Do you have mod_security installed?
Negative on the mod_security.
jason|xoxide
Thu 1st Feb '07, 2:49pm
Negative on the mod_security.
You installed 1.2.0, right? Would you mind trying out 1.0.3? I'm interested to know if the optimizer breaks vBulletin in all versions or just under 1.2.0.
karabaja
Thu 1st Feb '07, 6:30pm
Any idea about this guys:
"XCache requires Zend Engine API version 220051025.
The Zend Engine API version 220060519 which is installed, is newer.
Contact mOo at http://xcache.lighttpd.net for a later version of
XCache."
I compiled xcache 1.2.0 from source. Following this procedure:
http://trac.lighttpd.net/xcache/wiki/InstallFromSource
The above error I get when I try to load it as zend extension. When I try as php extension I don't get any errors but xcache doesn't load either.
I had eaccelerator running until yesterday. Now I get same error when I try eaccelerator as zend extension. It just referrs to eaccelerator url to download later version.
What happened yesterday is some problems with apache I couldn't handle. So I asked hosting support to help. And they took the easy way out and just recompiled apache and php. The thing is that I was using php5.1.2 before. That's when eaccelerator was working fine. I had zend optimizer 3.0.1 installed.
Now they installed php 5.2 and I had to upgrade zend optimizer to 3.2.2.
Now I am not sure what is causing the above error but I would really appreciate any help.
jason|xoxide
Thu 1st Feb '07, 7:39pm
Any idea about this guys:
"XCache requires Zend Engine API version 220051025.
The Zend Engine API version 220060519 which is installed, is newer.
Contact mOo at http://xcache.lighttpd.net for a later version of
XCache."I compiled xcache 1.2.0 from source. Following this procedure:
http://trac.lighttpd.net/xcache/wiki/InstallFromSourceThe above error I get when I try to load it as zend extension. When I try as php extension I don't get any errors but xcache doesn't load either.
I had eaccelerator running until yesterday. Now I get same error when I try eaccelerator as zend extension. It just referrs to eaccelerator url to download later version.
What happened yesterday is some problems with apache I couldn't handle. So I asked hosting support to help. And they took the easy way out and just recompiled apache and php. The thing is that I was using php5.1.2 before. That's when eaccelerator was working fine. I had zend optimizer 3.0.1 installed.
Now they installed php 5.2 and I had to upgrade zend optimizer to 3.2.2.
Now I am not sure what is causing the above error but I would really appreciate any help.
Two things: First, are you sure that you downloaded the sources for 1.2.0? I'm using 1.2.0 with PHP 5.2 without any problems. Second, XCache doesn't work with the Zend Optimizer 3.x.
karabaja
Thu 1st Feb '07, 8:28pm
Two things: First, are you sure that you downloaded the sources for 1.2.0? I'm using 1.2.0 with PHP 5.2 without any problems. Second, XCache doesn't work with the Zend Optimizer 3.x.
Yes, I am sure it is 1.2.0.
I managed to get it working now. I went to xcache dir and did:
"make distclean"
then did:
phpize
./configure --enable-xcache --with-php-config=/usr/local/bin/php-config.
make
make install
And then it loaded as php extenstion. It won't load as zend extenstion.
I have a couple of questions about it though.
xcache.size = 0M
If I set that to anything other then 0 apache won't start. Actually it did start when I set it to 1 but trying to open a board page I got memory allocation error.
Am I ok leaving that 0 ?
And about compiling with optmizer. Is that possible or would it be a conflict with zend optimizer?
karabaja
Fri 2nd Feb '07, 5:46am
Now I am not sure if it is doing anything. Admin page doesn't show anything happening in stats. Could someone please advice the configuration. I left it on default configuration since I am not sure what to change:
Here is what module info says:
Version 1.2.0
Modules Built cacher
Readonly Protection N/A
Opcode Cache disabled
Variable Cache disabled
Shared Memory Schemes malloc, mmap
xcache.cacher On
xcache.coredump_directory no value
xcache.count 2
xcache.gc_interval 0
xcache.mmap_path /dev/zero
xcache.readonly_protection no value
xcache.shm_scheme mmap
xcache.size 0M
xcache.slots 8K
xcache.stat On
xcache.test no value
xcache.ttl 0
xcache.var_count 1
xcache.var_gc_interval 300
xcache.var_maxttl 0
xcache.var_size 0M
xcache.var_slots 8K
xcache.var_ttl 0
jason|xoxide
Fri 2nd Feb '07, 2:27pm
If you have the size set to 0M then it will completely disable XCache. As to it not starting when you set it to something else, as I already said, XCache and Zend Optimizer are mutually-exclusive; you cannot run both.
karabaja
Fri 2nd Feb '07, 4:36pm
If you have the size set to 0M then it will completely disable XCache. As to it not starting when you set it to something else, as I already said, XCache and Zend Optimizer are mutually-exclusive; you cannot run both.
Ok, thx. I decided to remove zend optimizer anyway. I was using it for vbseo. But I am gonna drop that as well. And go with zoints seo, if it turns out to work ok.
Do you recommend installing something instead of zend optimizer. Like ioncube or something?
jason|xoxide
Fri 2nd Feb '07, 7:15pm
Ok, thx. I decided to remove zend optimizer anyway. I was using it for vbseo. But I am gonna drop that as well. And go with zoints seo, if it turns out to work ok.
Do you recommend installing something instead of zend optimizer. Like ioncube or something?
If you need the Ioncube loaders then install them. If you don't, then don't. The same goes for the Zend Optimizer. If you have programs that need it then install, if not, don't.
As to what to use instead, use XCache.
karabaja
Sat 3rd Feb '07, 6:23am
If you need the Ioncube loaders then install them. If you don't, then don't. The same goes for the Zend Optimizer. If you have programs that need it then install, if not, don't.
As to what to use instead, use XCache.
Ok, thx for your replies. Yes I am just gonna go with xcache for now. I don't have anything encoded to run so I don't need ioncube for now or zend optimizer. Unless I decide to go back to vbseo, in which case I guess I'll have to use them.
jason|xoxide
Sat 3rd Feb '07, 2:36pm
Ok, thx for your replies. Yes I am just gonna go with xcache for now. I don't have anything encoded to run so I don't need ioncube for now or zend optimizer. Unless I decide to go back to vbseo, in which case I guess I'll have to use them.
The Ioncube version of vBSEO works just fine with XCache (and is what I run on all of my sites).
jason|xoxide
Thu 8th Feb '07, 12:34pm
In case anyone is keeping track or was hesitant to install because of the "Unstable" tag on the version number, the 1.2.0 release of XCache has now been marked "Stable".
Zia
Fri 9th Feb '07, 8:18am
reading a lot around the caching issue..lots of option..lots of opinion..that just really make me confused a lot..
few months back we install eAcclereator..n its working...
within this three xCache(http://trac.lighttpd.net/xcache/wiki/Release-1.2.0) ; APC ; eAcclereator
we dont use Zend Optimizer, we are using Ioncube Php Loader(inocube Vbseo & ioncube Msn Grabber working on our board),vb is 3.6.4,Apache 1.3.37,Php5.2.0
here is our php info
http://www.golpo.net/test111.php?info=1
any one can just tell me the perfect & best combination?
mm during search for Xcache i got 2 palce
http://www.xcache.com : Paid
http://trac.lighttpd.net/xcache/wiki/Release-1.2.0 : free
about which Xcache here the discussion goin on ?
which one is top most better for filecache or phpcache (both are same ??!!!)
which datastore cache will be work on that ? with ioncube
*eAcclerator+PECl Memcache ?
or
*Xcache + PECL Memcache
We have 256Mb Guranteed Ram & 1000 MB Burst ram.
just suggest me the right combination n help me out from all of confusion ...
thnx
jason|xoxide
Fri 9th Feb '07, 11:38am
The XCache that people are talking about is the one in the second link, the one made by the developer of lighttpd.
As far as speed goes, it's XCache > APC > eAccelerator (although I've found that eA is a bit more stable than APC). Any of the above can be used with the file system datastore for a speed increase.
Finally, as to what combination works best, that's a bit up in the air as no one will really agree on that because it varies a bit based on your configuration. For my larger boards (> 1 million posts) I use XCache w/ memcache. For the smaller ones I use XCache w/ file system datastore. Both of these configurations will work with the Ioncube loaders.
Bob Isaac
Fri 9th Feb '07, 4:17pm
I have decided to give 1.0.3 a try with my PHP 4.3.9 and installed from source as per your instructions. XCache is in my phpinfo, but how do I access the admin? The only index.php is in the source directory.
Bob
EDIT: Moved the /admin/ dir from the source dir to /var/www/html/xcache/ and just get a blank page.
kerplunk
Fri 9th Feb '07, 6:59pm
You should really try 1.2.0 instead. :)
It's considered "stable" now too, if that was your reason for using 1.0.3.
jason|xoxide
Fri 9th Feb '07, 7:27pm
I have decided to give 1.0.3 a try with my PHP 4.3.9 and installed from source as per your instructions. XCache is in my phpinfo, but how do I access the admin? The only index.php is in the source directory.
Bob
EDIT: Moved the /admin/ dir from the source dir to /var/www/html/xcache/ and just get a blank page.
Did you set an admin user and password in xcache.ini or your php.ini file (which ever has your settings for xcache)? Are there any messages in httpd's error_log?
Bob Isaac
Sat 10th Feb '07, 4:59am
I didn't set the pass assuming I would still be able to access admin without it. Are you suggesting the admin will be created on httpd restart only if the pass is set?
kerplunk, one reason I removed 1.2.0 was my swap was growing bigger - huge - daily. Removing 1.2.0 reset my cache back to its stable 144K.
Bob
eva2000
Sat 10th Feb '07, 5:51am
i'm still on 1.0.3 with no probs... wonder if i should rock the boat with 1.2 hehe
jason|xoxide
Sat 10th Feb '07, 11:23am
I didn't set the pass assuming I would still be able to access admin without it. Are you suggesting the admin will be created on httpd restart only if the pass is set?
kerplunk, one reason I removed 1.2.0 was my swap was growing bigger - huge - daily. Removing 1.2.0 reset my cache back to its stable 144K.
Bob
The admin control panel will only work if there is an admin user/pass set. I'm not sure what happens under 1.0.3 (blank page perhaps) but in 1.2.0 it errors out saying the the field isn't set.
Bob Isaac
Sat 10th Feb '07, 1:59pm
I added the pass and I was able to access the admin. But it was in text only - see attachment. Is this correct? I doubt it.
Bob
jason|xoxide
Sat 10th Feb '07, 2:59pm
I added the pass and I was able to access the admin. But it was in text only - see attachment. Is this correct? I doubt it.
Bob
There are no graphics in 1.2.0 but there is a CSS layout. It sounds like either the CSS is inaccessible (possibly missing or with bad permissions) or your browser isn't rendering it.
Bob Isaac
Sat 10th Feb '07, 3:59pm
I pasted the css into xcache.tpl.php and it worked. I have to say that it does not inspire confidence. I'll see how it goes for a few days.
If 1.2.0 (stable) is identical with 1.2.0 (unstable) then I won't be going to that in a hurry.
Bob
Zia
Sun 11th Feb '07, 2:23pm
Helo
We are on a VPS.
OS : CentOS 4.4 (Linux)
Processor: Dual Opteron 248, RAID 10
Harddisk : SATA II. 7200 RPM
Apache : Apache1.3.37 ,Linux
Php ver : 5.2.0
Guaranteed Ram :256 Mb (+ 1GB burst ram.)
Atm we are using eAcclereator.Now planning to move to Xcache.
we dont have Zend Optimizer.But Ioncube (vbseo+msn inviter)
OUR PHP INFO IS
http://www.golpo.net/test111.php?info=1
To install XCache ..we have to uninstall eAcc first? or just disable it by uncomment (#...) the lines at php.ini will enough ?
what will be our
xcache.count = ?? (2 ?)
example if i use 64Mb and its filled up with cached script what will be happen? does it support disk cache to ? (i gez eAcc support disk cache)
enable cacher + optimizer might be a reason of high cup uses?
how to enable datastore file system using xcache?
and the Admin folder can be puted any location?
like www.mysite.net/forum/xAdmin ??
Thnx
jason|xoxide
Mon 12th Feb '07, 11:33am
Before you install XCache you would need to disable eAccelerator. You can do that by removing or commenting out the eAccelerator lines in your php.ini file.
For that system you would want "xcache.count = 2" because there are two CPU cores.
If you set the total size to 64MB and you run out, it will not cache any additional data (64MB is a LOT). You can get around this by either increasing the cache size or changing the ttl values so that unused cache entries are purged.
The file system datastore can be enabled by uncommenting the appropriate line in your vBulletin config.php. The file will automatically be cached by XCache (just as it is with eAccelerator).
Finally, yes, the admin files can be stuck anywhere, just make sure that you set a username and password in php.ini or xcache.ini (if you use my src.rpm).
jason|xoxide
Mon 12th Feb '07, 11:35am
I pasted the css into xcache.tpl.php and it worked. I have to say that it does not inspire confidence. I'll see how it goes for a few days.
If 1.2.0 (stable) is identical with 1.2.0 (unstable) then I won't be going to that in a hurry.
Bob
I currently have XCache 1.2.0 installed on close to 2 dozen systems and have not had that problem except when connecting while I have my browser set to ignore external CSS files.
In any case, CSS is fluff, all of the data is there regardless of whether the layout file is being read (that's the beautiful thing about CSS).
Bob Isaac
Mon 12th Feb '07, 2:06pm
I have been doing some comparisons, and have noticed that APC holds a lot more files in cache than XCache, for the same allocated amount of memory.
Also, XCache seems to use more memory for fewer files.
For example, and these figures cannot be regarded as totally accurate, APC has 681 files and used 64% of 110Mb.
XCache used 85% memory for around 400 files.
(Based on a 24hr period)
Any ideas? The logic says the more files in cache the better. ttl and gc are set to the same in each.
Bob
fatal1980
Mon 12th Feb '07, 2:20pm
My Xcache keeps giving me:
Failed loading /usr/local/lib/php/extensions/no-debug-non-zts-20020429/xcache.so: undefined symbol: OnUpdateInt
in my error log. I read the earlier post about the directory but this seems correct.
I'm running PHP Version 5.2.1-0.dotdeb.1
What other accelerators work well with php5?
jason|xoxide
Mon 12th Feb '07, 2:23pm
I really couldn't say. It may have something to do with the scripts/plugins you're running. I just checked one of my clean sites and XCache doesn't have anywhere near that many compiled files in memory.
As to having a higher number of files in memory being better, that would be the assumption, however, you're comparing apples to oranges here because you don't know exactly what each one is reporting. They both claim to be reporting "files" but you don't know that for sure. One could be reporting individual files and the other could be reporting compiled paths (meaning a file and all of it's includes).
The real test is response time and CPU load.
unitedpunjab
Mon 12th Feb '07, 7:14pm
i just cant make xcache to work for me,
i have tried everything i could but apache fails to restart.
I am on a vps and this is my php info http://www.attinderdhillon.com/stats/phpinfo.php
if some can please tell me what should go into php.ini i can try again.
kerplunk
Mon 12th Feb '07, 7:54pm
What does Apache's error_log say?
unitedpunjab
Mon 12th Feb '07, 8:09pm
I get this when i give the restart command in ssh
root@vps [/]# service httpd restart
/etc/init.d/httpd: line 83: 20212 Segmentation fault $HTTPD -t >/dev/null 2 >&1
/etc/init.d/httpd restart: configuration broken, ignoring restart
/etc/init.d/httpd restart: (run 'apachectl configtest' for details)
sorry i don't know where and what to look for in apache log.
jason|xoxide
Tue 13th Feb '07, 12:05am
i just cant make xcache to work for me,
i have tried everything i could but apache fails to restart.
I am on a vps and this is my php info http://www.attinderdhillon.com/stats/phpinfo.php
if some can please tell me what should go into php.ini i can try again.
You can't have eAccelerator and XCache both enabled as they do the same work. Disable eAccelerator if you're going to use XCache.
I get this when i give the restart command in ssh
root@vps [/]# service httpd restart
/etc/init.d/httpd: line 83: 20212 Segmentation fault $HTTPD -t >/dev/null 2 >&1
/etc/init.d/httpd restart: configuration broken, ignoring restart
/etc/init.d/httpd restart: (run 'apachectl configtest' for details)
sorry i don't know where and what to look for in apache log.
That sounds like a syntax error. Did you use my src.rpm or did you compile from source and copy the settings into your php.ini? Did you try running "apachectl configtest" as that message suggested?
In any case, assuming that what I mentioned above didn't help, run "service httpd restart", let it fail, and then copy the last 100 lines or so out of "/var/log/httpd/error_log". You can use the "tail" command for that (run "tail -n 100 /var/log/httpd/error_log").
unitedpunjab
Tue 13th Feb '07, 8:50am
I am very sure that i am doing something wrong in php.ini
when is put just these lines in php.ini
[xcache-common]
zend_extension = /usr/lib/php/extensions/no-debug-non-zts-20060613/xcache.so
[xcache.admin]
xcache.admin.user = "mOo"
xcache.admin.pass = ""
[xcache]
xcache.shm_scheme = "mmap"
xcache.size = 32M
xcache.count = 4
xcache.slots = 8K
xcache.ttl = 0
xcache.gc_interval = 0
; same as aboves but for variable cache
xcache.var_size = 0M
xcache.var_count = 1
xcache.var_slots = 8K
; default ttl
xcache.var_ttl = 0
xcache.var_maxttl = 0
xcache.var_gc_interval = 300
xcache.test = Off
xcache.readonly_protection = Off
xcache.mmap_path = "/dev/zero"
xcache.coredump_directory = ""
xcache.cacher = On
xcache.stat = On
xcache.optimizer = Off
[xcache.coverager]
xcache.coverager = Off
xcache.coveragedump_directory = ""
It loads
This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies
with XCache v1.2.0, Copyright (c) 2005-2006, by mOo
But this doesn't work
zlib.output_compression On
max_execution_time = 30 ; Maximum execution time of each script, in seconds
max_input_time = 60 ; Maximum amount of time each script may spend parsing request data
memory_limit = 1M ; Maximum amount of memory a script may consume (8MB)
; Maximum allowed size for uploaded files.
upload_max_filesize = 8M
zend_extension = /ioncube/ioncube_loader_lin_5.2.so
[Zend]
zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension_ts=