Page 1 of 1

Apache taking 100% of the cpu

Posted: Sun Jan 19, 2020 12:39 pm
by flambert
Hey all,
My vestacp server takes 100% cpu after around 3 days and get unusable/unresponsible. I haved tried to use strace to trace the issue but having had any luck finding out what is causing the issue.

Strace spamming this:
poll([{fd=39, events=POLLIN}], 1, 3000) = 1 ([{fd=39, revents=POLLHUP}])
read(39, "", 13160) = 0
poll([{fd=39, events=POLLIN}], 1, 3000) = 1 ([{fd=39, revents=POLLHUP}])
read(39, "", 13160) = 0
poll([{fd=39, events=POLLIN}], 1, 3000) = 1 ([{fd=39, revents=POLLHUP}])
read(39, "", 13160) = 0
poll([{fd=39, events=POLLIN}], 1, 3000) = 1 ([{fd=39, revents=POLLHUP}])
read(39, "", 13160) = 0
poll([{fd=39, events=POLLIN}], 1, 3000) = 1 ([{fd=39, revents=POLLHUP}])

Does anyone have any ideas what I could try?

Re: Apache taking 100% of the cpu

Posted: Wed Jan 22, 2020 8:58 am
by makispain
Something similar happened to me with the Clamav.

Re: Apache taking 100% of the cpu

Posted: Wed Jan 22, 2020 8:20 pm
by skamasle
What system you use

How much memory have your server

You use fastcgi or mod_php?

Are you sure this is a apache problem and not php problem ?

Re: Apache taking 100% of the cpu

Posted: Sat Jan 25, 2020 8:42 am
by flambert
skamasle wrote:
Wed Jan 22, 2020 8:20 pm
What system you use

How much memory have your server

You use fastcgi or mod_php?

Are you sure this is a apache problem and not php problem ?
Hey, I am not sure if it's an apache problem or php, I am running around 3 websites, all is not that much used/visitors.
I just see if I go to the server tab under processes that *"apache2" is under 100% load

System::
Ubuntu 16.04
4GB ram

systemd-+-2*[agetty]
|-apache2---8*[apache2]
|-clamd---{clamd}
|-cron
|-dovecot-+-anvil
| |-auth
| `-log
|-exim4---4*[exim4]
|-fail2ban-server---12*[{fail2ban-server}]
|-freshclam
|-kthreadd/102512---khelper/1025129
|-mysqld---28*[{mysqld}]
|-named---4*[{named}]
|-nginx---3*[nginx]
|-proftpd
|-rsyslogd-+-{in:imuxsock}
| `-{rs:main Q:Reg}
|-saslauthd---saslauthd
|-spamd---2*[spamd child]
|-sshd
|-systemd-journal
|-systemd-udevd
|-vesta-nginx---vesta-nginx
|-vesta-php-+-vesta-php
| `-vesta-php---sh---sudo---v-list-sys-cpu----pstree
`-xinetd

Re: Apache taking 100% of the cpu

Posted: Tue Jan 28, 2020 7:34 pm
by skamasle
Try change your PHP handler in your vesta panel

Choose fastcgid this will run apache process and php process in diferente users, so you can see better who is using cpu

By default php runing in vesta as apache process, so you see same process for bot as apache or www-data or nobody

Change PHP handler in tree site one by one, first one and see what happen, you can identify what site is using more CPU