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

Unable to create more than 8 connections to MySQL database #6

Open
sparcit opened this issue Dec 4, 2019 · 4 comments
Open

Unable to create more than 8 connections to MySQL database #6

sparcit opened this issue Dec 4, 2019 · 4 comments
Labels
bug Something isn't working

Comments

@sparcit
Copy link

sparcit commented Dec 4, 2019

Hi,

I am trying to send through enough load through to our RDS mysql database using jdbc-gatling but I am unable to get to more than 4 connections from a Macbook pro and not more than 8 connections from a Windows 7 machine.
Regardless of the number of concurrent users I spawn these are maximum number of connections that are spawned.

Below I set the connectionpoolsettings to go upto 200. But it has not helped

val settings = ConnectionPoolSettings(initialSize = 100, maxSize = 200)
 val jdbcConfig = jdbc.url("jdbc:mysql://blah-blah-blah")
    .username(dbusername)  // TODO Change this to perpetual or on demand Authorization
    .password(dbpassword)
    .driver("com.mysql.cj.jdbc.Driver")
    .connectionPoolSettings(settings)
    .build

Here are the versions of the various dependencies I am using

     <gatling.version>3.3.1</gatling.version>
      <scala-maven-plugin.version>3.3.1</scala-maven-plugin.version>
     <gatling-maven-plugin.version>3.0.5</gatling-maven-plugin.version>
      <jdbc-gatling.version>2.3.0</jdbc-gatling.version>
      <mysql-connector.version>8.0.15</mysql-connector.version>
@rbraeunlich
Copy link
Owner

Hey @sparcit
that seems weird. All connection pool stuff is actually delegates to ScalikeJDBC.
When you run your simulation on DEBUG level, do you see this output somewhere?
DEBUG scalikejdbc.ConnectionPool$ - Registered singleton connection pool : ConnectionPool(
And does the URL match?

@rbraeunlich rbraeunlich added the bug Something isn't working label Dec 10, 2019
@sparcit
Copy link
Author

sparcit commented Dec 12, 2019

Yes I do see that debug statement and the url matches, as I can connect of course and run the queries. It could be a bug in scalikejdbc.ConnectionPool as the connectionpool settings object gets passed in with all the parameters I set. But the maximum number opened on the Macbook is just 4
Is there a way to bypass the connection pool and open a connection for each user?

@rbraeunlich
Copy link
Owner

Hey @sparcit
I just wanted to make sure that the default connection pool is being used and not a different one.
I checked with the debugger and the properties get properly passed on to ScalikeJDBC. There is also a unit test that covers this.
Could you try to write a simple test that directly uses ScalikeJDBC and check if you can create more than the four connections? Then we could be sure if the error is within Scalike or Gatling JDBC.
Currently, there is no way to bypass the connection pool since all database actions use the implicitly present one.

@pshingavi
Copy link

pshingavi commented Apr 23, 2021

@rbraeunlich
Was this resolved ? I see the same issue, I am only seeing 12 connections although my connection pool settings are different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants