Using the same jar package to execute SQL locally with DruidDataSource is fast and slow on centos.

< H2 > question < / H2 >

multithreaded crawler, the data source is DruidDataSource,SQL is very long and make sure there are no errors, do not post. After all, if it is a SQL problem, then local execution will be slow.

the crawler is found to be very slow when the program runs on the Ali CVM with Jar packets, and the query log finds that it takes 50 seconds to save to the database; the same code takes 1 second to execute directly in idea.

// 
logger.debug(task.getObjectid()+":"+System.currentTimeMillis());
connection.createStatement().execute(infoDetailSql + "; " + attrSql + "; " + updateTaskSql);
logger.debug(task.getObjectid()+":"+System.currentTimeMillis());

View server monitoring, resource usage is no more than 50%.

the communication between crawler server and database server is good.

I hope you will not hesitate to give us your advice and point out the possible problems.

Apr.28,2021
The length of

SQL is 1m, which may be related to the fact that the upstream bandwidth of the server is only 1m.

Menu