aboutsummaryrefslogtreecommitdiff
path: root/READMEs/README.tcp_fastopen.md
blob: f9ca8eb351ad6541ee233024697087605ab662dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# `TCP_FASTOPEN` support in lws

Lws supports enabling TCP_FASTOPEN oper-vhost for listen sockets.

## Enabling per vhost serving

Set the `info.fo_listen_queue` to nonzero at vhost creation.  Different
platforms interpret this number differently, zero always disables it
but on Linux, the number is interpreted as a SYN queue length.

On FreeBSD, OSX and Windows, the number is basically a bool, with the
extra restriction OSX and Windows only allows 0 or 1.

## Enabling Linux for serving with TCP_FASTOPEN

To configure the kernel for listening socket TCP_FASTOPEN, you need

```
# sysctl -w net.ipv4.tcp_fastopen=3
```

## Enabling BSD for serving with TCP_FASTOPEN

At least on FreeBSD, you need to set the net.inet.tcp.fastopen.enabled
sysctl to 1

## Enabling Windows for serving with TCP_FASTOPEN

```
> netsh int tcp set global fastopenfallback=disabled
> netsh int tcp show global
```