Apache Hung, But Why?

Peter Rukavina

Posting this here just in case others find themselves in the same situation.

Since migrating this site from my own silverorange-colocated server to Amazon AWS, I’ve been experiencing seemingly random Apache server outages. The usual suspects – mismatched Apache and MySQL settings, lack of memory, etc. – didn’t seem to apply, and the symptoms were confoundingly simple: all of Apache’s processes – up to the MaxClients settings limit – would be “hung,” and the server would be unreachable. But MySQL was fine, the system load was fine, and, as near as I could tell, everything was beautiful and sunny. Except that Apache was, effectively, hung.

After several weeks of Googling away for “Apache hung processes” and “Apache process limit” and “Apache crashed” and “mysterious and confounding Apache issue,” I launched into some more serious Apache debugging and eventually traced the issue to some variation of APC and this PHP issue. The debugging that got me there was running strace on any of the child Apache processes and seeing:

futex(0x2b19a0b01070, FUTEX_WAIT, 2, NULL)

Rather than trying to solve the APC issue itself, I solved the issue – fingers cross – by upgrading from Apache 2.2 to Apache 2.4 and from PHP 5.3.29 to PHP 5.5.20. Among other things, this let me jettison APC and use PHP OPcache instead. Which appears to have addressed the larger issue, and given me access to a nice OPcache visualization to boot:

PHP OpCache

Add new comment

Plain text

  • Allowed HTML tags: <b> <i> <em> <strong> <blockquote> <code> <ul> <ol> <li>
  • Lines and paragraphs break automatically.

About This Blog

Photo of Peter RukavinaI am . I am a writer, letterpress printer, and a curious person.

To learn more about me, read my /nowlook at my bio, listen to audio I’ve posted, read presentations and speeches I’ve written, or get in touch (peter@rukavina.net is the quickest way). 

You can subscribe to an RSS feed of posts, an RSS feed of comments, or a podcast RSS feed that just contains audio posts. You can also receive a daily digests of posts by email.

Search