I'm trying to tune my Linode 360 to be somewhat memory efficient, but I'm not sure if I'm allocating memory in the best way possible.
My Linode runs sshd, Postfix, openvpn, squid, nginx, php-(fast)cgi, and mysql. My site is lightly loaded, and consists primarily of image hosting using Gallery2.
My memory graphs are here:
http://mikeage.net/munin/mikeage.net/li ... emory.html
ps auwx reports the main users of memory as (everything before this is using less than 10MB of RSS):
Code:
$ ps awux --sort:rss | tail -n 5
proxy 11221 0.0 5.0 42196 17756 ? S Jan28 1:55 (squid) -D -YC
www-data 26656 0.1 9.5 310376 33556 ? S 09:29 0:02 /usr/bin/php-cgi -q -b localhost:9000 -c /etc/php5/cgi/php.ini
www-data 26240 0.0 10.1 312660 35780 ? S 09:18 0:01 /usr/bin/php-cgi -q -b localhost:9000 -c /etc/php5/cgi/php.ini
www-data 18987 0.1 10.5 313048 37260 ? S 07:06 0:11 /usr/bin/php-cgi -q -b localhost:9000 -c /etc/php5/cgi/php.ini
mysql 25907 0.8 28.8 278908 101960 ? Sl Jan27 57:27 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-external-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
MySQL seems to be tuned quite well; mysqltuner and tuning-primer.sh are both happy, and all of my queries (>99.99%) are handled within 1 second.
I have vm.swappiness set to 10.
I'm trying to decide whether or not I should run more php instances. I don't really need it to handle the load, but some gallery operations can take a few seconds to process, and I like to be able to open many tabs at once, without worrying about a gateway timeout.
If I sum up the RSS values, I usually get something like:
Code:
$ ps auwx --sort:rss | awk 'BEGIN { TOTAL = 0} {TOTAL+=$6} END { print TOTAL }'
353248
The total varies between 295000 and 370000. My PHP processes are using the APC cache, with a 36MB cache allocated (
http://mikeage.net/content/apc.php). I assume this should be shared between all of the PHP instances, but I'm not sure where I'd see it in ps.
Any advice?