nginx.conf
# This number should be, at maximum, the number of CPU cores on your system. # Number of file descriptors used for Nginx. This is set in the OS with ‘ulimit -n 200000’ # only log critical errors # Determines how many clients will be served by each worker process. # essential for linux, optmized to serve many clients with each thread # Accept as many connections as possible, after nginx gets notification about a new connection. # Caches information about open FDs, freqently accessed files. # Buffer log writes to speed up IO, or disable them altogether # Sendfile copies data between one FD and other from within the kernel. # Tcp_nopush causes nginx to attempt to send its HTTP response head in one packet, # don’t buffer data-sends (disable Nagle algorithm). Good for sending frequent small bursts of data in real time. # Timeout for keep-alive connections. Server will close connections after this time. # Number of requests a client can make over the keep-alive connection. This is set high for testing. # allow the server to close the connection after a client stops responding. Frees up socket-associated memory. # send the client a “request timed out” if the body is not loaded by this time. Default 60. # If the client stops reading data, free up the stale client connection after this much time. Default 60. # Compression. Reduces the amount of data that needs to be transferred over the network
|
sysctl.conf
# Increase system IP port limits to allow for more connections net.ipv4.ip_local_port_range = 2000 65000 net.ipv4.tcp_window_scaling = 1 # number of packets to keep in backlog before the kernel starts dropping them # increase socket listen backlog # Increase TCP buffer sizes
|