• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Decreasing memory footprint on Ubuntu.

M

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,
Martijn
 
Hi,

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.

Paul.
 
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.
 
Back
Top