Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am having an issue where the RAM on the virtualised machine is becoming exhausted after periods of time, the machine itself has 4GB RAM assigned to it and it always seems to be reporting around 15% usage but for some reason it keeps crashing PHP and the machine just stops responding. The only thing I can do is restart the hyper-v instance.

The setup

  • Windows 2008 Hyper-V
  • Host machine has 8GB RAM
  • Client machine has 4GB RAM
  • CentOS 6.4
  • Approx 10 websites hosted on the VM, 2 of them medium / high traffic, the rest low

We have cPanel installed which sends this email at the time of the error,

Memory Information:

Used: 3616MB
Available: 123MB
Installed: 3727MB 

Load Information:

368.82 384.07 328.93

We set this up as a favour to the client really, we normally only deal with Windows boxes but they needed to be able to host Wordpress (which I believe runs better on Linux) and some .net web services. Hence why Windows and CentOS.

When opening the Hyper-V console for the instance, the error is "Out of memory". I know this sounds obvious but I really cannot believe that a few sites are consuming 4GB of RAM and especially when the average running percentage is at 15%.

I have installed New Relic now as a server monitor and that is reporting averages of 15% RAM usage. Below are the results of top and free -m though which look a little different.

top

  • Total - 3817280k
  • Used - 2874372k
  • Free - 982808k
  • Buffers - 257284k

free -m

  • Total - 3727
  • Used - 2697
  • Shared - 0
  • Buffers - 251
  • Cached - 2037

Does anyone have any idea what the underlying problem would be? I could just assign a couple more GB RAM to the client but I don't know if that is going to solve the problem for good or just delay it?

share|improve this question
    
Looks like you have The XY problem. Your RAM looks fine, so you need to be looking into the outrageous load average and the PHP crashes instead. –  Michael Hampton May 22 '13 at 21:02
    
Well I would be inclined to agree yet the operating system error I am receiving is "Out of memory: Kill process x (php) score 8 or sacrifice child". I think the load issues are a result of some type of loop the system is getting itself into trying to kill the process? –  Chris Lomax May 22 '13 at 21:16
    
OK, well you ran out of memory at some point, but it isn't apparent from the stats you gave for top and free which show plenty of memory available. Anyway, look carefully at your web server configuration and the running processes. –  Michael Hampton May 22 '13 at 21:18
    
@ChrisLomax: You're confusing backed memory with RAM. You ran out of backed memory, which is a problem. You're giving us RAM statistics, which is not helpful, since RAM is not the issue. However, you did give us the load average, which makes it clear what the issue is -- too many processes consuming too much CPU, too much I/O, or both. (You ran out of backed memory because work built up in backed memory due to the CPU/IO slowdown. Or something broken is just creating lots of work/processes.) –  David Schwartz May 22 '13 at 21:50
    
Thanks @DavidSchwartz and Michael Hampton. The top and free -m I am providing is not from the time of the issue unfortunately, I was just trying to give a scale of what is in the system and whether the information provided could help at all. The annoying thing is, I haven't really done anything special with this system, I installed CentOS, installed cPanel and then setup the sites. I installed cPanel for the very reason of me not having to install MySQL etc. I did notice the other day the system spiking with a lot of processes from PHP then dropping again? I'm stumped! –  Chris Lomax May 23 '13 at 7:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.