Project

General

Profile

Bug #2470

[PATCH] network_write_chunkqueue_writev repeatedly calls sysctl to look up iov_max

Added by kevinday almost 4 years ago. Updated over 3 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
core
Target version:
Start date:
2013-02-05
Due date:
% Done:

100%

Missing in 1.5.x:
No

Description

On systems with sysconf(_SC_IOV_MAX), network_write_chunkqueue_writev prefers that over other options. On FreeBSD, sysconf is implemented by doing a sysctl lookup of kern.iov_max each time it's called. This has the full weight of a syscall, and is happening once every time through the for() loop.

The patch below checks the max_chunks value only once and remembers it, cutting the number of syscalls network_write_chunkqueue_writev makes in half. Also changes the error message if no way of looking up max_chunks is found to file a bug here instead of annoying Jan by email.

writev.diff.txt View (2.43 KB) kevinday, 2013-02-05 17:11

Associated revisions

Revision 25a3f2e8 (diff)
Added by stbuehler over 3 years ago

[network] use constants available at compile time for maximum number of chunks for writev instead of calling sysconf (fixes #2470)

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2885 152afb58-edef-0310-8abb-c4023f1b3aa9

Revision 2885 (diff)
Added by stbuehler over 3 years ago

[network] use constants available at compile time for maximum number of chunks for writev instead of calling sysconf (fixes #2470)

History

#1 Updated by stbuehler over 3 years ago

  • Target version set to 1.4.33

#2 Updated by stbuehler over 3 years ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Applied in changeset r2885.

Also available in: Atom