There are lots of posts that talk about tuning apache and mysql to improve linode performance, but not so much is mentioned about what else can be done tuned to get the most out of your linode. Below are a list of things that I've done to get the most out of my node (an 80) posted here in the hopes other people might find it useful.
The first thing thing is remove bloat. Removing uneeded modules and such from apache are an obvious step, but what about ssh, dns, and other services? Often overlooked, but all areas that can be tuned.
Firstly, unless you have a reason to use openssh's sshd look at alternatives. dropbear is a great alternative and uses up about half of the memory that the openssh daemon does. Sample ps listings from dropbear and sshd:
dropbear:
Code:
PID TTY STAT TIME MAJFL TRS DRS RSS %MEM COMMAND
1013 ? Ss 0:00 0 111 1776 432 0.5 /usr/sbin/dropbear -d /etc/dropbear/dropbear_dss_host_key -r /etc/dropbear/dropbear_rsa_host_key -p 22
11195 ? Ss 0:00 0 111 2076 952 1.1 /usr/sbin/dropbear -d /etc/dropbear/dropbear_dss_host_key -r /etc/dropbear/dropbear_rsa_host_key -p 22
sshd:
Code:
PID TTY STAT TIME MAJFL TRS DRS RSS %MEM COMMAND
27192 ? Ss 0:02 16 274 3433 900 0.1 /usr/sbin/sshd
9420 ? S 0:00 27 274 6225 1948 0.4 sshd: xxx@pts/11
*Note %MEM listings are not comparable between dropbear and sshd, they are from different machines with different amounts of memory (dropbear: 80M, sshd: 512M)
The next thing worth looking at is your DNS, if you run one. Consider running djbdns over bind. I do not have a machine to run a test setup of bind on so I don't have real world numbers to show you here to prove djbdns is better, however, I supply a listing of a djbdns setup and a link to an article comparing bind and djbdns.
tinydns (x2)/dnscache/axfrdns:
Code:
PID TTY STAT TIME MAJFL TRS DRS RSS %MEM COMMAND
1411 ? S 0:00 1 12 1367 304 0.3 supervise tinydns
1413 ? S 0:00 1 12 1371 308 0.3 supervise tinydns2
1415 ? S 0:00 0 12 1371 304 0.3 supervise dnscache
1423 ? S 0:00 1 12 1371 304 0.3 supervise axfrdns
1425 ? S 0:00 10 20 1611 384 0.4 /usr/bin/tinydns
1428 ? S 0:00 8 20 1611 380 0.4 /usr/bin/tinydns
1429 ? S 0:00 2 46 2765 1588 1.9 /usr/bin/dnscache
1430 ? S 0:00 0 36 1367 312 0.3 tcpserver -vDRHl0 -x tcp.cdb -- x.x.x.x 53 /usr/bin/axfrdns
Bind vs djbdns:
http://www.rh.edu/~rhb/cs_seminar_2005/ ... eniger.pdfFTP daemons. I don't have a complete list of the various daemons to compare with, but here is a comparison of memory usage for vsftpd vs proftpd:
proftpd:
Code:
PID TTY STAT TIME MAJFL TRS DRS RSS %MEM COMMAND
4742 ? Ss 0:00 8 752 3871 2376 0.4 proftpd: (accepting connections)
4775 ? S 0:00 127 752 4095 3052 0.6 proftpd: xxx - xxx.linux.bogus: IDLE
vsftpd:
Code:
PID TTY STAT TIME MAJFL TRS DRS RSS %MEM COMMAND
5011 ? Ss 0:00 236 87 3276 916 0.1 /usr/sbin/vsftpd
5024 ? Ss 0:00 134 87 3400 1272 0.2 /usr/sbin/vsftpd
Other notes worth making. Spamassassin will NOT behave nicely on a linode80. No how, no way. This doesn't mean you have to abandon all spam filtering, though. So what can you do? Consider using RBL's. These are a low overhead and help immensely. Also, it is still possible to run a virus scanner, even on a linode80 provided your email server is not extremely busy. On my node I've got clamd running fine and per email scans take about .5s through the RBL and virus scan.
Also, ask yourself if you really need to be running apache? There are alternatives such as lighttpd that use a significantly smaller footprint and will work perfectly well in many situations.
One last thing I will mention is, if you are serving PHP websites, consider using a cacher like eAccelerator. Even on a non-overloaded linode the load times were noticeably faster with eAccelerator compared to without.
If there's any other services that someone would like to see tuning info for, just post a reply. At first I started this as a way to get my linode running as best I could, but now it's become fun tweaking everything to get the best performance so I'd be more than happy, free time willing, to explore other areas.