Bug 138014 - httpd uses lots of small sendfile calls for large file transfers
httpd uses lots of small sendfile calls for large file transfers
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: httpd (Show other bugs)
rawhide
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Joe Orton
:
Depends On:
Blocks: FC4Target
  Show dependency treegraph
 
Reported: 2004-11-03 15:48 EST by Jakub Jelinek
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-01-28 09:18:20 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jakub Jelinek 2004-11-03 15:48:43 EST
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 15:53:36 EST
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 09:18:20 EST
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.