title: Gunicorn Workers have no impact on performance
body: <p>My application works on identifying elements of a document and classifying + extraction information within it. (NERs and classification model predictions)
  A document is sent, processed and the entire information is sent back to the client. </p>
  
  <p>I am using a Gunicorn + Flask server. 
  I have tried various combination of gunicorn workers, worker classes, threads etc... but they all seem to perform the same way as running the application with just the flask server using one process.</p>
  
  <p>I am not sure what is going wrong. Gunicorn does not use all the cores, as I presume it pre-forks the master process, but whether I add 1 worker or 4, I am unable to improve the performance on servicing async requests. </p>
  
  <p>Currently : </p>
  
  <ul>
  <li>4 async requests from the client  </li>
  <li>Gunicorn is set to 4 workers and 2 threads with worker class = gthread</li>
  </ul>
  
  <p>The performance is as good as running only one worker. I was under the impression that gunicorn would give each file to each worker and they would be able to process the document separately. But it doesn't decrease the time taken to process all 4 documents. They appear to be processed sequentially or just work as though they are processed by just one worker.</p>
  
  <p>My example config file : </p>
  
  <pre><code>bind:{{server_ip}}:5001
  max_requests:1000
  max_requests_jitter:2
  workers:4 #max_workers()
  worker_class:'sync' #or 'gthread' or 'gevent'
  threads:3
  timeout:1500
  worker_connections = 100
  daemon:True
  access_log_format:'%(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"'
  #accesslog:'/Logs/access_request.log'
  #errorlog:'/Logs/transactions.log'
  capture_output:True
  </code></pre>
  
  <p>Is there a way I can utilize all the cores? Maybe implement a queue, poll it and possibly give each file to be processed by each core within the system?</p>
  
  <p>I am unable to improve the performance of servicing async requests from the client.</p>
  
  <p>Can someone help me with what I might be doing wrong here?</p>