Sunday, August 7, 2016

vps - Multiple instances of HTTPD running, and virtual memory constantly running out?



I've noticed my VPS behaving weird today. I have set it up as a web server (along with MySQL, PHP, FTP etc) and at the moment there is only one website running on there. I noticed earlier today that the website would loose connection to the database intermittently, and would also fail to load at all.




I opened Webmin and when it eventually loaded (it took a while) it reported back that the CPU usuage for I/O was 100%, and that 125.39MB of the 125.47MB Virtual RAM was used up. I reset the VPS and after it came back online, the CPU read that it was running at 100% Idle and that 0KB of RAM was being used.



After 1 hour 44 minutes, the server now says that I'm using 7.36MB of RAM. It also says that I have 66 processes running, and on looking at that I have 9 instances of httpd service running.



I'm thinking that the httpd services are eating up the RAM and CPU (each instance is reporting that it's using roughly 330000KB of RAM). As I only have one website running on the server (and one instance of Webmin) shouldn't I expect to see only one instance of httpd running? Or is this normal?



If the multiple instances of httpd aren't the problem, what else could be causing these issues?



EDIT:
The processes listed by CPU usage are:




ID      Owner       CPU     Command   
2401 root 1.3 % /usr/libexec/webmin/proc/index_cpu.cgi
1 root 0.0 % /sbin/init
2 root 0.0 % [kthreadd]
3 root 0.0 % [migration/0]
4 root 0.0 % [ksoftirqd/0]
5 root 0.0 % [watchdog/0]
6 root 0.0 % [events/0]
7 root 0.0 % [cpuset]
8 root 0.0 % [khelper]

9 root 0.0 % [netns]
10 root 0.0 % [async/mgr]

The processes by RAM are:
1034 mysql 444648 kB /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --log-e ...
1156 apache 334512 kB /usr/sbin/httpd
1157 apache 333728 kB /usr/sbin/httpd
1161 apache 333728 kB /usr/sbin/httpd
1136 root 319352 kB /usr/sbin/httpd
1158 apache 319352 kB /usr/sbin/httpd

1159 apache 319352 kB /usr/sbin/httpd
1160 apache 319352 kB /usr/sbin/httpd
1162 apache 319352 kB /usr/sbin/httpd
1163 apache 319352 kB /usr/sbin/httpd
882 root 248576 kB /sbin/rsyslogd -c 4
1144 root 117072 kB crond
1960 root 108212 kB -bash
945 root 108076 kB /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/var/lib/mysql/my ...
1957 root 97456 kB sshd: root@pts/0
2486 root 67068 kB /usr/libexec/webmin/proc/index_size.cgi

1164 root 64152 kB /usr/bin/perl /usr/libexec/webmin/miniserv.pl /etc/webmin/miniserv.conf
2489 root 64152 kB /usr/bin/perl /usr/libexec/webmin/miniserv.pl /etc/webmin/miniserv.conf
909 root 63756 kB /usr/sbin/sshd
1135 postfix 62220 kB qmgr -l -t fifo -u
2062 postfix 62048 kB pickup -l -t fifo -u
1126 root 61968 kB /usr/libexec/postfix/master
1 root 19112 kB /sbin/init
2498 root 11208 kB sh -c ps --cols 2048 -eo user:80,ruser:80,group:80,rgroup:80,pid,ppid,pgid,pcpu, ...
2499 root 11092 kB ps --cols 2048 -eo user:80,ruser:80,group:80,rgroup:80,pid,ppid,pgid,pcpu,vsz,ni ...
358 root 10860 kB /sbin/udevd -d

615 root 10856 kB /sbin/udevd -d
894 root 3988 kB /usr/sbin/acpid
1172 root 3984 kB /sbin/agetty /dev/ttyS0 9600 vt100-nav

Answer



I tracked down the problem to Webmin running. I've left the Webmin service off all night and the RAM usage is under control now. I have now since deleted Webmin and using ISP Config 3 instead. Again, the RAM usage is incredibly good now.


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...