Nginx 10k connections

Nginx can handle 10k concurrent connections. I guess default FreeBSD network configuration will limit this and needs optimization/tuning (number of open files/sockets, memory cache, etc.). Is there forum topic or other source with instructions for this.
 
I guess default FreeBSD network configuration will limit this
Did you try that?
On the fly I couldn't think of anything that might limit the number of concurrent connections, let alone any arbitrary limits that need to be adjusted.

You might want to use tcp fastopen (see the various net.inet.tcp.fastopen sysctlts) and reduce the tcp.inet.tcp.keepidle time, but other than that if you have enough nginx workers configured there shouldn't be anything that limits the number of concurrent connections...
 
Some sysctl.conf you might find usefull,
Code:
net.inet.icmp.drop_redirect=1            #0
net.inet.icmp.icmplim=50                 #200
net.inet.ip.check_interface=1            #0                  
net.inet.ip.maxfragpackets=0             #15762
net.inet.ip.maxfragsperpacket=0          #16
net.inet.ip.process_options=0            #1                  
net.inet.ip.random_id=1                  #0                          
net.inet.ip.redirect=0                   #1
net.inet.tcp.always_keepalive=0          #1          
net.inet.tcp.blackhole=2                 #0
net.inet.tcp.cc.algorithm=cubic          #newreno #Congestion control newreno,CDG,CHD,CUBIC,DCTCP,HD,H-TCP,VEGAS
net.inet.tcp.drop_synfin=1
net.inet.tcp.fast_finwait2_recycle=1
net.inet.tcp.icmp_may_rst=0              #1
net.inet.tcp.nolocaltimewait=1           #0           
net.inet.tcp.syncache.rexmtlimit=0
net.inet.tcp.syncookies=0
net.inet.udp.blackhole=1                 #0
net.inet6.icmp6.rediraccept=0            #1       
net.inet6.ip6.accept_rtadv=1             #0 Default value of per-interface flag for accepting ICMPv6 RA messages
net.inet6.ip6.redirect=0                 #1
net.local.stream.recvspace=65536
net.local.stream.sendspace=65536
 
Did you try that?
On the fly I couldn't think of anything that might limit the number of concurrent connections, let alone any arbitrary limits that need to be adjusted.

I guess the number of open sockets (for 1 application) cannot be 10,000. Not sure is there another way to listen on socket other than listen() function whose second parameter is number for "queue of pending connections".
 
I guess the number of open sockets (for 1 application) cannot be 10,000.
Maybe stop guessing and actually start measuring and testing?

Not sure is there another way to listen on socket other than listen() function whose second parameter is number for "queue of pending connections".
Listen queue has very little to do with it.
 
Back
Top