1

I have a site that users can listen to mp3 audios using a flash player. I have about 500 to 600 people visiting each day. The VPS specs are:

  • RAM 1024MB
  • Swap 2048MB
  • Disk 40GB

Here is a screenshot of my top command ordered by memory usage.

I am suprised that all my RAM is nearly gone. I thought my sort of site would use very little RAM and only be a strain on bandwidth. There isn't much else running on the server.

Is this normal for a site that has this low traffic to use so much RAM? Is there anything I can do to determine whats eating all this memory, if not normal?

Thanks all for any help

Abs
  • 1,429
  • 4
  • 18
  • 32

2 Answers2

3

You have about 204MB free, so you are only using about 80% of your memory. Don't forget to discount the cache/buffers.

Is it really just a flash player, or do you have some PHP/Perl/... code running? If you have some PHP code or something else running you are going to need to start working optomizing the software. Though it may be less expensive to simply buy more RAM.

You may need to take a long hard look at what apache modules you are actually using and see if you can cut it down to only the modules you need.

Zoredache
  • 128,755
  • 40
  • 271
  • 413
  • I notice I load of lot of apache modules I don't use. Will disable this. I have PHP running as well. The 2GB, isn't that just the SWAP file and not my actual RAM? – Abs Sep 23 '10 at 09:17
  • As Zoredache says don't rely on the figure in top - see what 'free' says. For a streaming site I'm surprised that the total memory usage is so **low** – symcbean Sep 23 '10 at 09:41
0

Well, your apache eats most of your mem. I suspect you load files you want to stream completely into RAM and poof there goes your RAM. Look hard at your application, there's the low hanging fruit for optimization (probably)

knitti
  • 700
  • 6
  • 9
  • How would apache load into memory? The audio is played by the flash player which has a direct link to the MP3 file, so apache wouldn't be involved that much? – Abs Sep 23 '10 at 09:16
  • PHP runs in Apache context. 40m far a single apache instance is very much. – knitti Sep 23 '10 at 12:07