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.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3bddd-3467a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3bddd-3467a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?