|Linux webserver - high memory usage|
400 Mb of 512 used!?
I'm sitting here running top on a RH 7.2 linux webserver I just got up live, this is what its telling me:
Mem: 513356K av, 414152K used, 99204K free, 72K shrd, 51700K buff
CPU usage is very low, and usage on the site is also very low at the moment, but I expect it to go up by considerable amount soon (hoping so anyway :)).
Being mainly a developer I don't know much about system administration and performance optimisation, but that doesn't look good to me....
Should I be alarmed about this?
If so does anyone have any ideas about how I can address the issue without just restarting the server?
thanks for any insight
On a healthy and active system, there's no "unused" RAM.
Linux (and probably any *nix system) will give each application the memory it requests, and then use the rest for disk caching. Depending on the reporting mechanism, you may indeed see a constant memory useage somewhere between 90 and 100%. If your web server gets more load and requests additional memory later, then the system will sync out some of the cached disk data and reallocate the gained space to the httpd.
Ah, so the memory is allocated, not actually used.
That makes me feel much better, many thanks for your quick response bird.
Damn I love this place :)
not actually used.
The memory is used for caching disk contents, which speads up the overall operation of the system. If a visitor requests a frequently requested page from your site, then this page is likely already present in that cache, which avoids time consuming disk accesses. The caching process is transparently managed by the system, so that no individual program needs to worry about anything.
Of course that doesn't mean that those chunks of memory aren't available for other purposes, when they are more urgently needed for a specific application. It's just a matter of not wasting any resources, and using them as efficiently as possible. A good system monitoring application will show you the seperate memory uses, btw. (eg. in different colors).
You didn't install all that RAM just for having it sit there doing nothing, did you? ;)
thanks for the clarification, I'll have a hunt around for a monitoring application
|You didn't install all that RAM just for having it sit there doing nothing, did you? |
- well I built the server and the website and got it up, but I don't want any users actually coming in and using up my system's precious resources! ;)
Thanks again bird, much appreciated.
Try "vmstat -w 1" and see if there is any swapping going on while your system is under considerable load.
If not, then you are fine as far as memory goes.