lundi 19 novembre 2018

how to benchmark your laravel api server to see if it can handle one million request per seconds?

I am using codesenberg/bombardier to benchmark my api server and created a Benchmark controller in laravel.

Because the api endpoint that I am benchmarking against always requires data exchange on each request. So I create methods that are similar to the api that I wanted to test only with different that those required data are already there in those method, so that i could test them out independently without depending on some of the api.

I am expecting millions of concurrent user will be using my application. The request operation will mostly be insert or update and less on query.

By using bombardier here is how I perform the test

bombardian -c 1000000 -n 1000000 http://my-stag-server/api/benchmark/endpoint -m "POST"

or

bombardian -n 10000 http://my-stag-server/api/benchmark/endpoint1 -m "POST" & bombardian -n 10000 http://my-stag-server/api/benchmark/endpoint2 -m "POST

Are the approach i am using the best way to test if my api server could handle million concurrent user request?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire