title: What factors should decide the number of threads on my C++ webserver?
body: <p>I understand that generally the number of worker threads should be equal to the number of CPUs on your server (in my case it is 8), unless the thread is doing some kind of I/O etc.</p>
  
  <p>My webserver provides services that require an extensive search in my mysql database, some queries takes about 16seconds in worst case. So two questions here,
  1. How do I decide on the number of threads that will be optimal?
  2. How can I simulate thousands of user and test my server against thousands of requests?</p>