Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can dbbench use a connection pool? #12

Open
krishmanoh opened this issue Jul 9, 2020 · 4 comments
Open

Can dbbench use a connection pool? #12

krishmanoh opened this issue Jul 9, 2020 · 4 comments

Comments

@krishmanoh
Copy link

Running a workload that needs a connection pool. Can dbbench be modified to use a pool?

@awreece
Copy link
Contributor

awreece commented Jul 9, 2020

Take a look at the concurrency parameter (https://github.com/memsql/dbbench/blob/master/TUTORIAL.md#using-multiple-connections) -- would you please explain how a connection pool differs from that?

@krishmanoh
Copy link
Author

Testing an ultra low latency workload. We need to discount the connection setup time from query execution time. The request is that a connection pool will first be opened and the queries run in that pool.

@awreece
Copy link
Contributor

awreece commented Jul 9, 2020

Ah, then here are a couple of workarounds:

  • use something like pg_bouncer
  • this hack might work (basically, run 10 initial queries that will initialize the connections and then start your workload once they're done):
[warm 10 connections]
query=select sleep(0.5)
concurrency=10

[actual workload]
concurrency=10
start=2s

@krishmanoh
Copy link
Author

Looks like option 2 does work as expected

`
[warm 10 connections]
query=select sleep(0.5)
concurrency=10
stop=1s

[actual workload]
query=select count(1) from test.test_date
concurrency=5
start=2s

I see the same LWPID being used

+-----+-----------------+-----------+--------+----------------------+
| id | host | state | lwpid | substr(info,1,20) |
+-----+-----------------+-----------+--------+----------------------+
| 362 | :64201 | executing | 17898 | select sleep(0.5) |
| 354 | :60105 | executing | 199307 | select sleep(0.5) |
| 360 | :63177 | executing | 199310 | select sleep(0.5) |
| 117 | localhost:21654 | executing | 199318 | select id, host, sta |
| 363 | :64713 | executing | 353150 | select sleep(0.5) |
| 358 | :62153 | executing | 353151 | select sleep(0.5) |
| 359 | :62665 | executing | 353153 | select sleep(0.5) |
| 361 | :63689 | executing | 353154 | select sleep(0.5) |
| 356 | :61129 | executing | 353155 | select sleep(0.5) |
| 355 | :60617 | executing | 353157 | select sleep(0.5) |
| 357 | :61641 | executing | 377956 | select sleep(0.5) |
+-----+-----------------+-----------+--------+----------------------+

+-----+-----------------+-----------+--------+----------------------+
| id | host | state | lwpid | substr(info,1,20) |
+-----+-----------------+-----------+--------+----------------------+
| 354 | :60105 | executing | 199307 | select count(1) from |
| 117 | localhost:21654 | executing | 199318 | select id, host, sta |
| 363 | :64713 | executing | 353150 | select count(1) from |
| 359 | :62665 | executing | 353153 | select count(1) from |
| 355 | :60617 | executing | 353157 | select count(1) from |
| 357 | :61641 | executing | 377956 | select count(1) from |
+-----+-----------------+-----------+--------+----------------------+
6 rows in set (0.00 sec)

The other connections are open until dbbench exits.

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants