Bug 138014 - httpd uses lots of small sendfile calls for large file transfers
Summary: httpd uses lots of small sendfile calls for large file transfers
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: httpd
Version: rawhide
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Joe Orton
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: FC4Target
TreeView+ depends on / blocked
 
Reported: 2004-11-03 20:48 UTC by Jakub Jelinek
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-01-28 14:18:20 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jakub Jelinek 2004-11-03 20:48:43 UTC
User-Agent:       
Build Identifier: 

FC3 httpd when sending a testing 5GB file on x86-64 uses many small sendfile calls:
...
sendfile(14, 16, [3144408424], 2136806040) = 49232
poll([{fd=14, events=POLLOUT, revents=POLLOUT}], 1, 120000) = 1
sendfile(14, 16, [3144457656], 2136756808) = 49232
poll([{fd=14, events=POLLOUT, revents=POLLOUT}], 1, 120000) = 1
sendfile(14, 16, [3144506888], 2136707576) = 33304
poll([{fd=14, events=POLLOUT, revents=POLLOUT}], 1, 120000) = 1
...

What's the reason why it just doesn't use sendfile for the whole file?
Or is the same program managing multiple connections at once?

vsftpd seems to use much bigger chunks (> 1GB).

Reproducible: Always
Steps to Reproduce:
1.
2.
3.

Comment 1 Joe Orton 2004-11-03 20:53:36 UTC
It's just an arbitrary limit which must be <2gb to be safe, and it's
set to a stupidly low value, I've been meaning to change it to 1gb.

Comment 2 Joe Orton 2005-01-28 14:18:20 UTC
Ah, no, I was thinking of something else.  httpd *is* trying to
sendfile() the whole file in one go as the arguments show in the
strace output.  But the socket is non-blocking, of course, so this is
expected behaviour; sendfile returns short each time it would block.


Note You need to log in before you can comment on or make changes to this bug.