0

In a php application. I am uploading 20-30 files at once. Each files is around 100-200MB. Means more than 2GB of data i am uploading on server. Because it takes time around 20-30 mins to upload. One general ajax pooling job getting cancelled after some time.

I have following configuration:

  1. upload_max_filesize = 4096M
  2. post_max_size = 4096M
  3. max_input_time = 600
  4. max_execution_time = 600

During this process my CPU consumption goes only upload 10-20%. I have 32 GB RAM and 12 CORE Linux machine.

Application is running on PHP 8.0, APACHE 2, MYSQL 8, Ubuntu 20.

Can anyone suggest what else i can check?

  • 600sec = 20min but you need 20-30 min. 30 * 200MB is also greater than 4096M – shingo Oct 19 '22 at 14:42
  • What happens when the request is canceled? Do you get a 500? – user3783243 Oct 19 '22 at 14:45
  • I think @shingo made a typo in comment, 600 secs is 10 minutes so you need more execution time at minimum. That should throw an error though in your logs if running into that. – user3783243 Oct 19 '22 at 14:52
  • @Rohit-Raj-Verma Are you uploading 20-30 files of 100-200MB each and processing them one at a time? If you are processing them one at a time, your value for 1. and 2. could be 600M and you have enabled triple size expected input and conserved RAM for your instance. Suggestion to increase 3. and 4. are reasonable at 1800. – Wilson Hauck Oct 21 '22 at 16:11

1 Answers1

0

max_execution_time: This sets the maximum time in seconds a script is allowed to run before it is terminated by the parser. This helps prevent poorly written scripts from tying up the server. The default setting is 30. When running PHP from the command line the default setting is 0.

max_input_time: This sets the maximum time in seconds a script is allowed to parse input data, like POST and GET. Timing begins at the moment PHP is invoked at the server and ends when execution begins. The default setting is -1, which means that max_execution_time is used instead. Set to 0 to allow unlimited time.

I think change it: max_input_time = 1800 & max_execution_time = 1800 (30 minutes)

Soltuts
  • 1
  • 3
  • links can change over time, best is to add more info in the answer rather than relying on the link. Click [here](https://stackoverflow.com/posts/74129624/edit) and do that! – Marcello Miorelli Oct 22 '22 at 10:15