> Hi,
>
> I have been using uwsgi for a long while as an app server behind an apache
> frontend (it's been working pretty amazingly well, thanks !!)
>
> However, I am trying to migrate our infrastructure to a uwsgi proxy
> frontend for my websocket service.
>
> i.e., I have this app running:
>
> uwsgi --plugins=http,python,gevent_python27 --stats 127.0.0.1:9192
> --http-socket=127.0.0.1:9097 --uid=ws --gid=ws
> --file=/home/ws/websockets/app.py --gevent 1000 --buffer-size 60000
> --http-raw-body
>
> (it works fine when I access it locally from a  websocket client)
>
> and I have setup the following uwsgi proxy:
>
> uwsgi --plugins=http,router_http --shared-socket=x.x.x.x:443 --stats
> 127.0.0.1:9191 --https
> =0,/etc/ssl/certs/xxx-gandi.crt,/etc/ssl/private/xxx-gandi.key --uid=ws
> --gid=ws  "--route=^/c http:127.0.0.1:9096" "--route=^/i
> http:127.0.0.1:9097"
> --http-raw-body
>
> The proxy appears to be doing the ssl termination well because openssl
> s_client says so.
>
> I also see my browser making connections to the ws proxy with a 101 status
> showing up in firefox so I know that the ssl+ws handshake is succeeding.
>
> However, I also see:
> 1. my browser notifying my js of ws close events shortly after the
> connection is established
>
> 2. the uwsgi proxy displaying these error messages:
> [uwsgi-http key: xxx.com client_addr: xxxx client_port: 43218]
> hr_instance_read(): Connection reset by peer [plugins/http/http.c line
> 646]
>
> 3. tcpdumps on the server on lo (127.0.0.1) show that the tcp connection
> between the proxy and the app server is shut down from the proxy side (it
> sends the first FIN)
>
> 4. tcpdumps on the server on the main public interface show that the tcp
> connection between the browser and the proxy is shut down from the proxy
> side (it sends the first FIN)
>
>
> Sadly, I have not yet figured out why the uwsgi proxy is trying to so hard
> to close my ws connections.
>
> Any idea on how I might try to debug this further or suggestions on how I
> could tweak the configuration of my uwsgi proxy ?
>
> Mathieu
> --
>


Hi, the http: routing rule must be managed by workers, so you have:

https -> balancer-workers -> gevent websockets

i would enable gevent even for the balancer-workers too, otherwise with a
single worker you will not get any kind of concurrency

-- 
Roberto De Ioris
http://unbit.com
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to