sysbench
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`?
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:
-
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? Thequeue_time
is included in theelapsed
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):- when waiting on a mutex lock (to dequeue an item) and
- and here, using pthread_cond_signal(&queue_cond).
-
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).