DV HOWTO: Misc. performance tuning


Browse by products and services

  • Applies to: All DV
    • Difficulty: Easy
    • Time Needed: 10
    • Tools Required: SSH, root access, vi knowledge

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.

CAUTION

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.

READ ME FIRST

This article is provided as a courtesy. Installing, configuring, and troubleshooting third-party applications is outside the scope of support provided by (mt) Media Temple. Please take a moment to review the Statement of Support.

Symptoms:

  • Frequent Apache (httpd) crashes.
  • Slow server response.
  • "Server unreachable" errors.
  • There are "kmemsize warnings" in your QoS Alerts (Plesk Control Panel under Virtuozzo).

Solution

Limiting number of Plesk PSA connections

When you log into your Plesk administration panel, https://example.com: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

Next, 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:

For the DV server 3.5 server:

/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

For the DV server 4.0 server:

/usr/local/psa/admin/sbin/httpd_modules_ctl configtest

If your syntax is OK, you can then restart the Plesk webserver (gracefully) with:

/usr/local/psa/admin/sbin/httpd_modules_ctl 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 nameservers, we would strongly recommend skipping this section.


Since you are not running your own nameservers 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. More information is available: Enable or disable named (bind) on your DV.

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 with which you are comfortable. 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 servers 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