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 23rd April 2013, 17:20
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,177
Thanks: 829
Thanked 5,414 Times in 4,257 Posts
Default

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.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following 2 Users Say Thank You to till For This Useful Post:
darinpeterson (23rd April 2013), webmarker (27th April 2013)
  #8  
Old 25th April 2013, 20:03
darinpeterson darinpeterson is offline
HowtoForge Supporter
 
Join Date: Nov 2011
Posts: 153
Thanks: 35
Thanked 13 Times in 13 Posts
Default

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
Reply With Quote
  #9  
Old 26th April 2013, 17:53
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

That depends on your workload, but generally I#d want my server to have at least 4GB of RAM.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
The Following User Says Thank You to falko For This Useful Post:
webmarker (27th April 2013)
  #10  
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
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 00:02.


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