Project

General

Profile

Actions

Feature #97

closed

Cork only if necessary

Added by Anonymous over 19 years ago. Updated over 17 years ago.

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

lighttpd-1.3.13.selective_cork.patch (7.67 KB) lighttpd-1.3.13.selective_cork.patch Patch to selectively cork only if deemed necessary -- Christian von Roques <roques Anonymous, 2005-04-14 22:21
lighttpd-1.3.13.selective_cork.2.patch (1.05 KB) lighttpd-1.3.13.selective_cork.2.patch Patch (without junk) to selectively cork only if deemed necessary -- Christian von Roques <roques Anonymous, 2005-04-14 22:23
Actions #1

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