HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=4)
-   -   Server easily goes out of memory (http://www.howtoforge.com/forums/showthread.php?t=61556)

webmarker 21st April 2013 16:44

Server easily goes out of memory
 
Hi I run Debian 6 with Apache. I'm in a vps with 1 gb RAM + 1 gb Swap and I noticed that is very easy to block all the services of the vps. It's enough to keep pressing CTRL+R for 1 minute in the home page of a fresh Joomla Installation to make freeze the whole vps for out of memory (it goes from 210 mb ram + 70 mb swap used, to 1015 mb ram + 1000 mb swap used). I dont think that's normal, how can I fix it? Should I use nginx?

webmarker 22nd April 2013 16:43

Also Clamav uses a lot of memory, since I dont use mailserver should I stop it? Do I need it?

webmarker 22nd April 2013 17:07

I've just monitored the processes during the holding of CTRL+R and it looks like that the systems creates a lot of php-cgi and apache2 processes and each one tries to take over 60% of ram. Any fix for this?

darinpeterson 22nd April 2013 20:29

Have you configured the VM yourself, or is the configuration provided by a hosting company?

Here are my container settings:
Code:

PHYSPAGES="0:586755"
SWAPPAGES="0:1173510"

KMEMSIZE="unlimited"
DCACHESIZE="unlimited"
LOCKEDPAGES="unlimited"
PRIVVMPAGES="unlimited"
SHMPAGES="unlimited"
NUMPROC="unlimited"
VMGUARPAGES="0:unlimited"
OOMGUARPAGES="0:unlimited"
NUMTCPSOCK="unlimited"
NUMFLOCK="unlimited"
NUMPTY="unlimited"
NUMSIGINFO="unlimited"
TCPSNDBUF="unlimited"
TCPRCVBUF="unlimited"
OTHERSOCKBUF="unlimited"
DGRAMRCVBUF="unlimited"
NUMOTHERSOCK="unlimited"
NUMFILE="unlimited"
NUMIPTENT="unlimited"

I'm pretty sure I could get it to run with only 1GB of memory... I run all services with no issues now, where physpages is available RAM, and swappages is 2X the actual allocated memory.

I adjusted the settings to:
Code:

PHYSPAGES="0:500000"
SWAPPAGES="0:1000000"

restarted the server, and the server is working fine...

This is what I used for my Debian 6 install: http://www.howtoforge.com/perfect-se...ot-ispconfig-3.

My hardware node runs CentOS 6.4, and only 4GB of RAM, where I run 3 OpenVZ virtual servers. Two name servers and the one that has the full configuration from the howto above.

webmarker 22nd April 2013 20:53

Quote:

Originally Posted by darinpeterson (Post 296196)
Have you configured the VM yourself, or is the configuration provided by a hosting company?

Here are my container settings:
Code:

PHYSPAGES="0:586755"
SWAPPAGES="0:1173510"

KMEMSIZE="unlimited"
DCACHESIZE="unlimited"
LOCKEDPAGES="unlimited"
PRIVVMPAGES="unlimited"
SHMPAGES="unlimited"
NUMPROC="unlimited"
VMGUARPAGES="0:unlimited"
OOMGUARPAGES="0:unlimited"
NUMTCPSOCK="unlimited"
NUMFLOCK="unlimited"
NUMPTY="unlimited"
NUMSIGINFO="unlimited"
TCPSNDBUF="unlimited"
TCPRCVBUF="unlimited"
OTHERSOCKBUF="unlimited"
DGRAMRCVBUF="unlimited"
NUMOTHERSOCK="unlimited"
NUMFILE="unlimited"
NUMIPTENT="unlimited"

I'm pretty sure I could get it to run with only 1GB of memory... I run all services with no issues now, where physpages is available RAM, and swappages is 2X the actual allocated memory.

I adjusted the settings to:
Code:

PHYSPAGES="0:500000"
SWAPPAGES="0:1000000"

restarted the server, and the server is working fine...

This is what I used for my Debian 6 install: http://www.howtoforge.com/perfect-se...ot-ispconfig-3.

My hardware node runs CentOS 6.4, and only 4GB of RAM, where I run 3 OpenVZ virtual servers. Two name servers and the one that has the full configuration from the howto above.

Hi thanks for your reply I'm on a vps and I dont think I can access those settings and I used the same tutorial as yours to setup my server. Do you have any problem running a cms like joomla and holding CTRL+R to refresh the page? Do you think that it could be a problem of my vps provider?

darinpeterson 23rd April 2013 15:31

Hi webmarker,

No, sorry. I don't run Joomla or any other form of CMS on the system. Even so, I highly doubt that it would lock up my system to refresh the page multiple times.

Best regards,
Darin

till 23rd April 2013 17:20

1GB Ram is not that much for a server that uses apache + mail and FTP server. Also the speed of the system depends on how many other vm's are running on the same hardware node, e.g. if the Harddisk IO is high because there are many other vm's running on the same node, then you might get problems like you described.

To protect your server against being overloaded, you can install mod_evasive.

To speed up php processes, ensure that you use php mode php-fpm or php-fastcgi and not cgi or suphp and install a php binary cache like apc or xcache.

darinpeterson 25th April 2013 20:03

Till,

If you have a minute to reply, can you please put your recommendation, based on your experience for a full server install without DNS but including mail, and for an install with everything except mail and DNS server?

Thanks,
Darin

falko 26th April 2013 17:53

That depends on your workload, but generally I#d want my server to have at least 4GB of RAM.

webmarker 27th April 2013 14:00

I installed nginx and now looks like that everything works fine. Is there a mod_evasive for nginx too? Or something similar?
I dont use mail server (I use just DNS+Web), should I uninstall clamav ? Do I need it? (it takes a lot of memory)


All times are GMT +2. The time now is 19:32.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.