Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 07 Oct 2022 00:26:51 +0000
From:      bugzilla-noreply@freebsd.org
To:        apache@FreeBSD.org
Subject:   maintainer-feedback requested: [Bug 266873] www/apache24: creating forked processes at 100% CPU spinning in sched_yield()
Message-ID:  <bug-266873-16115-9MS5xtFyrb@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-266873-16115@https.bugs.freebsd.org/bugzilla/>
References:  <bug-266873-16115@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
Bugzilla Automation <bugzilla@FreeBSD.org> has asked freebsd-apache (Nobody)
<apache@FreeBSD.org> for maintainer-feedback:
Bug 266873: www/apache24: creating forked processes at 100% CPU spinning in
sched_yield()
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D266873



--- Description ---
Apache version: apache24-2.4.54 - build with poudriere
FreeBSD: 12.3-STABLE FreeBSD 12.3-STABLE stable/12-3a9e60169ee GENERIC amd64

Since updating OS and apache a couple of weeks ago, I have noticed that my
system is getting filled up with httpd processes consuming 100% CPU.=20

Here is an example with one rogue process, but after a day of running the
system will be eventually full of httpd processes spinning at 100%.=20

root   9947 100.0  0.0	207000	41380  -  RJ   10:59   18:42.98
/usr/local/sbin/httpd -DNOHTTPACCEPT
www   10243   1.4  0.1	310180 138488  -  SJ   11:17	0:01.44
/usr/local/sbin/httpd -DNOHTTPACCEPT
www   10059   0.4  0.1	242068	71156  -  SJ   11:06	0:03.63
/usr/local/sbin/httpd -DNOHTTPACCEPT
root   9738   0.0  0.0	207000	41388  -  SsJ  10:37	0:00.35
/usr/local/sbin/httpd -DNOHTTPACCEPT
www    9853   0.0  0.1	244096	70872  -  SJ   10:47	0:06.49
/usr/local/sbin/httpd -DNOHTTPACCEPT
www    9887   0.0  0.1	242500	69808  -  IJ   10:51	0:08.48
/usr/local/sbin/httpd -DNOHTTPACCEPT
www   10058   0.0  0.1	307876 136996  -  IJ   11:06	0:04.76
/usr/local/sbin/httpd -DNOHTTPACCEPT
www   10136   0.0  0.1	242592	71452  -  IJ   11:12	0:02.50
/usr/local/sbin/httpd -DNOHTTPACCEPT
www   10144   0.0  0.1	244644	71328  -  IJ   11:14	0:01.31
/usr/local/sbin/httpd -DNOHTTPACCEPT
www   10166   0.0  0.1	244648	73028  -  SJ   11:15	0:00.99
/usr/local/sbin/httpd -DNOHTTPACCEPT
www   10239   0.0  0.1	209800	61568  -  IJ   11:16	0:00.20
/usr/local/sbin/httpd -DNOHTTPACCEPT


Usual behavior with prefork will be an initial process running as root, whi=
ch
then forks additional processes and sets them to run as www user. What appe=
ars
to be happening here is that when the fork occurs, something gets stuck bef=
ore
it is able to switch to www.=20

In the case of the rogue process above, output of truss -p 9947 is simply a
continuous loop of:
sched_yield()					 =3D 0 (0x0)


For some extra context, I am running this inside a jail, hosting nextcloud =
with
mod_php80, mysql, redis. None of my other web apps are having this issue bu=
t it
could be something which only appears under load and nextcloud is certainly=
 the
heaviest application here.=20
Also, I tried switching over to php-fpm with mpm_event and the same issue w=
as
encountered there, so it certainly feels like something core to apache's
forking code at play here.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-266873-16115-9MS5xtFyrb>