How to optimize the PHP asynchronous request to call the interface 20 times a second?

the current problem is:

send an ajax request as soon as you click the upload button. If there are 20 images, send ajax20 times. The PHP code calls Qiniuyun API, that is, Qiniuyun API is called 20 times a second, and the server explodes. Seek the optimization scheme.

Php
Mar.06,2021

send the request in a loop, wait for the last request to return successfully and then send the next request


when uploading the picture, upload, returns the url of the picture
finally submit submits the url to save


you can store all of it in the server. Then the server makes a queue, and there is a separate thread in the background to process the task of uploading the image to Qiniu. After the image processing is completed, the subsequent task is called back.
the front end displays similar words in the processing, then waits for the background processing to complete, and then modifies the foreground page.

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