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:
Tom Dryer 2021-06-13 13:49:34 -07:00
parent 6f049638b6
commit 73585d8eb7
2 changed files with 0 additions and 4 deletions

2
TODO
View File

@ -1,3 +1 @@
- keepalive performance against ab sucks
- keepalive+TCP_NODELAY hangs!
- send headers using sendfile syscall - fewer packets

View File

@ -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