Hi all. I have a basic question i am getting a lot of spin on. Looking at this output from top it would seem obvious that this server is overloaded seeing how it has 0 cpu load and 95% memory usage. My admin told me its fine because it has quite a bit of cache.
Cpu(s): 0.0%us, 0.0%sy, 0.0%ni, 99.8%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st Mem: 6105732k total, 5769024k used, 336708k free, 97040k buffers Swap: 2031608k total, 24744k used, 2006864k free, 1368728k cached
I can understand that the cache can be freed easily if needed but the basic poll I am trying to take is. Is this server ok or not and how best to reply to the "it has cache" answer if not.
cut & paste this and amend catalina.sh file:
JAVA_OPTS="-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms1536m -Xmx1536m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+DisableExplicitGC"
That will solve your problem.
answered 01 Feb '13, 12:32
At first sight, the server seems to be ok. Those numbers mean that 1368728k of the RAM (~1,4G) are used for cache and barely 24744k (24m) are swaped.
If those numbers are stable, and If you java aplication wont use any other resources (i.e. some CMS like liferay/alfresco make use of ImageMagick, OpenOffice, Xugler etc that can eat server's resources) the server will be fine most of the time (except for maybe some cron jobs)
But, actually, with only those numbers is not quite easy to guess a right answer. is Tomcat taking all the memory it has assigned? is there any other service in the machine, like apache or a db? If you have CPU at 0.0, it seems that you don't handle much traffic. The server could be ok now, and suffocate with the first uses of the app.
You can always lower your tomcat's memory use, and you'll gain stability, follow @ericorj 's answer to do so. For a production server, would be a nice idea to have more resources available.
answered 16 Mar '13, 09:50