title: Multithreading with websockets
body: <p>This is more a design question. I have the following implementation</p>
  
  <p>Multiple Client connections ----->  Server ------> Corresponding DB conns</p>
  
  <p>The client/server communication is done using web sockets. It's a single threaded application currently. Evidently, this design does not scale as the the load on the server is too high and response back to the clients takes too long.
  Back end operations involve handling large amounts of data.</p>
  
  <p>My question: is it a good idea to create a new thread for every web socket connection? This would imply 500 threads for 500 clients (the number of web sockets would be the same whether it's multi-threading or single threaded). This would ease the load on the server and hence would make life a lot more easier.</p>
  
  <p>or</p>
  
  <p>Is there a better logic to attain scalability? One of them could be create threads on the merit of the job and get the rest processed by the main thread. This somehow seems to be going back to the same problem again in the future.</p>
  
  <p>Any help here would be greatly appreciated.</p>