I use Apache2, ROR. I implement uploading files to the server via a web form, using HTTP standard method POST. The process itself:

  1. I specify in the form of a file to download and send, for example 40MB.
  2. The browser starts loading 1% .. 100%, takes 17 seconds.
  3. Next, the browser writes the wait, spending 25 seconds

After that, the entire file is uploaded to the server. After uploading an apache file to upload_tmp_file, does the passenger perform any actions with it, like caching or integrity checking? I noticed one moment, if you pause loading the page, or leave it, at the moment when this interval begins in 25 seconds, the file immediately appears in the folder that is not damaged. Interests, exactly Passenger (it is visible in processes) that does with the file after the Apache loaded it in tmp? And until this action (on the file) is completed, the upload action will not work, thus it will not render the page and will not transfer it to the user. As a result, this expectation is obtained in 25 seconds.

Update

I use Ror, upload the 80mb file to the server (apache), using the protocol (http), a very large "wait" delay appears. Download takes 1..100%, then a long wait for TTFB. Passanger is to blame in my opinion, I noticed where time is wasted, and I don’t understand what exactly is wrong .. With small files, everything is fast .. I use the usual download method. The question is: is such a delay normal as in the picture or is it caused by it?

Unclear

  • The entire upload method checked for a while. Did measurements of speed of performance. It's okay - Maks
  • Wherever the application hangs these 25 seconds, it was not in Rails. Probably, the request hung in Apache. Look at the logs that during these 25 seconds Apache says. Whether service records for this request appear before or after these 25 seconds. - D-side
  • After the download of the file 1% -100% in the browser. The browser writes wait, at this moment on the server the processor is 95% -98% loaded by the ruby2.3 process. What happens at this moment? The ruby ​​script copies the received file from the upload_tmp_file to the directory I need, with some sort of file checking? - Maks
  • one
    Well your system. You can try to put the Rack Mini Profiler and have a Flamegraph look, but most likely there will not be those 25 seconds. Personally, I would advise you to throw out Apache completely and use a bunch of Ruby-specific server and nginx. - D-side
  • And after uploading an apache file to upload_tmp_file, does ruby ​​perform any actions with it, like caching or integrity checking? I noticed one moment, if you pause the download page, or leave it, at the moment when this interval begins in 25 seconds, Ruby performs some actions (most likely with the file) and the file immediately appears in the folder that is not damaged. Interested in what Ruby does with the file after the Apache downloaded it in tmp? - Maks

0