Very high Apache CPU usage after upgrading to 4.0.0

After updating to 4.0.0, apache will sometimes spawn a process that uses
100% cpu usage for a few seconds, and noticeably slows down the entire
system.

What could be causing this, and what would the best course of action to
debug it be?

I’ve tried a clean install (with my custom config, but no plugins) which
also has the same issue. 100% cpu usage from Apache, causing the system to
screech to a halt.

Apache 2.2.14 (Ubuntu)

The only thing I’m getting logged is the following warning:

Unable to recognise encoding of this document at
/usr/share/perl5/XML/SAX/PurePerl/EncodingDetect.pm line 100.
(/usr/share/perl5/XML/SAX/PurePerl/EncodingDetect.pm:100)

Jonah Hirsch

Hello,

RT doesn’t use SAX parsers directly. So it would be helpful to see
backtrace. Also, XML::SAX can use multiple parser and PurePerl is not
that fast. Install XML::LibXML::SAX::Parser to get faster version. Run
the following command to see list of parsers XML::SAX is configured to
use:

perl -MData::Dumper -MXML::SAX -e 'print Dumper( XML::SAX->parsers );'On Sat, May 7, 2011 at 2:54 AM, Jonah Hirsch jwh83@nau.edu wrote:

After updating to 4.0.0, apache will sometimes spawn a process that uses
100% cpu usage for a few seconds, and noticeably slows down the entire
system.
What could be causing this, and what would the best course of action to
debug it be?
I’ve tried a clean install (with my custom config, but no plugins) which
also has the same issue. 100% cpu usage from Apache, causing the system to
screech to a halt.
Apache 2.2.14 (Ubuntu)
The only thing I’m getting logged is the following warning:

Unable to recognise encoding of this document at
/usr/share/perl5/XML/SAX/PurePerl/EncodingDetect.pm line 100.
(/usr/share/perl5/XML/SAX/PurePerl/EncodingDetect.pm:100)


Jonah Hirsch

Best regards, Ruslan.

I did some more digging, and it turned out that it was mod_deflate that was
causing the problem. Disabling it solved my speed woes, but it still raises
the question, why is mod_deflate only slowing the system on RT and not any
of the other sites hosted on this box?
Jonah HirschOn Mon, May 9, 2011 at 2:45 PM, Ruslan Zakirov ruz@bestpractical.comwrote:

Hi,

If system doesn’t hang and completes requests then you should collect
profile with MasonX::Profiler.

Also, earlier release candidates of 4.0.0 had problem that could cause
such behaviour. Try installing into a clean dir to be sure.

On Mon, May 9, 2011 at 11:33 PM, Jonah Hirsch jwh83@nau.edu wrote:

The XML::SAX message was related to our global authentication system.
I’ve
changed it to use XML::LibXML::SAX::Parser, but I still get 100% CPU
usage
from apache when loading any page on 4.0.0
Also, for what it’s worth, according to htop, the apache process that
only
uses one core in the system, but it causes the system to act like the
entire
chip is being used.

Jonah Hirsch

On Sat, May 7, 2011 at 6:19 AM, Ruslan Zakirov ruz@bestpractical.com wrote:

XML::LibXML::SAX::Parser


Best regards, Ruslan.

I did some more digging, and it turned out that it was mod_deflate that
was causing the problem. Disabling it solved my speed woes, but it still
raises the question, why is mod_deflate only slowing the system on RT
and not any of the other sites hosted on this box?

Jonah Hirsch

Where is “SetOutputFilter DEFLATE” in your httpd config files? Is only
enabled for the one site, or in the default configuration?

Jeff