cpu and memory overload. too many /usr/sbin/apache2 -k start

June 30, 2015 6.9k views
WordPress Apache

I have a Ubuntu 14.04.2 LTS (GNU/Linux 3.8.0-29-generic x86_64) server with a dozen sites on it.

So all of a sudden my server starts crashing again after months of stability. Result of ps aux shows many /usr/sbin/apache2 -k start

I tried to change the code in the apache2.conf file to limit this
<IfModule mpm_prefork_module>
StartServers 8
MinSpareServers 4
MaxSpareServers 8
MaxClients 40
MaxRequestsPerChild 0
</IfModule>
but it doen't work

Can anyone help me? My cpu is now around 90% and memory also. And I leave on holyday on saturday so this is a really bad timing!

tnx!

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 1.1 0.0 33468 1080 ? Ss 15:04 0:01 /sbin/init
root 2 0.0 0.0 0 0 ? S 15:04 0:00 [kthreadd]
root 3 0.0 0.0 0 0 ? S 15:04 0:00 [ksoftirqd/0]
root 4 0.0 0.0 0 0 ? S 15:04 0:00 [kworker/0:0]
root 5 0.0 0.0 0 0 ? S< 15:04 0:00 [kworker/0:0H]
root 6 0.0 0.0 0 0 ? S 15:04 0:00 [kworker/u:0]
root 7 0.0 0.0 0 0 ? S< 15:04 0:00 [kworker/u:0H]
root 8 0.0 0.0 0 0 ? S 15:04 0:00 [migration/0]
root 9 0.0 0.0 0 0 ? S 15:04 0:00 [rcubh]
root 10 0.2 0.0 0 0 ? S 15:04 0:00 [rcu
sched]
root 11 0.0 0.0 0 0 ? S 15:04 0:00 [watchdog/0]
root 12 0.0 0.0 0 0 ? S 15:04 0:00 [watchdog/1]
root 13 0.0 0.0 0 0 ? S 15:04 0:00 [ksoftirqd/1]
root 14 0.0 0.0 0 0 ? S 15:04 0:00 [migration/1]
root 15 0.0 0.0 0 0 ? S 15:04 0:00 [kworker/1:0]
root 16 0.0 0.0 0 0 ? S< 15:04 0:00 [kworker/1:0H]
root 17 0.0 0.0 0 0 ? S< 15:04 0:00 [cpuset]
root 18 0.0 0.0 0 0 ? S< 15:04 0:00 [khelper]
root 19 0.0 0.0 0 0 ? S 15:04 0:00 [kdevtmpfs]
root 20 0.0 0.0 0 0 ? S< 15:04 0:00 [netns]
root 21 0.0 0.0 0 0 ? S 15:04 0:00 [bdi-default]
root 22 0.0 0.0 0 0 ? S< 15:04 0:00 [kintegrityd]
root 23 0.0 0.0 0 0 ? S< 15:04 0:00 [kblockd]
root 24 0.0 0.0 0 0 ? S< 15:04 0:00 [atasff]
root 25 0.0 0.0 0 0 ? S 15:04 0:00 [khubd]
root 26 0.0 0.0 0 0 ? S< 15:04 0:00 [md]
root 27 0.0 0.0 0 0 ? S< 15:04 0:00 [devfreq
wq]
root 28 0.0 0.0 0 0 ? R 15:04 0:00 [kworker/0:1]
root 29 0.0 0.0 0 0 ? S 15:04 0:00 [kworker/1:1]
root 31 0.0 0.0 0 0 ? S 15:04 0:00 [khungtaskd]
root 32 2.7 0.0 0 0 ? S 15:04 0:03 [kswapd0]
root 33 0.0 0.0 0 0 ? SN 15:04 0:00 [ksmd]
root 34 0.0 0.0 0 0 ? SN 15:04 0:00 [khugepaged]
root 35 0.0 0.0 0 0 ? S 15:04 0:00 [fsnotifymark]
root 36 0.0 0.0 0 0 ? S 15:04 0:00 [ecryptfs-kthrea]
root 37 0.0 0.0 0 0 ? S< 15:04 0:00 [crypto]
root 48 0.0 0.0 0 0 ? S< 15:04 0:00 [kthrotld]
root 49 0.0 0.0 0 0 ? S 15:04 0:00 [kworker/u:1]
root 50 0.0 0.0 0 0 ? S 15:04 0:00 [scsi
eh0]
root 51 0.0 0.0 0 0 ? S 15:04 0:00 [scsi
eh1]
root 52 0.0 0.0 0 0 ? S 15:04 0:00 [kworker/u:2]
root 53 0.0 0.0 0 0 ? S< 15:04 0:00 [binder]
root 54 0.0 0.0 0 0 ? S 15:04 0:00 [kworker/u:3]
root 73 0.0 0.0 0 0 ? S< 15:04 0:00 [deferwq]
root 74 0.0 0.0 0 0 ? S< 15:04 0:00 [charger
manager]
root 210 0.0 0.0 0 0 ? S 15:04 0:00 [jbd2/vda1-8]
root 211 0.0 0.0 0 0 ? S< 15:04 0:00 [ext4-dio-unwrit]
root 355 0.1 0.0 19472 84 ? S 15:04 0:00 upstart-udev-bridge --daemon
root 361 0.0 0.0 50960 384 ? Ss 15:04 0:00 /lib/systemd/systemd-udevd --daemon
root 405 0.0 0.0 0 0 ? S 15:04 0:00 [vballoon]
root 406 0.0 0.0 0 0 ? S< 15:04 0:00 [kpsmoused]
root 421 0.0 0.0 0 0 ? S 15:04 0:00 [kworker/0:2]
root 431 0.0 0.0 0 0 ? S< 15:04 0:00 [ttm_swap]
message+ 566 0.0 0.0 39220 312 ? Ss 15:04 0:00 dbus-daemon --system --fork
root 593 0.0 0.0 0 0 ? S< 15:04 0:00 [kvm-irqfd-clean]
root 683 0.0 0.0 43448 448 ? Ss 15:04 0:00 /lib/systemd/systemd-logind
syslog 742 0.0 0.0 255840 128 ? Ssl 15:04 0:00 rsyslogd
root 787 0.0 0.0 15652 68 ? S 15:04 0:00 upstart-socket-bridge --daemon
root 795 0.0 0.0 15404 64 ? S 15:04 0:00 upstart-file-bridge --daemon
root 815 0.0 0.0 15816 336 tty4 Ss+ 15:04 0:00 /sbin/getty -8 38400 tty4
root 819 0.0 0.0 15816 336 tty5 Ss+ 15:04 0:00 /sbin/getty -8 38400 tty5
root 824 0.0 0.0 15816 336 tty2 Ss+ 15:04 0:00 /sbin/getty -8 38400 tty2
root 825 0.0 0.0 15816 336 tty3 Ss+ 15:04 0:00 /sbin/getty -8 38400 tty3
root 828 0.0 0.0 15816 336 tty6 Ss+ 15:04 0:00 /sbin/getty -8 38400 tty6
root 863 0.0 0.0 61364 872 ? Ss 15:04 0:00 /usr/sbin/sshd -D
root 865 0.0 0.0 4364 284 ? Ss 15:04 0:00 acpid -c /etc/acpi/events -s /var/run/acpid.socket
root 866 0.0 0.0 23652 428 ? Ss 15:04 0:00 cron
daemon 867 0.0 0.0 19136 0 ? Ss 15:04 0:00 atd
mysql 902 6.4 1.2 1801860 26532 ? Ssl 15:04 0:08 /usr/sbin/mysqld
Debian-+ 1210 0.0 0.0 50088 376 ? Ss 15:04 0:00 /usr/sbin/exim4 -bd -q30m
root 1297 0.2 0.4 319320 9672 ? Ss 15:04 0:00 /usr/sbin/apache2 -k start
www-data 1301 1.8 2.4 351572 49968 ? R 15:04 0:02 /usr/sbin/apache2 -k start
www-data 1302 1.9 2.4 350540 49512 ? R 15:04 0:02 /usr/sbin/apache2 -k start
www-data 1303 1.9 2.4 353128 49884 ? S 15:04 0:02 /usr/sbin/apache2 -k start
www-data 1304 1.9 2.4 356940 50460 ? S 15:04 0:02 /usr/sbin/apache2 -k start
www-data 1305 1.7 2.2 355688 47076 ? S 15:04 0:02 /usr/sbin/apache2 -k start
root 1368 0.0 0.0 0 0 ? S 15:04 0:00 [flush-253:0]
www-data 1376 1.5 2.3 338724 47684 ? S 15:04 0:01 /usr/sbin/apache2 -k start
root 1380 0.0 0.0 105632 1588 ? Ss 15:04 0:00 sshd: root@pts/0
root 1383 6.7 0.1 265584 3956 ? Sl 15:04 0:08 /usr/bin/python /usr/bin/fail2ban-server -b -s /var/run/fail2ban/fail2ban.sock -p /var/
root 1435 0.0 0.0 104304 856 ? Sl 15:04 0:00 /usr/bin/monit -c /etc/monit/monitrc
root 1467 0.0 0.0 15816 336 tty1 Ss+ 15:04 0:00 /sbin/getty -8 38400 tty1
www-data 1485 1.4 1.9 331048 40812 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 1494 1.3 2.0 332000 42748 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 1507 1.4 2.0 331576 41056 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 1849 1.3 1.9 330560 40872 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 1851 1.3 1.9 330028 39192 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 1857 1.3 1.9 330028 39200 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 1858 1.9 3.2 330312 66912 ? R 15:04 0:02 /usr/sbin/apache2 -k start
www-data 1903 1.3 1.9 330564 39956 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 1905 1.3 1.9 330568 40288 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2253 1.3 1.9 330568 39652 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2255 1.3 1.9 330028 39140 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2260 1.2 1.9 330572 39656 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2261 1.3 1.9 330564 39648 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2262 1.3 1.9 330568 39652 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2271 1.3 3.0 351828 63044 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2272 1.3 1.9 330568 39652 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2273 1.2 1.9 330568 39652 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2334 1.2 1.9 330560 39640 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2359 1.3 1.9 330564 39648 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2383 1.3 1.9 330028 39144 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2387 1.2 1.9 330568 39652 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2412 1.3 1.9 330028 39148 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2413 1.2 1.9 330560 39640 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2669 1.2 1.9 330564 39640 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2670 1.3 1.9 330032 39140 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2671 1.2 1.9 330028 39140 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2672 1.2 2.3 339272 48420 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2674 1.2 1.9 330544 39632 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2677 1.2 1.9 330560 39644 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2679 1.2 1.9 330568 39652 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2681 1.3 1.9 330560 39640 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2686 1.2 1.9 330564 39648 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2687 1.2 2.0 330580 41044 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2688 1.2 1.9 330564 39644 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2689 1.2 1.9 330564 39644 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2694 1.2 1.9 330564 39648 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2695 1.2 1.9 330564 39648 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2696 1.2 1.9 330564 39652 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2697 1.2 1.9 330560 39640 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2699 1.2 1.9 330564 39648 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2704 1.2 1.9 330564 39648 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2708 1.3 1.9 330560 39644 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2712 1.2 1.9 330560 39644 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2720 1.3 1.9 330564 39644 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2721 1.2 1.9 330564 39648 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2723 1.2 1.9 330568 39656 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2724 1.2 1.9 330568 39652 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2727 1.2 1.9 330560 39644 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2735 1.2 1.9 330560 39644 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2736 1.2 1.9 330564 39648 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2738 1.2 1.9 330560 39644 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2739 1.2 1.9 330028 39140 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2740 1.3 1.9 330564 39648 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2743 1.2 1.9 330564 39648 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2744 1.2 1.9 330564 39648 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2746 1.2 1.9 330564 39648 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2758 1.2 1.9 330560 39644 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2764 1.2 1.9 330560 39648 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2766 1.2 1.9 330560 39640 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2775 1.2 1.9 330564 39648 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2776 1.2 1.9 330300 39144 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2780 1.2 1.9 330560 39644 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2785 1.1 1.9 330564 39648 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2786 1.2 1.9 330564 39648 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2787 1.2 1.9 330564 39648 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2791 1.2 1.9 330304 39580 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2792 1.2 1.9 330560 39644 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2796 1.1 1.9 330296 39144 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2797 1.2 1.9 330560 39644 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2798 1.2 1.9 330560 39644 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2799 1.2 1.9 330296 39148 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2808 1.2 1.9 330564 39648 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2809 1.1 0.0 0 0 ? Z 15:04 0:01 [apache2] <defunct>
www-data 2811 1.2 1.9 330560 39644 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2812 1.2 1.9 330560 39644 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2813 1.2 1.9 330828 39660 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2814 1.2 1.9 330564 39648 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2815 1.1 1.9 330564 39648 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2822 1.2 1.9 330564 39648 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2825 1.2 1.9 330564 39648 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2826 1.2 1.9 330560 39644 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2829 1.2 1.9 330028 39140 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2830 1.2 1.9 330560 39644 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2831 1.2 1.9 330564 39648 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2833 1.2 1.9 330564 39652 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2834 1.2 1.9 330564 39704 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2835 1.1 1.9 330028 39148 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2836 1.2 1.9 330560 39644 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2841 1.2 1.9 330572 39656 ? S 15:04 0:01 /usr/sbin/apache2 -k start
root 2845 0.0 0.0 0 0 ? S 15:04 0:00 [kauditd]
root 2868 0.0 0.1 22452 2604 pts/0 Ss 15:04 0:00 -bash
www-data 2869 1.2 1.9 330028 39144 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2870 1.2 1.9 330568 39652 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2884 1.2 1.9 330560 39644 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2885 1.2 1.9 330560 39644 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2886 1.2 1.9 330564 39648 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2891 1.2 1.9 330560 39640 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2894 1.2 1.9 330564 39652 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2895 1.1 1.9 330564 39652 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2896 1.1 1.9 330564 39652 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2897 1.2 1.9 330564 39652 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2898 1.1 1.9 330564 39652 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2905 1.2 1.9 330560 39644 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2907 1.2 1.9 330564 39648 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2908 1.2 1.9 330564 39620 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2909 1.1 1.9 330568 39656 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2914 1.2 1.9 330028 39144 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2915 1.2 1.9 330028 39148 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2919 1.2 1.9 330568 39656 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2920 1.1 1.9 330028 39140 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2925 1.2 1.9 330568 39652 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2926 1.2 1.9 330028 39148 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2927 1.2 2.1 330076 44268 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2937 1.2 1.9 330560 39648 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2938 1.2 1.9 330564 39656 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 2945 1.2 1.9 330568 39656 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 3149 1.3 1.9 330560 39648 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 3150 1.3 1.9 330296 39144 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 3151 1.2 1.9 330560 39648 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 3154 1.3 1.9 330296 39140 ? R 15:04 0:01 /usr/sbin/apache2 -k start
www-data 3157 1.3 1.9 330300 39144 ? S 15:04 0:01 /usr/sbin/apache2 -k start
www-data 3254 1.2 1.9 330300 39160 ? S 15:04 0:00 /usr/sbin/apache2 -k start
www-data 3256 1.3 1.9 330296 39164 ? R 15:04 0:00 /usr/sbin/apache2 -k start
www-data 3257 1.3 1.9 330560 39664 ? R 15:04 0:00 /usr/sbin/apache2 -k start
www-data 3264 1.3 1.9 330300 39160 ? R 15:04 0:00 /usr/sbin/apache2 -k start
www-data 3265 1.2 1.9 330296 39160 ? S 15:04 0:00 /usr/sbin/apache2 -k start
www-data 3266 1.3 1.9 330296 39156 ? R 15:04 0:00 /usr/sbin/apache2 -k start
www-data 3267 1.2 1.9 330300 39164 ? S 15:04 0:00 /usr/sbin/apache2 -k start
www-data 3271 1.2 1.9 330028 39156 ? S 15:04 0:00 /usr/sbin/apache2 -k start
www-data 3272 1.2 1.9 330560 39664 ? S 15:04 0:00 /usr/sbin/apache2 -k start
www-data 3273 1.2 1.9 330300 39164 ? R 15:04 0:00 /usr/sbin/apache2 -k start
www-data 3274 1.2 1.9 330028 39164 ? S 15:04 0:00 /usr/sbin/apache2 -k start
www-data 3275 1.2 1.9 330560 39668 ? S 15:04 0:00 /usr/sbin/apache2 -k start
www-data 3276 1.3 1.9 330560 39668 ? R 15:04 0:00 /usr/sbin/apache2 -k start
www-data 3277 1.2 1.9 330304 39164 ? R 15:04 0:00 /usr/sbin/apache2 -k start
www-data 3373 1.2 1.9 330300 39176 ? R 15:05 0:00 /usr/sbin/apache2 -k start
www-data 3374 1.3 1.9 330296 39172 ? S 15:05 0:00 /usr/sbin/apache2 -k start
www-data 3375 1.3 1.9 330300 39176 ? R 15:05 0:00 /usr/sbin/apache2 -k start
www-data 3379 1.2 1.9 330296 39172 ? S 15:05 0:00 /usr/sbin/apache2 -k start
www-data 3441 1.2 1.9 330300 39176 ? S 15:05 0:00 /usr/sbin/apache2 -k start
www-data 3442 1.2 1.9 330296 39172 ? S 15:05 0:00 /usr/sbin/apache2 -k start
www-data 3443 1.2 1.9 330560 39680 ? R 15:05 0:00 /usr/sbin/apache2 -k start
www-data 3444 1.3 1.9 330028 39176 ? S 15:05 0:00 /usr/sbin/apache2 -k start
www-data 3445 1.3 1.9 330032 39176 ? S 15:05 0:00 /usr/sbin/apache2 -k start
www-data 3446 1.3 1.9 330028 39160 ? S 15:05 0:00 /usr/sbin/apache2 -k start
root 3566 0.0 0.0 18444 1304 pts/0 R+ 15:06 0:00 ps aux

