Winfried and others noted that our TLS responses were super slow. This turned out to be caused by the Nagle
algorithm which we failed to disable. https://en.wikipedia.org/wiki/Nagle%27s_algorithm
#include "threadname.hh"
#include <thread>
#include <atomic>
+#include <netinet/tcp.h>
using std::thread;
using std::atomic;
continue;
}
#endif
-
+ SSetsockopt(ci->fd, SOL_TCP, TCP_NODELAY, 1); // disable NAGLE
if(g_maxTCPQueuedConnections > 0 && g_tcpclientthreads->getQueuedCount() >= g_maxTCPQueuedConnections) {
close(ci->fd);
delete ci;