(dv) HOWTO: Misc. performance tuning
OVERVIEW:
This article will provide further ways to optimize your (dv). The objective of this article is to make configuration changes that will allow your (dv) server to run with less memory / resources, and to ensure higher availability under heavier loads.
WARNING:
It is strongly recommended that you ensure your server is functioning properly after making the changes within each section. This could help you determine the source of any potential issues, should they arise
This is Part 3 of a series of articles on how to tune your (dv) for better performance. Please see (dv) HOWTO: Performance tuning (Optimization) for additional articles in this series.
Symptoms:
- Frequent Apache (httpd) crashes
- Slow server response
- "Server unreachable" errors
- kmemsize warnings in your QoS Alerts (Plesk Control Panel under Virtuozzo)
DETAILS:
Limiting number of Plesk PSA connections
When you login to your Plesk administration page, :8443, you're accessing a special web server over SSL. This web server process is httpsd, and it's larger than the stock httpd process that serves your web content.
To reduce its memory usage, you can reduce the number of processes it spawns, thus usually freeing up 10-60 MBs.
The "Plesk-safe" way to do this is to create a new file using the VIM editor via ssh:
vi /usr/local/psa/admin/conf/httpsd.custom.include and add the following overrides:
MinSpareServers 1
MaxSpareServers 1
StartServers 1
MaxClients 5
This reduces the number of Plesk processes (httpsd) that are running to a minimum.
NOTE:
If you have numerous users accessing their Plesk Control Panel, they may run into login problems and sluggish behavior if you reduce the number of servers by too much. In general Plesk is not used very often, so spawned servers can be set lower than the default value.
Before restarting the web server you can safely run a test to check that your settings are valid by running the following command:
/usr/local/psa/admin/bin/httpsdctl configtest If your syntax is OK, you can then restart the Plesk webserver (gracefully) with:
/usr/local/psa/admin/bin/httpsdctl graceful
Disable DNS Services
NOTE:
The following section ONLY applies if you are using the DNS services provided by (mt) Media Temple. If you are using your own name servers we would strongly recommend skipping this section.
Since you are not running your own name servers on your (dv) you can safely turn off the "named" service which consumes as much as 50 MBs of memory.
Type the following command in your SSH session:
/etc/init.d/named stop To disable it permanently remove execution permissions from the named script by typing
chmod 644 /etc/init.d/named You can always add it back by changing 644 to 755.
Disable SpamAssassin
SpamAssassin is a service that filters for spam on incoming mail. Each instance can use as much as 20 MBs per process. If you choose to run spam protection via your email client you can gain that memory back for other applications to use. We have found that most client-side filtering provides similar protection so this redundancy is not needed in most cases.
NOTE:
Turning off SpamAssassin may significantly increase the amount of spam that your email accounts receive. You will have to decide for yourself if this is a trade-off that you are comfortable with. To help further prevent spam we strongly suggest disabling any "catch-all" email addresses and enabling "reject emails to non-existent users" in the Mail section under Clients >> Domains >> Mail in Plesk.
Type the following command in your SSH session:
/etc/init.d/psa-spamassassin stop To disable it permanently, run the following command by typing
chmod 644 /etc/init.d/psa-spamassassin You can always add it back by changing 644 to 755.
Disable Watchdog
NOTE:
By default our (dv)'s have Watchdog disabled.
Watchdog is an application that monitors the services on your (dv) server for security issues and availability. When Watchdog is running it spawns off several processes that can consume a lot of memory. We have found that running Watchdog can actually cause instabilities with some servers.
It is our recommendation to not use this module. If you need a monitoring solution you may want to look for an off-site option. Our newer servers are not provisioned with watchdog installed. If you have an older server and would like to remove watchdog you can run the following command via ssh as root to remove the watchdog package.
rpm -e psa-watchdog
Thanks to David Seah for tracking down and researching much of this article and agreeing to share his findings. http://davidseah.com/
Revisions:
03-05-2009: Added instructions on how to remove watchdog.
Fields marked with an asterisk(*) are required. Comment on this article