sysbench icon indicating copy to clipboard operation
sysbench copied to clipboard

[Question] Would running with `--threads=1` and `--rate=N` cause backpressure, if the database can't keep up with the `rate`?

Open oatmealb opened this issue 1 year ago • 0 comments

Firstly, thank you and all the contributors for this awesome tool.

Goal: to simulate SQL queries from an application, where users may not wait for a query "A" to finish, and immediately trigger one more query "B", producing even more (IO-bound) load on the database (DB).

Questions:

  1. Would running with --threads=1 and executing a slow SQL query mean that the next query following would be waiting on it? That is, would DB effectively push back and back-pressure against any further load? The queue_time is included in the elapsed time measurement, which is good. But even more realistic would be if a user/thread would be able to pile on additional load to the DB at will. I think the answer to the above lies in the code on these 2 lines (I'm bit rusty on pthreads):

  2. Would you use --threads=20 --rate=20 to simulate 20 concurrent users, each producing 1 QPS? Does one have to also consider number of CPU cores (and/or hyperthreads), or anything else, when choosing these flags?

Using sysbench 1.1.0-2ca9e3f (using bundled LuaJIT 2.1.0-beta3).

oatmealb avatar Sep 15 '23 15:09 oatmealb