LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-12-2012, 07:11 AM   #1
SeSoX
LQ Newbie
 
Registered: Aug 2009
Posts: 18

Rep: Reputation: 0
Linux VPS using up all available RAM


Hi there,

I've got a vps online and I'm using apache + lighttpd for two websites on the internet. The problem is that apache seems to be using all the ram on the server which is 512MB.

The websites don't really have millions of visitors so I'm wondering if it maybe because of a misconfiguration issue in apache ? I don't know but with not many users it looks weird to me that apache is using so much ram.

Can anybody give me a hand with this ?

Thanks
 
Old 07-12-2012, 07:36 AM   #2
zordrak
Member
 
Registered: Feb 2008
Distribution: Slackware
Posts: 595

Rep: Reputation: 116Reputation: 116
Can you provide some detailed RAM usage info?

To be honest with only 512MiB RAM I'm not totally surprised. You haven't mentioned which distro it is - some are configured to be much more RAM hungry than others by default and it's possible you have other system services running that you've no need for sitting in the background hogging extra space.

If apache really is using all that RAM then I would definitely start looking at your apache config - but also what else you may be using. Any PHP code? What's php been told about memory usage? etc.
 
Old 07-12-2012, 07:39 AM   #3
snowday
Senior Member
 
Registered: Feb 2009
Posts: 4,667

Rep: Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411
Please provide the output of:

Code:
free -m
(use code tags to make it legible, please)
 
Old 07-12-2012, 09:32 AM   #4
SeSoX
LQ Newbie
 
Registered: Aug 2009
Posts: 18

Original Poster
Rep: Reputation: 0
Thanks for the reply guys

The system is debian and here is a copy paste from top:

Quote:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
870 www-data 20 0 185m 14m 3892 S 3 2.9 0:00.94 apache2
724 www-data 20 0 189m 18m 4328 S 2 3.6 0:05.98 apache2
857 www-data 20 0 187m 17m 3880 S 2 3.3 0:00.67 apache2
806 www-data 20 0 190m 19m 4000 S 2 3.8 0:02.87 apache2
869 www-data 20 0 186m 15m 3660 S 2 3.1 0:00.81 apache2
And free sais:

Quote:
root@vps:~# free -m
total used free shared buffers cached
Mem: 512 185 326 0 0 108
-/+ buffers/cache: 76 435
Swap: 0 0 0

It seems that there were many users making request to apache at the same time and that's why it used all the ram, and it's not the first time, how can I fix this so it doesn't happen again, maybe with apache ?
 
Old 07-12-2012, 09:45 AM   #5
snowday
Senior Member
 
Registered: Feb 2009
Posts: 4,667

Rep: Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411
More RAM and/or swap is my recommendation if your existing RAM is not sufficient to handle peak traffic. 512mb is on the small side, in my opinion.

That being said the data you posted above shows you have 435mb free. For help interpreting these numbers: http://linuxatemyram.com

Last edited by snowday; 07-12-2012 at 09:47 AM.
 
Old 07-12-2012, 09:52 AM   #6
SeSoX
LQ Newbie
 
Registered: Aug 2009
Posts: 18

Original Poster
Rep: Reputation: 0
in the previous message I meant that maybe it could be fixed with iptables ? (not with apache xD)

What happened could be considered more like a DoS attack than a peak really.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: 9+ Million hits per day on a 512 Mbtyes RAM VPS running Wordpress LXer Syndicated Linux News 0 05-02-2012 10:30 AM
VPS CentOS5 iscsiuio Using up ram MartinPrestovic Linux - Server 0 03-13-2012 03:43 PM
[VPS] 4 load page = 100 MB RAM loaded? do i need 100x 400 mb ram for next 400 page? vaporizel Linux - Server 1 03-14-2011 08:40 PM
RAM full after dist-upgrade, apache2, php, mysql installation on a VPS motiongrafika Linux - Server 5 01-31-2010 11:18 PM
High load, high RAM usage and unresponsive VPS saeed22 Linux - Server 1 08-20-2009 11:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration