So we've successfully used the approach outlined in the excellent
"Offloading Websockets and Server-Sent Events" guide:
http://uwsgi-docs.readthedocs.io/en/latest/articles/OffloadingWebsocketsAndSSE.html

But now that we are applying it to a larger django application, I realized
we are a bit unclear about how everything scales when used on an
application with several processes. We're still a bit new to the offloading
subsystem.

Say I run a django app with the following (trimmed) configuration
parameters:

[uwsgi]
process = 8
offload-threads = 1
response-route-if = equal:${WS_OFFLOAD};true disableheaders:
response-route-if = equal:${WS_OFFLOAD};true uwsgi:/tmp/wsapp.sock,0,0

It looks like uWSGI launches 8 processes, as expected, and 8 offload
threads. So the offload_threads argument applies per process.

Now we have a straightforward uGreen-based python websocket comm app. We
launch a single instance with say 1000 green threads:

[uwsgi]
async = 1000
ugreen = true

My 2 questions:

Am I correct in that each process spawns it's own offload thread?

Is it reasonable to have all of the processes offload to the same async
app?

Note that I do understand, in general, that the more cpu-intensive the
async app is the more we would want to run additional apps instead of just
adding green threads. But I didn't know if there was anything wrong with
multiple offload threads pointing at the same async app.

Thanks for any help and thanks for providing such a great tool!
-Andrew

-- 
Andrew Fischer
Apastron Co
903 1st ST N Hopkins, MN
952-373-1024
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to