irwinai commented on issue #16515:
URL: 
https://github.com/apache/shardingsphere/issues/16515#issuecomment-1085445023


   I found that getConnenction is too slowly.
   ```
   private static DatabaseType getDatabaseType(final DataSource dataSource) {
           log.info("getConnection starting ...");
           long start = System.currentTimeMillis();
           Connection connection = null;
           try {
               connection = dataSource.getConnection();
           } catch (SQLException throwables) {
               throwables.printStackTrace();
           }
           log.info("getConnection using {}", (System.currentTimeMillis() - 
start));
           try {
               return 
DatabaseTypeRegistry.getDatabaseTypeByURL(connection.getMetaData().getURL());
           } catch (final SQLException ex) {
               throw new IllegalArgumentException("An error occurred when open 
datasource connection!", ex);
           }
       }
   ```
   the log show : getConnection using 253
   so if I have 40 datasource connection
   the time using is 10 sec
   with more getConnection option
   the createDatasource option can use 1minute 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to