Yii2 performance check

Hi there,

I want to write a small application which will handle 5000 read and write requests with in one second in a single server.

I don’t want to use any kind of load balancer.

Can you guys pls guide me how I can write that script and send request to test it.



You ask no small thing!

Since you don’t provide any detail about the application, we get to make up our own.

We will have a very simple app that does not do any database processing. It will not be

able to do very much user interface interaction due to the time required to move data between the server and the client machine.

Once the app is written, will need need to order a dedicated server, probably in the 16-32 core range with hyper-threading to give is between 32 and 64 processing threads. We will only need a few gig of ram, maybe 4gig as we don’t need to store much data. Solid State Harddisk directly connected to a fast port directly on the server.

We will want to run it on nginx to get max performance. Opcache will also needed.

The problem you have here, is that one machine that will handle that number of requests is very expensive. But even at that performance level, you will not get a application that does much.

5000 request a second is very high. That is 200 microseconds per request.

You will be looking at $1000 - $2000 per month in hosting fees. Maybe more…

If you can give us some more detail on what you want at the end, we can probably give you a better idea of what you really need.


Hi there,

I just want to test how many request per seconds Yii2 can handle, and I want to do this with database, actually I have no idea how I can send these request to perform read and write operations.

I’m looking some piece of code so I can start.

Thank you

It depends very much on hardware you’re running on.

OK, that gives us more to go on…

In my case I have an app that has some pages that perform very basic db queries and provides a basic display on a page.

I run on a AWS t2.micro instance and depending on some configuration options I am testing at the time i get between 30 and 50 requests per second. I must stress that this depends very heavily on your app and server.

I suggest you start with the Basic App Template and do some testing.


Thanks john.