PHP query a large number of MySQL questions?

overall environment: Apache2.4.25 + PHP5.6 + MySQL5.5.57

demand:

2

question:


6000Apache Server
PHPignore_user_abort(true);set_time_limit(0);

practice:




question:



6000

ob_flush() flush()2500

cpu



Jan.15,2022

I don't know if your scene is the same as mine.
I import it in batches and extract the data in the database for comparison and verification.
method 1: queue execution, front-end polling results in response.
method 2: front-end polling promotes the progress of the task, splits the whole task into steps, reads, transforms, checks Filter in batches (the front-end shows the progress, prevents timeouts from comparing a fixed amount of data each time), saves valid record data, and finally updates and inserts it at a time.


ignore_user_abort (true) and set_time_limit (0). After is set, the timeout still reports an error, that is, the timeout of apache is not set

. Does this requirement have to be triggered manually and returned in real time? My understanding is that this is a scheduled computing task, for example, in the case of
calculated every morning, it is a better solution to write a PHP script and use crontab to make a scheduled task

.

finally, a solution triggered by a browser is given:
split the task instead of PHP in JS , and split it into multiple Ajax HTTP requests, ensuring that each request does not exceed 30 seconds, so that how long it takes to execute

Menu