Better uwsgi deploy #226
Comments
Here is what I see on stage now:
I don't really understand why we have only one process here, and that might be a source of the problems.
We should deactivate that because we don't need multiple interpreters here, to do so, the |
In this post it's recommended to have multiple wsgi instances rather than only one, and it seems to perform better. Something to investigate. |
I thint this just means we're using a process that preforks workers itself, which is different from an emperor mode. you can verify this by ps aux'ing|wc -l the workers |
ping @Micheletto |
After some more debugging by @tarekziade and @Micheletto it seems that @tarekziade pushed a fix, which is |
After some testing, here is a good uwsgi configuration: [uwsgi]
wsgi-file = app.wsgi
enable-threads = true
socket = /tmp/readinglist.sock
processes = 10
master = true
module = readinglist
harakiri = 30
uid = readinglist
gid = readinglist
virtualenv = .venv
lazy = true
lazy-apps = true
single-interpreter = true
buffer-size = 65535
post-buffering = 65535 The nginx configuration should have this setup:
In case of permissions problems |
local nginx config
|
I believe the basic concerns of this issue have been addressed. Should we close it out? |
yes! However, can we paste the final version of the configuration file here for later reference? (cc @Micheletto) |
[uwsgi]
wsgi-file = app.wsgi
enable-threads = true
socket = /run/uwsgi/cliquet.sock
chmod-socket = 666
cheaper-algo = busyness
cheaper = 5
cheaper-initial = 9
workers = 14
cheaper-step = 1
cheaper-overload = 30
cheaper-busyness-verbose = true
master = true
module = readinglist
harakiri = 120
uid = readinglist
gid = readinglist
virtualenv = .
lazy = true
lazy-apps = true
single-interpreter = true
buffer-size = 65535
post-buffering = 65535 |
I've been reading the uwsgi documentation and while it's a bit hard to follow by times, it seems a bunch of interesting things could be tweaked in our setup. If you want to read a doc but don't know where to start, the best practices doc is a good one.
@Micheletto , I think you'll like that!
What could (should?) be tweaked in our deployment
1.6.2
on stage, so it's available;-http
). This will spare us parsing the requests twice and will speed up a lot our service.Other interesting things to know
uwsgitop
tool which can help us to find the right number of processes (apparently, Simple math likeprocesses = 2 * cpucores
is not enough);ip_conntrack_max
system variable (/proc/sys/net/ipv4/ip_conntrack_max) and increase it to see if it helps.The text was updated successfully, but these errors were encountered: