4

I created a page sending files to my server(ssd class vps on ovh) with chunked uploading. I am using Resumable.js(https://github.com/23/resumable.js) to achieve this with the php page they have as example on their github project(https://github.com/23/resumable.js/blob/master/samples/Backend%20on%20PHP.md) to receive the data. It works but it is very very slow, according to Chrome Dev Tool the request take 5-7 seconds to be "sent" and takes another 6-8 seconds to receive the first byte.

I tried to analyse how long the php execution script takes and to my surprise microtime() shows no time passed(aka same microtime value) while executing the script.

On my vps I have a setup based on nginx running php7 with fastcgi. I made few tries and other php pages and this delay I see on chunked uploading is not visible(0.1ms as request time and 35ms TTFB).

Did someone experienced something similar and knows how to handle this? Might it be due to some ddos protection? I tried the script also with apache on the vps and saw no differences. The same script locally works like a charm. Which is what gives me lot of doubts: if nginx and apache show same problem I can suppose it is a script issue but then why locally is that faster?(same dev tool says 3ms to send request and 2ms as TTFB)

1 Answers1

0

Based on my experience, a good way to approach such problems, is to get the same setup for test and production. To accomplish that I use Docker. I've put up a post that has a complete environment for WordPress ready. Replacing the WordPress scripts with your script might yield you with a setup you can reproduce the issue locally.

When able to reproduce the issue take a look at your FPM parameters. Or the way the FPM connection is made. My best bet from the data we have is it has to do with either the transport or some other FPM setting.

superreeen
  • 151
  • 2
  • 12