Hi,
I would like to know how to improve response time on tryton after idle time.
I recorded a video of what happends when I use tryton again after 30 minuts idle (some case could be less)
I run tryton using nginx with uwsgi3.
[uwsgi]
socket=/tmp/%n.sock
virtualenv = /opt/bosque
wsgi=app
module=trytond.application:app
env = TRYTOND_CONFIG=/opt/bosque/tr.conf
processes = 1
threads = 4
check-static = /opt/bosque/sao
In nginx config I use something it:
upstream bosquesup {
server unix:/tmp/bsqs.sock; # for a file socket
}
# configuration of the server
server {
# the port your site will be served on the domain name it will serve for
server_name mydomain.io; # substitute your machine's IP address or FQDN
charset utf-8;
# max upload size
client_max_body_size 75M; # adjust to taste
location /static {
alias /opt/bosques/sao; # your Django project's static files - amend as required
}
# Finally, send all non-media requests to the uwsgi server.
location / {
uwsgi_pass bosquesup;
include /etc/nginx/uwsgi_params;
uwsgi_read_timeout 300;
}
}
I also use a proxy
# configuration of the server
server {
# the port your site will be served on
listen 8000 default_server;
listen [::]:8000 default_server;
# the domain name it will serve for
server_name _; # substitute your machine's IP address or FQDN
charset utf-8;
# max upload size
client_max_body_size 75M; # adjust to taste
location / {
proxy_pass http://127.0.0.1:80/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 1200;
proxy_send_timeout 1200;
proxy_read_timeout 1200;
send_timeout 1200;
client_body_timeout 1200;
keepalive_timeout 1200;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
}
}
I noticed in uwsgi log it is updated only after 40 seconds (the time for tryton take to response) with an entry similar to these.
Apr 23 15:15:28 ip-172-31-35-117 uwsgi[512]: {address space usage: 400MB} {rss usage: 87281664 bytes/83MB} [pid: 3942|app: 0|req: 294/294] 127.0.0.1 () {46 vars in 709 bytes} [Thu Apr 23 21:15:28 2020] POST /bosquedb/ => generated 20 bytes in 18 msecs (HTTP/1.0 200) 2 headers in 71 bytes (2 switches on core 1)
I’m using trytond 5.0.14 and tryton 5.0.15. Tryton under windows 10. SAO work very well and fast.
By last, I run it on a AWS instance t2.xlarge, so I don’t think it is for a lack of resources.
Thanks in advance.