Commit 106cb6525c7a463a84abdc0bf15d55d17b86341f

Authored by Wiebe Cazemier
1 parent 92def969

Increase listen backlog to 32768

I don't know what is a good value. I'm upping it, together with (the
possibility of increasing) net.core.somaxconn and
net.ipv4.tcp_max_syn_backlog. The listen backlog is truncated to
somaxconn, to having a high value makes sense.

It seems to fix the kernel TCP SYN flooding warnings, if also disabling
SYN cookies.
Showing 1 changed file with 1 additions and 1 deletions
mainapp.cpp
@@ -150,7 +150,7 @@ std::list<ScopedSocket> MainApp::createListenSocket(const std::shared_ptr<Listen @@ -150,7 +150,7 @@ std::list<ScopedSocket> MainApp::createListenSocket(const std::shared_ptr<Listen
150 check<std::runtime_error>(fcntl(listen_fd, F_SETFL, flags | O_NONBLOCK )); 150 check<std::runtime_error>(fcntl(listen_fd, F_SETFL, flags | O_NONBLOCK ));
151 151
152 check<std::runtime_error>(bind(listen_fd, bindAddr.p.get(), bindAddr.len)); 152 check<std::runtime_error>(bind(listen_fd, bindAddr.p.get(), bindAddr.len));
153 - check<std::runtime_error>(listen(listen_fd, 1024)); 153 + check<std::runtime_error>(listen(listen_fd, 32768));
154 154
155 struct epoll_event ev; 155 struct epoll_event ev;
156 memset(&ev, 0, sizeof (struct epoll_event)); 156 memset(&ev, 0, sizeof (struct epoll_event));