Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 21st April 2013, 16:44
webmarker webmarker is offline
Junior Member
 
Join Date: Mar 2013
Posts: 12
Thanks: 4
Thanked 0 Times in 0 Posts
Default 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?
Reply With Quote
Sponsored Links
  #2  
Old 22nd April 2013, 16:43
webmarker webmarker is offline
Junior Member
 
Join Date: Mar 2013
Posts: 12
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Also Clamav uses a lot of memory, since I dont use mailserver should I stop it? Do I need it?
Reply With Quote
  #3  
Old 22nd April 2013, 17:07
webmarker webmarker is offline
Junior Member
 
Join Date: Mar 2013
Posts: 12
Thanks: 4
Thanked 0 Times in 0 Posts
Default

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?
Reply With Quote
  #4  
Old 22nd April 2013, 20:29
darinpeterson darinpeterson is offline
HowtoForge Supporter
 
Join Date: Nov 2011
Posts: 153
Thanks: 35
Thanked 13 Times in 13 Posts
Default

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.
Reply With Quote
The Following User Says Thank You to darinpeterson For This Useful Post:
webmarker (22nd April 2013)
  #5  
Old 22nd April 2013, 20:53
webmarker webmarker is offline
Junior Member
 
Join Date: Mar 2013
Posts: 12
Thanks: 4
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by darinpeterson View Post
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?
Reply With Quote
  #6  
Old 23rd April 2013, 15:31
darinpeterson darinpeterson is offline
HowtoForge Supporter
 
Join Date: Nov 2011
Posts: 153
Thanks: 35
Thanked 13 Times in 13 Posts
Default

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
Reply With Quote
  #7  
Old 27th April 2013, 14:00
webmarker webmarker is offline
Junior Member
 
Join Date: Mar 2013
Posts: 12
Thanks: 4
Thanked 0 Times in 0 Posts
Default

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)
Reply With Quote
  #8  
Old 27th April 2013, 22:38
darinpeterson darinpeterson is offline
HowtoForge Supporter
 
Join Date: Nov 2011
Posts: 153
Thanks: 35
Thanked 13 Times in 13 Posts
Default

For nginx mod_evasive, look here: http://stackoverflow.com/questions/4...sive-for-nginx

If you don't need mail, I recommend the following:

For step 10:
Code:
apt-get install mysql-client mysql-server openssl rkhunter

vi /etc/mysql/my.cnf  // comment out the bind line

/etc/init.d/mysql restart

netstat -tap | grep mysql
Skip step 11

And no need to install SquirrelMail, ignore step 18.

Good luck,
Darin

Last edited by darinpeterson; 27th April 2013 at 22:40. Reason: ignore squirrelmail, error
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
500 internal error after upgrade abintipl Installation/Configuration 9 18th July 2012 12:51
ISPConfig3 mail doesn't work Marr General 6 1st September 2010 09:32
Need some Hints to "The Perfect Server - Debian Lenny (Debian 5.0) [ISPConfig 3]" wahid HOWTO-Related Questions 10 25th August 2010 15:18
amavis & ispconfig 3 yalex2000 Installation/Configuration 20 18th February 2010 17:02
Rejecting outbound mail tristanlee85 General 11 20th May 2007 17:04


All times are GMT +2. The time now is 21:07.


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