FreeBSD httperf ports – The Ignorant Hack http://blog.ignoranthack.me Surprising facts to me, completely obvious to you Sat, 19 Apr 2014 14:46:12 +0000 en-US hourly 1 https://wordpress.org/?v=6.2.8 http://blog.ignoranthack.me/wp-content/uploads/2022/11/FrankNBeansCan_400x400-150x150.png FreeBSD httperf ports – The Ignorant Hack http://blog.ignoranthack.me 32 32 httperf tuning for #FreeBSD testing http://blog.ignoranthack.me/?p=169 Wed, 05 Feb 2014 18:45:33 +0000 http://blog.ignoranthack.me/?p=169 Was playing around with httperf to excercise Apache / stunnel SSl benchmarks on FreeBSD this week and ran into the code that nerfs simultaneous connections down from the environment ulimit of maxfiles to the limit FD_SETSIZE as defined in <select.h>.

One can override this at compile time and push the system harder by passing in some ./configure foo:

env CC=”cc -DFD_SETSIZE=4096″

However, you will then be able to max out the number of ports in use very quickly if you try to use stunnel and apache in this configuration.  I noted that on our systems we raise the low port number and reduce the high port number for connections:

net.inet.ip.portrange.first=20000

net.inet.ip.portrange.last=49151

I set first down to 2000 and last up to 65534 for my testing.  This gives me quite a bit more ports to use in testing.  At this point I can run stunnel on 443 forwarding to apache on localhost:80 and get more than 8k simultaneous connections when using SSL accelerators on FreeBSD 10

 

]]>