Apache2 does tons of reads before serving a simple http request response

Hi there. So I've got apache2 serving my php sites, and I recently wrote some node webapps, and realized that node was serving up http responses way quicker than apache2 (I had wrongly been assuming linode was to blame).

I ran ps auxw | grep sbin/apache | awk '{print " -p " $2}' | xargs strace -o apache2.log to look at what happens in apache2 when I send a request. In the browser, dev tools, network, I see that the initial request for my page (http://gerbus.ca/laststand) takes 7 seconds to receive a response.

In the strace http://gerbus.ca/apache2.log, I see a shit load of read lines, taking about 6 seconds (from 14:19:19 to 14:19:25). Anyone have an idea what's going on?

1 Reply

Well, first and foremost, there's a bunch of htaccess attempts. Disable htaccess globally and rewrite it as static apache configuration if you have any.

Whatever crap is happening with those read calls is happening in PHP. You can see the interpreter startup at 14:19:19, it then reads a WSDL cache and does bunch of other crap, so your PHP code would be the primary suspect.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct