As an administrator, you’re always looking to make your servers even a little more efficient. Here are a few surprisingly minor tricks that’ll help you do just that.
A little tinkering can go a long way – especially in the world of server management.
As an administrator, you’re doubtless constantly on the lookout for ways you might improve and enhance your servers. After all, the more performance you can squeeze out of your current hardware, the better. Here’s the thing about that, though.
After a certain point, what more can you do? There are only so many extraneous files and utilities you can get rid of, and only so much you can upgrade your networking and server hardware. Eventually, you’ll have to start looking at the little things. And that’s where we come in.
I’m going to go over a few little tweaks that can result in big gains on your server – let’s begin!
Look At Your File Descriptor Limits
By default, Linux limits the number of file descriptors a process can open to 1024. The problem, of course, is that certain applications and platforms – httperf or Zeus for example – can’t perform optimally when subjected to such a limit. Ergo, it might be in your best interests to do away with this limitation.
Luckily, that’s easy to do. Just use the ulimit command. You can also type ulimit-aS to show your current limit, and ulimit-aH to show the hard limit for how much you can increase it.
Fiddle With ext3
By default, write-back operation in ext3 is disabled on most Linux distributions – primarily because it’s a feature that isn’t supported by older hard drives. Still, if your servers use relatively up-to-date hardware, modifying this setting can lead to a pretty big speed boost overall. Here’s how to do it:
- Open up etc/fstab in a text editor.
- Replace the line relatime, errors=remount-ro with noatime,nodiratime,errors=remount-ro,data=writeback
- Save and close your text file.
- Open a root terminal, and run update grub.
Do note that while it can result in better-performing hard drives, it also carries with it a minor risk of data loss in the event of a sudden disconnect.
Enable Kernel Samepage Merging
Introduced back in the 2.6.32 kernel, Kernel Samepage Merging (KSM) allows an application to merge its pages with other processes. This has a number of benefits, especially if you’re running guest virtual machines on your servers. Particularly in operating environments with a large number of similar processes – for example, if you’re running several VMs on a single machine – this can save a ton of memory.
All you need to do is open $ vim /sys/kernel/mm/ksm/run and change the value of 0 to 1.
Build A Better Server
Server efficiency’s something of a golden goose in the hosting space. The more you can do with your hardware, the better, right? And once you’ve gotten past the obvious tuning steps, it really is the little things that count.
What I’ve presented here really only scratches the surface. There are a ton of other tweaks and tricks you can apply to make your servers and systems run better. But what you’ve got here is enough to get you started.