简体   繁体   中英

Storing outputs of PHP scripts running in parallel

I have a PHP processed HTML form and upon submiting few scripts start running on background at the same time and each of them returns an integer or string value. After submiting that form the user gets to another one and after submiting the new form the output values of the scripts will be read. What is the optimal way to store the outputs?

  • each output to a separate file
  • all outputs to one file
  • UPDATE a SQL DB

It seems that usually the best way is storing each output to a separate file, because of possible delays caused by locks on one file. UPDATE is very expensive. I compared times of storing 10000 strings into files and MySQL and the times were 2 vs 20 s.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM