-
Notifications
You must be signed in to change notification settings - Fork 7
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
Hikari pool implementation in perfservice #109
base: main
Are you sure you want to change the base?
Conversation
if(!usingHikari) | ||
conn.close(); | ||
else { | ||
this.conn = this.getBenchmark().makeConnection(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have to create a connection and then close it? I think we shouldn't be doing anything in the teardown for hikari.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -73,15 +75,24 @@ public abstract class BenchmarkModule { | |||
public BenchmarkModule(WorkloadConfiguration workConf) { | |||
this.workConf = workConf; | |||
this.dialects = new StatementDialects(workConf); | |||
if (workConf.getXmlConfig().getBoolean("use_hikari_pool", false)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since worker inherits from benchmarkmodule are we creating one hikari pool per worker?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
even though worker inherits from benchmarkmodule, the datasource is created in benchmarkmodule's constructor which is called only once. Hence, there is only one hikari pool.
private HikariDataSource hikariDataSource; | ||
|
||
public void createDataSource() { | ||
HikariConfig config = new HikariConfig(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should shutdown the dataSource and its associated pool after the test is done. You can call datasource.close for the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
implemented closeDataSource() method which will close it in ThreadBench finalizeWorkers()
@hbhanawat - Getting following error after closedatasource implementation.
|
Flag based hikari pool support in benchbase.
Use flag
use_hikari_pool: true/false
in input yaml or xml. Default value isfalse
Optionally, you can set max pool size for hikari through property
max_pool_size: <pool_size>
. Default max pool size = terminalsExample yaml: