java - How to solve the pressure on scheduled task polling database
PHPz
PHPz 2017-05-17 10:04:44
0
3
1187

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.

PHPz
PHPz

学习是最好的投资!

reply all(3)
黄舟
  1. Combine similar or similar polling tasks to reduce the number of polling tasks

  2. Reduce the execution frequency of polling tasks

  3. Optimize the SQL statements inside the polling task to reduce database query pressure

  4. Split the execution time of polling tasks equally, don’t concentrate them all in a certain time period

  5. Do not use polling tasks

  6. 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

PHPzhong

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!