This service will be undergoing non-disruptive maintenance at 07:20 UTC, 2018-12-14. It is expected to last approximately 30 minutes
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
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: httpd (Show other bugs)
(Show other bugs)
Version: rawhide
Hardware: x86_64 Linux
medium
medium
Target Milestone: ---
Assignee: Joe Orton
QA Contact:
URL:
Whiteboard:
Keywords:
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:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-01-28 14:18:20 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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.