There was a very strange problem with the speed of the site.

  • OS: ubuntu server 18.04
  • Proxy Server: Nginx + Pagespeed
  • WSGI Server: Gunicorn
  • FW: Django 1.11.5

Problems:

  • The end time of the CPU - 12.4 seconds.
  • Approximate delay time for input - 220 ms
  • Load time for interaction - 14.8 seconds

Diagnostics prompts:

  • Minimize work in the main thread - 6.9 seconds
  • Reduce the execution time of the JavaScript code - 3.6 seconds ((Google maps + Google recapcha))
  • Set the rules for effective use of the cache for static objects - 8 resource (Google maps + Google recapcha)

All of the above refers to the Mobile version of the site 44 out of 100, on the PC version all the rules are 90 out of 100

Perhaps a problem in the config service, but not sure.

[Unit] Description=site.com django instance After=syslog.target network.target [Service] Type=simple User=www-data Group=www-data Restart=always RestartSec=2 Environment="IS_PRODUCTION=yes" Environment="PYTHONPATH=/home/rast/src" #ExecStart=/home/site/app/bin/gunicorn main.wsgi ExecStart=/home/site/app/bin/gunicorn --bind 127.0.0.1:8000 --workers 3 --threads 2 main.wsgi [Install] WantedBy=multi-user.target 

Call out if someone is familiar with such problems.

  • So this is all completely unrelated to the server, html / css / javascript is inhibited - andreymal
  • Open the developer tools in chrome, profiler in hand and forward to look for inhibitory places in the code - andreymal
  • The fact is that everything has been ottimized here (js / css / img minified too much and so removed) Minimize work in the main thread - 6.9 seconds - this figure seems not to be related to the above - Philip Pilipchuk
  • Obviously, this is the main stream of javascript code. Minification is not an optimization of javascript code and doesn’t affect its performance or the performance of the main stream at all. - andreymal
  • Well, suppose, and in that case what to do? A code that is already present, it is needed (Recapcha, Scroll, slider, Maps, etc.) - Philip Pilipchuk

0