How to test max number of tcp connections

Hello,
I wanna test max tcp connection value. Please suggest how to do that. Thanks.

Well, I have an idea, In your client machine perform a lot of request to your server machine (if you're testing apache you would try ab)

while your client application is making requests run this command in your server machine, it'll determine how many connections are open in a time

while[ "1" = "1" ] ; do
  netstat -an | grep "ESTABLISHED" | wc -l
  sleep 1
done

Many thanks!