Linux – Apache Strange Error Message ‘Broken pipe’

apache-2.2linux

Always getting "(32)Broken pipe: core_output_filter: writing data to the network" message on Apache error.log.

In apache.conf setted up EnableSendfile Off, EnableMMAP Off but its still same.

OS: Debian etch

Apache ver: Apache/2.2.3

Enabled apache modules: ctions alias auth_basic authn_file authz_default authz_groupfile authz_host authz_user autoindex cgi dir env fcgid include mime negotiation perl php5 rewrite setenvif ssl status suexec userdir.

Thanks.

Best Answer

Since you've already turned off EnableSendfile and EnableMMAP, it looks like you've done your homework. The general cause of this error is that Apache got SIGPIPE, which happens when Apache tries to write to a socket that the other end has closed (described here, look at the last post). The post suggests that the user on the far end can trigger this by pressing their Stop or Reload button. However, if you're seeing flurries of these entries all the time, I think the following is more likely:

  • Client connected to Apache at some point, and established a bunch of parallel connections. Most clients will do this so they can download multiple files/images/etc. at the same time to make the page load faster.
  • Client went idle but kept the sockets open.
  • At some point, all those sockets timed out on the client end. Possibly a firewall or NAT device killed them, so you never get a TCP RST or FIN on your end.
  • The next time the Apache checks up on far end for TCP_KEEPALIVE, the kernel sees the socket is busted and returns SIGPIPE to Apache.

If you have a busy server, I'd imagine this is actually the usual and expected behavior. In fact, even the Apache folks themselves don't seem to concerned about it, as they apparently set the LogLevel for apache.org to warn so they don't even see these messages (noted here). This message is apparently only seen at level info, so changing it to notice or higher should prevent them from being logged.

Related Topic