You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Sander Smeenk <ss...@freshdot.net> on 2007/12/05 11:36:16 UTC

[users@httpd] Weird writev()-loop when download is cancelled.

Hello!

With Apache 2.2.6 (the prefork mpm, on Debian 'SID') i'm seeing weird
behaviour when a (large) download is cancelled by a visitor.

Scenario: User browses to my site, clicks a link to a 1.5G zipfile,
realises it will take ages to download and clicks 'cancel download',
which results in an Apache process eating up ~99% CPU-time and hogging
the system.

Strace shows:

30672 writev(79, [{"1fa0\r\n", 6}, {"\270Q\34"..., 8096}, {"\r\n", 2}], 3) = -1 EPIPE (Broken pipe)
30672 --- SIGPIPE (Broken pipe) @ 0 (0) ---
30672 writev(79, [{"1fa0\r\n", 6}, {"\235:\235"..., 8096}, {"\r\n", 2}], 3) = -1 EPIPE (Broken pipe)
30672 --- SIGPIPE (Broken pipe) @ 0 (0) ---
30672 writev(79, [{"1fa0\r\n", 6}, {"\241\237"..., 8096}, {"\r\n", 2}], 3) = -1 EPIPE (Broken pipe)
30672 --- SIGPIPE (Broken pipe) @ 0 (0) ---

In a continous loop. This happens for each and every request that is
cancelled, so looping apache processes accumulate at a fast rate on a
busy site. While smaller files make processes loop less longer, this
large file poses a problem as it takes some time to writev() 1.5G and
processing the SIGPIPE's.

Why exactly does Apache not stop sending data after receiving a SIGPIPE? ;-)

-Sndr.
-- 
| 42.7 percent of all statistics are made up on the spot.
| 1024D/08CEC94D - 34B3 3314 B146 E13C 70C8  9BDB D463 7E41 08CE C94D

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Weird writev()-loop when download is cancelled.

Posted by Sander Smeenk <ss...@freshdot.net>.
Quoting Sander Smeenk (ssmeenk+apacheusr@freshdot.net):

> Scenario: User browses to my site, clicks a link to a 1.5G zipfile,
> realises it will take ages to download and clicks 'cancel download',
> which results in an Apache process eating up ~99% CPU-time and hogging
> the system.

Explicitly enabling or disabling Sendfile does not make any difference.
Funny thing is, using wget(1) and interrupting that it works like
expected.

-Sndr.
-- 
| Scenery is here, wish you were beautiful.
| 1024D/08CEC94D - 34B3 3314 B146 E13C 70C8  9BDB D463 7E41 08CE C94D

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org