question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

After the service restarts, the request is time-consuming in a short time

See original GitHub issue

I am using sharding-jdbc 4.0.0-RC1.

      <dependency>
        <groupId>org.apache.shardingsphere</groupId>
        <artifactId>sharding-jdbc-spring-boot-starter</artifactId>
        <version>4.0.0-RC1</version>
      </dependency>

question Online problem, every time you restart the project, after a successful restart, a request will appear in the persistence layer for a short time, such as 20 seconds. It takes a long time to appear, and then it will return to normal. At that time, the QPS is stable and the database connection is sufficient.

configuration

  • spring.shardingsphere.datasource.ds0.type = com.zaxxer.hikari.HikariDataSource
  • spring.shardingsphere.datasource.ds0.driver-class-name = com.mysql.jdbc.Driver
  • spring.shardingsphere.datasource.ds0.maximum-pool-size = 100
  • spring.shardingsphere.datasource.ds0.minimum-idle = 50
  • spring.shardingsphere.datasource.ds0.connection-init-sql = SET NAMES utf8mb4

help

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
beiwangnullcommented, Nov 13, 2019

@terrymanu @zcjhwl It’s going to be faster

@Component public class PreHeating implements InitializingBean { @Override public void afterPropertiesSet() throws Exception { Collection<DatabaseType> databaseTypes = SQLParserFactory.getAddOnDatabaseTypes(); for (DatabaseType databaseType:databaseTypes){ if(“MySQL”.equals(databaseType.getName())){ SQLParseEngine parseEngine = SQLParseEngineFactory.getSQLParseEngine(databaseType); parseEngine.parse(“select ‘X’”,true); MySQLParser mySQLParser = (MySQLParser)SQLParserFactory.newInstance(databaseType,“select ‘X’”); mySQLParser.execute(); } } }

0reactions
codingIsCrazycommented, Mar 13, 2020

@terrymanu @zcjhwl It’s going to be faster

@component public class PreHeating implements InitializingBean { @override public void afterPropertiesSet() throws Exception { Collection databaseTypes = SQLParserFactory.getAddOnDatabaseTypes(); for (DatabaseType databaseType:databaseTypes){ if(“MySQL”.equals(databaseType.getName())){ SQLParseEngine parseEngine = SQLParseEngineFactory.getSQLParseEngine(databaseType); parseEngine.parse(“select ‘X’”,true); MySQLParser mySQLParser = (MySQLParser)SQLParserFactory.newInstance(databaseType,“select ‘X’”); mySQLParser.execute(); } } }

this “getAddOnDatabaseTypes” is not exist

Read more comments on GitHub >

github_iconTop Results From Across the Web

Consequences of restarting active directory domain services ...
Agree with others, a normal restart would not be quite time consuming and there is not going to be a big issue. Please...
Read more >
Set up self-healing services with systemd | Enable Sysadmin
Forgetting or never having the root password for a Linux system is a bad thing. This short how-to will prevent a time-consuming reinstall....
Read more >
Services overview | Android Developers
The service is created when another component calls startService() . The service then runs indefinitely and must stop itself by calling ...
Read more >
A Pod Restarts. So, What's Going on? | by Raju Dawadi
In the short duration, the pods scheduled on the to-be-deleted node has to be re-scheduled. There is helm chart for Spot Termination Notice ......
Read more >
How to correctly reset, restart, and recycle IIS websites
Should I use IISRESET to restart IIS services? Should I recycle my IIS application pools when the website is slow, failing, queueing, or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found