A night with threads and gdb
eivind at aminor.no
Thu Apr 1 02:20:08 PST 2004
--On 30. mars 2004 17:42 +0100 Andrea Venturoli
<andrea.venturoli at netfence.it> wrote:
> _ apache 2.0 with default prefork MPM will start, but will chew up all
> cpu time after a while; using "httpd -DSSL -X"
> shows that the server dies when nocc is used to forward a mail; no need
> to say that it's a problem with threads, the
> exact message being
> Fatal error 'Unable to read from thread kernel pipe' at line 1100 in
> file /usr/src/lib/libc_r/uthread/uthread_kern.c (errno = 0)
I saw the same problem with Apache 2.0.49 + PHP 4.3.5 on FreeBSD 5.2.1-p4.
I posted on freebsd-current about the same "Unable to read from thread
kernel pipe" but didn't get any response (apart from being told to not run
PHP + Apache2 together).
When I recompiled the kernel using SCHED_ULE instead of the default
SCHED_4BSD this fault message went away (I can't say if it was _caused_ by
the change in scheduler since I also tried some other things to fix this at
the time) but Apache still hangs / starts consuming all the CPU now and
I've now been running Apache 2.0.49 + PHP 4.3.5 for nearly two hours
without any obvious problems, but it might be too early to say if this is
working stable or not.
If we assume that things finally are stable here, these are the changes
I've done locally to get to this point. I don't know which (if any...) of
these really helped or not as that requires more testing.
- I'm using a more or less plain GENERIC kernel but now with SCHED_ULE
instead of SCHED_BSD (other changes are to include IPFILTER in kernel)
- PHP 4.3.5 is using PCRE from PHP 4.3.4
- PHP is now compiled without support for LDAP and DOMXML
Apache is (and always was) running in prefork-mode.
Regards / Hilsen
<eivind at aminor.no>
More information about the freebsd-questions