Limit Plesk Memory Usage
Force Plesk to use less memory by adding an options file.
vi /usr/local/psa/admin/conf/httpsd.custom.include
Add the following lines to the file:
MinSpareServers 1
MaxSpareServers 1
StartServers 1
MaxClients 5
PHP install Xcache
go to directory
cd /usr/src
Ensure you have the packages to build from source:
yum install php-devel
yum groupinstall 'Development Tools'
yum groupinstall 'Development Libraries'
Download the latest:
wget http://xcache.lighttpd.net/pub/Releases/1.3.0/xcache-1.3.0.tar.gz
UNzip:
tar xvfz xcache-1.3.0.tar.gz
Enter Directory:
cd xcache-1.3.0
This is a possible change you would need to make if the "make" command provides an error on "timelib_structs.h":
nano /usr/include/php/ext/date/lib/timelib_structs.h
change #include <timelib_config.h> to #include "timelib_config.h" (or
vice versa)
or #include "/usr/include/php/ext/date/lib/timelib_config.h"
phpize
./configure --enable-xcache
make
make install
cp xcache.ini /etc/php.d
nano cp xcache.ini /etc/php.d
[xcache-common]
zend_extension = /usr/lib64/php/modules/xcache.so
[xcache.admin]
xcache.admin.enable_auth = On
xcache.admin.user = "admin"
xcache.admin.pass = md5($your_password)
[xcache]
xcache.shm_scheme = "mmap"
xcache.size = 16M
; set to cpu count (cat /proc/cpuinfo |grep -c processor)
xcache.count = 4
; just a hash hints, you can always store count(items) > slots
xcache.slots = 8K
; ttl of the cache item, 0=forever
xcache.ttl = 0
; interval of gc scanning expired items, 0=no scan, other values is in seconds
xcache.gc_interval = 0
; same as aboves but for variable cache
xcache.var_size = 16M
xcache.var_count = 4
xcache.var_slots = 8K
xcache.var_ttl = 0
xcache.var_maxttl = 0
xcache.var_gc_interval = 300
xcache.test = Off
; N/A for /dev/zero
xcache.readonly_protection = On
xcache.mmap_path = "/dev/zero"
xcache.coredump_directory = ""
; per request settings
xcache.cacher = On
xcache.stat = On
xcache.optimizer = Off
[xcache.coverager]
; per request settings
; enable coverage data collecting for xcache.coveragedump_directory and xcache_coverager_start/stop/get/clean() functions (will hurt executing performance)
xcache.coverager = On
; ini only settings
; make sure it's readable (care open_basedir) by coverage viewer script
; requires xcache.coverager=On
xcache.coveragedump_directory = ""
make sure that the folder /tmp/xcache is writable by php
if you like copy the xcache admin folder to the domain that has PHP enabled
create a phptest file
echo "<?php phpinfo(); ?>" > /var/www/html/phpinfo.php
cp -pR /var/opt/xcache-1.3.0/admin /var/www/vhosts/domain.com/subdomains/name/httpdocs
php -v
PHP 5.1.6 (cli) (built: Apr 7 2009 08:00:18)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
with the ionCube PHP Loader v3.1.28, Copyright (c) 2002-2007, by ionCube Ltd., and
with XCache v1.3.0, Copyright (c) 2005-2009, by mOo
References: