title: How to increase limits on sockets on osx for load testing?
body: <p>I'm creating a load tester that uses libev to create lots of open tcp connections to an app i'm working on. Currently it bombs out at 256 connections, due to the nofiles limit:</p>
  
  <pre><code>ulimit -n
  256
  </code></pre>
  
  <p>I can increase this to 1024 by doing the below:</p>
  
  <pre><code>ulimit -n 1024
  </code></pre>
  
  <p>But i cannot increase it further. Ideally i want to set it to 1048576. It gives the following error:</p>
  
  <pre><code>ulimit: open files: cannot modify limit: Invalid argument
  </code></pre>
  
  <p>How can i increase the ulimit further on osx?</p>