3 Answers

Edit in /etc/apache2/mods-enabled/mpm_prefork.conf and add/edit this configuration:

<IfModule mpm_prefork_module>
StartServers 2
MinSpareServers 2
MaxSpareServers 5
MaxClients 40
MaxRequestsPerChild 0
</IfModule>

After restart apache2: sudo service apache2 restart

:)

References:

http://monicalent.com/blog/2013/03/27/avoiding-the-oom-killer-by-limiting-the-number-of-apache2-processes/

https://www.digitalocean.com/community/tutorials/how-to-optimize-apache-web-server-performance

by Matthew Nuzum
Apache is an amazingly powerful and capable web server. In order to make initial setup as easy as possible, it comes with numerous modules pre-installed. This makes it a great choice for new projects when you need to quickly be productive, but as your site grows you may start to bump into performance problems. This tutorial will cover a few things you should do to optimize performance if you’re running Apache with your Django app.

update: the changes mentioned in the mail to the config file must have done it. I changed them in the http.conf also. It is not the first time, but I sometimes need to reboot several times before changes take effect? How is this? I use sudo service apache2 restart or sudo reboot now. Is there a different thing I should do to make this work immediately?
Anyway, now my cpu and memory are under 15% and 30%. So I hope the problem is solved.

  • What changes did you need to make? I'm having this exact same issue, but dont have any mail regarding a config file change

Have another answer? Share your knowledge.