[Flask] uWSGI and Flask - Slow and varying response times

Tim van der Linden tim at shisaa.jp
Thu Jul 7 10:33:19 EDT 2016


On Thu, 07 Jul 2016 17:35:12 +0800
Unai Rodriguez <unai at sysbible.org> wrote:

Hi Unai (and everyone else!)

> Fantastic collaborative effort!!! :) 

Indeed. Thanks to all for giving a fresh set of eyes into this issue.
A big factor, as Ziirish pointed out, seems to be the difference in clock speed indeed.

As Unai pointed out it still does not explain the difference in response.
Maybe there is a lot of context switching going on ... ?

Another thing I noticed as well is the fact that on the server the profiler tells me a request is finished in ~700 ms (for example) but the browser has to wait a total of ~ 1100 ms before receiving back the data.

There seems to be something happening between Python being finished within those ~700 ms and uWSGI/Nginx generating a response back to the client (~ 400ms lost somewhere).

Maybe this is the cause for the difference in response rates. Python performance (yet slower slower than local) is stable, the response overhead varies.

I wonder what might be happening in uWSGI/Nginx after Python is finished with its work...

> -- unai

Cheers,
Tim


More information about the Flask mailing list