Hi,

So it seems to me now that offloading websocket handling to the offload
thread is the way to go,
but I still have my original problem, how
to uwsgi.websocket_send('message') to the right websocket?

Also I would need to have a loop somewhere to constantly check for new
messages, I thought using a timer but I can't have values <1. Can I use the
offload threads for this too?

Thanks
Avraham


On Mon, Jan 9, 2017 at 6:55 PM, Avraham Serour <[email protected]> wrote:

> Hi,
>
> Of course I'm worried about scalability
> I'm already running with async (uwsgi --http-socket :8000 --master
> --ugreen --wsgi-file uwsgi_asgi.py --async 100) and
> using uwsgi.wait_fd_read(websocket_fd, 3), isn't that enough?
> Does offloading means I don't have to run uwsgi in async mode?
>
> In any case thank you for the links, I'll read them.
>
> Avraham
>
> On Mon, Jan 9, 2017 at 6:50 PM, Mikko Ohtamaa <[email protected]>
> wrote:
>
>> Hi,
>>
>> If you are doing serious amount of (idle) websocket connections you
>> should consider uWSGI "offloading" websocket event loop to an async offload
>> thread:
>>
>> http://uwsgi-docs.readthedocs.io/en/latest/articles/Offloadi
>> ngWebsocketsAndSSE.html
>>
>> http://uwsgi-docs.readthedocs.io/en/latest/OffloadSubsystem.html
>>
>> This way you can handle heavy concurrency better. If you are not worried
>> about scalability, don't worry about offloading, as it will add an extra
>> complexity layer to your development.
>>
>> Thanks,
>> Mikko
>>
>> On 9 January 2017 at 10:39, Avraham Serour <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> I'm making a python websocket server application, I took a look at the
>>> example and already have a proof of concept running.
>>>
>>> If I understand correctly each worker holds one websocket, so how to
>>> send a message from one worker to another? Is that possible?
>>>
>>> I'm currently using redis as a backend, so one worker receives the
>>> message from redis and then it would need to redirect to the correct socket
>>> back to the client.
>>>
>>> Any thoughts?
>>>
>>> Avraham
>>>
>>> _______________________________________________
>>> uWSGI mailing list
>>> [email protected]
>>> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
>>>
>>>
>>
>>
>> --
>> Mikko Ohtamaa
>> http://opensourcehacker.com
>> http://twitter.com/moo9000
>>
>>
>> _______________________________________________
>> uWSGI mailing list
>> [email protected]
>> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
>>
>>
>
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to