Friday, January 4, 2019

Server Memory Usage VERY high on new linux dedi box - How to find the issue?



I have recently aquired a dedicated server running CentOS and Plesk for my applications.




These scripts were running on a 1.5GB ram VPS running CentOS and CPanel and worked very well.



Now they are on the new dedicated server the memory has gone down from 14.1 GB ram spare to 9.9GB. I can't see it being my scripts so presume there is something else using all my memory. How can I see what is eating all the resources?



Note: The only difference between these servers (from my point of view) is my crons were being checked every 5 minutes on the old server whereas now they are checked every minute and there are about 60 of them.



This is the information from "free" via SSH - Although, I am not entirely sure what its telling me:



[root@h31-3-244-194 ~]# free

total used free shared buffers cached
Mem: 16426796 9373260 7053536 0 390468 3471680
-/+ buffers/cache: 5511112 10915684
Swap: 18481144 0 18481144


EDIT: I have looked against all my cron processes and they have this: bin/qmail-queue against them. Could qmail be eating the memory?



If I have omitted some required information, please let me know.




Thanks.


Answer



I dug deeper and deeper using this command:



ps -eo size,pid,user,command --sort -size | awk '{ hr=$1/1024 ; printf("%13.2f Mb ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",\$x) } print "" }'


which listed all the processes on my server and how much memory they were taking. This then told me that qmail was spamming me with messages. I don't need qmail so have removed it. Server has gone from growing to 100% ram usage to sitting at 6% ... I don't hate linux so much now xD



Thanks to Kyle Smith for the comments and explanation on memory but I need to mark this as the answer because it explains the exact reason my scripts were using more memory on this server.



No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...