1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Decreasing memory footprint on Ubuntu.

Discussion in 'Plesk 9.x for Linux Issues, Fixes, How-To' started by MartijnL, Nov 22, 2011.

  1. MartijnL

    MartijnL Guest

    I'm having memory issues with Plesk 9.5.4 in a Virtuozzo container (can't find version) on Ubuntu (Linux 2.6.18-028stab070.14).

    It's a small virtual server with 256MB soft limit on memory and 512 hard limit.
    The server is hosting 5 sites (4 CMSMS based, 1 Wordpress based) with low traffic.
    Wordpress requires >32MB memory in php.ini in order to run the backend, so I've set it to memory_limit=40M.
    By default, Plesk is configured to run upto 10 instances of Apache (from maxclients setting in /etc/apache2/apache2.conf) and with each eventually using some 40MB, I'm quickly running out of memory.

    The simplest solution seems to be to just limit the number of instances to 4 or 5; traffic is low enough on these sites that 4 is probably still more than it needs, but after a few hours of googling, I still haven't figured out how to change it. Plenty of ideas on how to do it with centos, but /etc/httpd doesn't exist on Ubuntu, nor can I find an swtune.conf file.

    Possibly there are other optimizations, like somehow configuring Apache to release memory after a certain period of inactivity or otherwise?

    I'm thankful for any answer.
    kind regards,
  2. paulieG

    paulieG Regular Pleskian

    Mar 5, 2009
    Likes Received:

    I'm confused, you can limit the number of processes using MaxClients and ServerLimit in the file you mentioned : /etc/apache2/apache2.conf

    Its not ideal however as it may get overwritten by Plesk or apt-get at a later date, a better method would be to find the directory used to host the smaller apache configuration files (it's usually listed as an include at the bottom of /etc/apache2/apache2.conf and its probably /etc/apache2/conf.d) and paste in a copy of the prefork configuration from apache2.conf and make your changes there.

    Also, if you're willing to make the effort I'd strongly recommend you work out how to get Nginx setup as a reverse proxy in front of Apache, that will most likely fix all your problems.

  3. MartijnL

    MartijnL Guest

    I've found the solution, thanks to your tip of looking for a suitable include in /etc/apache2/apache2.conf.

    According to the apache2.conf file, a /etc/apache2/httpd.conf file may optionally be included explicitely for "all the user configurations".

    I've set up my server to preserve a little bit more memory by following http://onlamp.com/pub/a/onlamp/2004/02/05/lamp_tuning.html and a little common sense thinking.
    After /usr/local/psa/admin/sbin/websrvmng --reconfigure-all, everything seems to respond as I configured it.

    Wordpress' admin backend still seems to be a huge memory hog, but atleast memory usage is more under control now.