mirror of
https://github.com/emikulic/darkhttpd.git
synced 2023-08-10 21:13:08 +03:00
Enable TCP_NODELAY optimization
It looks like `TCP_NODELAY` was disabled due to the bug fixed in the previous commit. Enabling it substantially improves keep-alive performance with `ab`: Before: ``` Time per request: 0.272 [ms] (mean) ``` After: ``` Time per request: 0.033 [ms] (mean) ```
This commit is contained in:
parent
6f049638b6
commit
73585d8eb7
2
TODO
2
TODO
@ -1,3 +1 @@
|
||||
- keepalive performance against ab sucks
|
||||
- keepalive+TCP_NODELAY hangs!
|
||||
- send headers using sendfile syscall - fewer packets
|
||||
|
@ -817,13 +817,11 @@ static void init_sockin(void) {
|
||||
&sockopt, sizeof(sockopt)) == -1)
|
||||
err(1, "setsockopt(SO_REUSEADDR)");
|
||||
|
||||
#if 0
|
||||
/* disable Nagle since we buffer everything ourselves */
|
||||
sockopt = 1;
|
||||
if (setsockopt(sockin, IPPROTO_TCP, TCP_NODELAY,
|
||||
&sockopt, sizeof(sockopt)) == -1)
|
||||
err(1, "setsockopt(TCP_NODELAY)");
|
||||
#endif
|
||||
|
||||
#ifdef TORTURE
|
||||
/* torture: cripple the kernel-side send buffer so we can only squeeze out
|
||||
|
Loading…
x
Reference in New Issue
Block a user