Ticket #97 (closed enhancement: fixed)
Cork only if necessary
| Reported by: | Christian von Roques <roques@…> | Owned by: | jan |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | core | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Blocked By: | ||
| Need User Feedback: | Blocking: |
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.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

