Actions
Feature #97
closedCork only if necessary
Status:
Fixed
Priority:
Normal
Category:
core
Target version:
-
ASK QUESTIONS IN Forums:
Description
An strace of lighttpd serving a big file looks like:
17:50:44.983662 poll([{fd=4, events=POLLIN}, {fd=8, events=POLLOUT, revents=POLLOUT}], 2, 1000) = 1 17:50:44.983821 setsockopt(8, SOL_TCP, TCP_CORK, [1], 4) = 0 17:50:44.983884 sendfile64(8, 9, [6372756], 10145213) = 147447 17:50:44.991046 setsockopt(8, SOL_TCP, TCP_CORK, [0], 4) = 0 17:50:44.991129 time(NULL) = 1113515444
The attached patch makes lighttpd only cork the socket if there are more than one chunk in the chunkqueue on the assumption that one chunk can be sent using one syscall and multiple chunks use multiple syscalls.
I benchmarked lighttpd with and without the patch and could not measure any difference, so the patch is not obviously good for performance, but still it makes an strace of lighttpd more readable, so you might want to incorporate the patch anyway.
-- Christian von Roques <roques
Files
Updated by jan over 19 years ago
- Status changed from New to Fixed
- Resolution set to fixed
applied in r490
Actions
Also available in: Atom