Hi all, the attached patch (against current svn trunk) add a very specific feature to the uWSGI handler. I do not know if it so "specific" that it cannot be included, so i will try to explain its usage (requesting for comment/opinion)
Unix sockets have a specific (and amazing) feature that allows you to pass a file descriptor (a socket in our case) to another process: The client 0 send a connection request to server 1 server 1 accept the request and open a new socket with client 0 client 0 send a http request to server 1 server 1 receive the request and connect to a source (a uWSGI server) server 2 (the uWSGI server) accept the connection and open a new socket (server1 <-> server2) server 1 send the uwsgi header to server 2 and pass the socket of client 0 server 2 attach this socket and from now on it directly communicate with the client 0 In my company we are using this feature for 2 kind of apps. The first one is a icecast compatible server written on uWSGI api. Cherokee receive the standard http header from the icecast producer, pass the encoded vars to the uWSGI server, then uWSGI start communicating directly with the client (that will start sending audio data) The second one is a WebSocket implementation. The client (google chrome) send the http websockets header to Cherokee. Cherokee pass it to uWSGI and than uWSGI start websockets communication with google chrome. Another (probably less specific) feature, is boosting the performance of app response, as the uWSGI->cherokee->client path is substituted with uWSGI->client It currently works reliabily in our projects, but closing the socket soon after the write() will clobber a bit Cherokee logging system (and probably some other internal, but for now we have no crash :) ) so, i imagine that we should add a condition to Cherokee when the connection to source does not expect a response. Thanks a lot for every kind of response. -- Roberto De Ioris http://unbit.it
cherokee_uwsgi_pass_fd.patch
Description: Binary data
_______________________________________________ Cherokee mailing list [email protected] http://lists.octality.com/listinfo/cherokee
