There are many scheduled tasks, and they are distributed on different servers. To poll the database for data that meets the conditions (status) and then process it. In this way, hundreds or thousands of scheduled tasks poll the database, which directly leads to a sharp increase in database pressure.
How to deal with this situation? How to reduce database pressure.
Combine similar or similar polling tasks to reduce the number of polling tasks
Reduce the execution frequency of polling tasks
Optimize the SQL statements inside the polling task to reduce database query pressure
Split the execution time of polling tasks equally, don’t concentrate them all in a certain time period
Do not use polling tasks
Upgrade database
Try to store the data ID to be polled separately, task poll the ID table, and then perform a single query based on the ID
In addition, the database can also be set up with multiple slave libraries, and scheduled tasks can poll data from different slave libraries, so the pressure on the database is much smaller