Apache requests stuck in '..reading..' state
@ShaneN Your server is reaching choke of resources point-of-failure. Maybe you're getting without ephemeral port range, or without system file-descriptors, which limits the number of sockets your server can use to answer requests. A reading state request means that the socket was opened, but the request line never reached the server, it's a known form of DoS called SlowLoris. To mitigate this kind of DoS, I'd first:
Add to /etc/sysctl.conf
, the following entries:
net.ipv4.tcp_fin_timeout = 10
which sets the timeout of FIN
sockets to 10seconds.
net.ipv4.ip_local_port_range = "15000 61000"
which sets the ephemeral port range to about 46000 possible open ports per IP.
net.core.somaxconn = 1024
- default 128 - The net.core.somaxconn
value has an important role. It limits the maximum number of requests queued to a listen socket.
net.core.netdev_max_backlog = 2000
- default 1000 - which increases the TCP queue of incoming requests.
After adding those lines to the file, issue sysctl -p
to load the kernel parameters at the current runtime and check your rush hour to see if your problem's still there.