Sometimes fate is not kind (or you’re simply adventurous) and you need/want to use a server that isn’t quite up to the task you have in mind. I was looking at some of my servers today and I realized that one hasn’t been scaling well- an old Gateway that I’ve been using for request tracking isn’t quite up to the task of a growing base of technicians and clients. I’ll most likely just migrate it to a newer machine (the easiest way to optimize server performance, if not the most technical)- but I wondered: What if I didn’t have that option? Suppose, for example, I’m renting a dedicated server and I don’t want to / can’t afford to shell out the money for the next step up in performance? I thought about some tricks I’ve had to use in my time, and I share them now with you as possible aids in getting that extra little bit of performance from your machine.
1) Disable all unneeded background programs and services!
This one seems, on the surface, to be a no-brainer. No one’s going to be compiling Apache or playing games on a dedicated webserver. If you have to do the former, do it on a different machine and copy them over(if you absolutely have to do the latter, well… I can’t help you there, I guess). There are more things, though, that you may not think to turn off! Suppose you’re running Linux: Do you need Samba? Do you need NFS? Do you need CUPS? Do you need sendmail? I’m not sure if all of these come with CentOS’ newest default server release, but I know some server distros start them up by default (If I recall correctly, Ubuntu server edition is guilty of at least the last three). Sometimes you can free up more memory than you think this way, and I once was able to free up 10MB just by disabling a bunch of unneeded services. Not much, but every little bit helps!
2) Make sure your server is used for only one purpose!
This might also seem to be a no-brainer on the surface, and it slightly follows from #1, but an astonishing amount of people make this mistake fairly often. One of the easiest ways to slow down a server is to make it a jack-of-all-trades; your poor web server will buckle to its its knees if its being used as a backup machine or imaging server too. Plan your machine purposes well so you don’t run into this problem! In my experience, it’s better to have two midlevel machines dividing work than one ultra-beefy machine handling everything (it also makes troubleshooting much less of a headache).
3) Look into optimizing tools for your software solutions
Many apps that server use on a daily basis have tweaks and tips of their own that you can use. Apache, for example, has sprung up a near-cult of people who are obsessed with squeezing each and every last drop of speed from their configs; here’s an example of a tame one. Not only does he mention my #1 and #2, he also has a slew of other nifty tricks for optimization. Windows users have options too; Microsoft is pretty good at providing articles like this one, comprehensive sets of documents that let you know precisely how to optimize IIS.
Whew! This one was a long one; hope you made it through. Sometimes it may seem that a server just isn’t scaling up. If you can’t afford to upgrade the hardware, consider trying some of these tricks above; it might just help you when you need it most!