title: Best practices to process 500k+ requests
body: <p>I finished my first Python RESTful API (with <a href="https://github.com/noirbizarre/flask-restplus" rel="nofollow noreferrer">Flask RESTPlus</a>) few days ago, and I wrote a small program to test it:</p>
  
  <pre><code>if __name__ == '__main__':
  with open('dataset.csv') as dataset:
      reader = csv.DictReader(dataset)
      nb_requests = 0
      for row in reader:
          data = json.dumps(row)
          nb_requests += 1
          requests.post(url=url, data=data, headers=header)
  </code></pre>
  
  <p>The problem is the following :</p>
  
  <p>I have a quite huge CSV dataset that I need to test (500k+ lines) and I need to make a POST request to my API for each line inside it.</p>
  
  <p>As expected it's slow because both program are synchronous and I was wondering what would be the best practices to make it faster ?</p>
  
  <p>I read about multithreading, multiprocessing, asyncio ... But I actually don't know what would be the best solution in order to make the API and my testing program faster. Any suggestions ?</p>
  
  <p>Thanks for your lights!</p>