Tips, Tutorials and Guides for your Virtual Private Server
In: Howtos
22 Jun 2009This is a guest post by Christopher Pace
As a freelance Linux consultant, many of my clients are often interested in making their VPS (Virtual Private Server) as responsive as possible. Since VPS servers by nature have somewhat limited system resources (often less than 1 GB of RAM), getting the best VPS performance can be a crucial part of running a successful server. To make matters worse, most clients assume that the VPS host has already optimized their server- which simply isn’t true (even Rackspace, a wonderful VPS host, doesn’t do this). Therefore, I’ve written this article as a brief introduction to some of the more common ways to get the best performance from a VPS.
Tip #1: Disable system services.
The top way to increase your VPS performance is to disable any system services that are not necessary. Services that are never used will still use up valuable RAM and CPU time, and also possibly allow your server to be attacked remotely. If you don’t need these services, why have them? Manage the startup scripts that start these services at boot time, and disable them.
Tip #2: Configure MySQL properly.
One of the more common ways to increase the available RAM (or to allocate more RAM to MySQL) is to configure the MySQL cache sizes. If your MySQL server instance is using too much memory, decrease the cache sizes. Likewise, if MySQL gets bogged down with large requests, increase the MySQL cache.
Tip #3: Configure Apache properly.
With Apache 2.0, many system administrators and clients alike have become confused as to the proper configuration of the Apache worker threads. Check how much memory Apache is using, and adjust the StartServers and MinSpareServers directives as needed to free up more memory.
Tip #4: Clean up your modules!
Without exception, there will always be modules or features that are enabled in memory hungry server software packages (such as Apache) that simply are not needed. Take a look at the configuration files for Apache, and decide if you need FrontPage support, or some of the other extra modules that ship with the VPS software packages. Disabling unnecessary modules or plugins will decrease the system memory that server software such as Apache requires, which will give you more resources for the software that needs it!
Tip #5: Disable control panels.
Let’s face it, everyone loves the more popular control panels, such as Cpanel, Plesk, Webmin, and phpMyAdmin. Heck, I’ve even written tutorials on how to use some of these control panel software packages. However, disabling these software packages frees up quite a bit of resources- sometimes as much as 120 MB of RAM! Sometimes the best solution is to disable these control panels until you actually need them- then they can be turned on via a PHP script (albeit somewhat insecure), or via a command entered at a shell prompt.
These 5 tips should decease the amount of RAM that your VPS uses by as much as 30-40%, which might save you quite a bit of money per month. Since most providers start out their VPS plans at systems with 256MB of RAM (and upgrades from there are expensive, often costing $40/month for an additional 256 MB), optimization of a VPS server is a crucial step. In addition, these 5 tips can be performed by a talented system administrator or consultant in typically less than two hours, which can mean a return on investment after only two or three billing cycles. What you do with the extra money saved is your business- you’ve earned it!
Christopher J. Pace is a freelance Linux consultant who has worked with Linux since 2001. Currently, he provides remote Linux consulting services for sick servers.
I've been using Virtual Private Servers for the past 11 years. I'd like to share these experiences here, so I'll be writing Tips, Tutorials, Guides and other helpful hints...
4 Responses to 5 Linux VPS Performance Tips
ZxVPS
September 10th, 2009 at 10:52 pm
Nice list of basic tasks, perhaps you could deal with the top tips in detail in a new article?
admin
September 11th, 2009 at 10:01 am
Mike, maybe I will. Thanks for your comment.
Mohamed
November 27th, 2009 at 12:32 pm
Please let us know any best VPS Linux server provider with providing all above 5 steps.
John
December 1st, 2009 at 10:19 pm
Another tip would be do NOT use apache if you lack memory and cpu power. Lightweight http daemons such as nginx and lighttpd are much more efficient than apache for static content at least and they handle application based ddos attacks a lot better cause of this.
However there are few downfalls, no native php support so you must run php in cgi mode, no .htaccess support (which is a feature IMO) and URL rewrites are different so research is required if you want to do advanced URL rewriting with either lighttpd or nginx.
Great post nonetheless, good job.