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

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-1e57d0f-4545e.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-1e57d0f-4545e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?