Ticket #97 (closed enhancement: fixed)

Opened 3 years ago

Last modified 15 months ago

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

lighttpd-1.3.13.selective_cork.patch (7.7 kB) - added by Christian von Roques <roques@…> 3 years ago.
Patch to selectively cork only if deemed necessary
lighttpd-1.3.13.selective_cork.2.patch (1.1 kB) - added by Christian von Roques <roques@…> 3 years ago.
Patch (without junk) to selectively cork only if deemed necessary

Change History

Changed 3 years ago by Christian von Roques <roques@…>

Patch to selectively cork only if deemed necessary

Changed 3 years ago by Christian von Roques <roques@…>

Patch (without junk) to selectively cork only if deemed necessary

Changed 3 years ago by jan

  • status changed from new to closed
  • resolution set to fixed

applied in [490]

Add/Change #97 (Cork only if necessary)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.