Hikari pool implementation in perfservice#109
Conversation
| if(!usingHikari) | ||
| conn.close(); | ||
| else { | ||
| this.conn = this.getBenchmark().makeConnection(); |
There was a problem hiding this comment.
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.
| 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.
Since worker inherits from benchmarkmodule are we creating one hikari pool per worker?
There was a problem hiding this comment.
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.
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.
implemented closeDataSource() method which will close it in ThreadBench finalizeWorkers()
|
@hbhanawat - Getting following error after closedatasource implementation. |
398a578 to
a33db7c
Compare
Flag based hikari pool support in benchbase.
Use flag
use_hikari_pool: true/falsein input yaml or xml. Default value isfalseOptionally, you can set max pool size for hikari through property
max_pool_size: <pool_size>. Default max pool size = terminalsExample yaml: