> Dnia Åroda, 14 wrzeÅnia 2011 o 20:19:45 Roberto De Ioris napisaÅ(a): >> > BTW is subscription server single process? Can I have multiple SS >> > processes >> > listening on single port? >> >> You can spawn an unlimited number of fastrouter simply adding multiple >> --fastrouter <socket> >> >> uwsgi --fastrouter :3031 --fastrouter :3032 --fastrouter :3033 >> >> is perfectly valid and will ends with 3 fastrouter >> >> You can share sockets too using --shared-socket feature >> >> uwsgi --shared-socket :3031 --fastrouter =0 --fastrouter =0 --fastrouter >> =0 >> >> means: spawn 3 fastrouter bound on first shared socket > > I'm a little bit lost, You are talking about "--fastrouter" here and I my > question was about "--http-subscription-server" (I didn't asked it > clearly). > If I understand correctly "--fastrouter-*" options are for loadbalancing > when > upstream talks to the uwsgi socket using WSGI protocol, and "--http- > subscription-server" is used when upstream talks using HTTP protocol. > I can't repeat "--http-subscription-server" option (only last value is > used), > so I'm limited to single process that is doing load balancing and if I > want to > handle big traffic I need to be able to use all cpu cores. > I can just run multiple uwsgi instances on different ports and subscribe > my > backends to all of them, but maybe there is smarter way. > > I'm thinking about setup like this: > > varnish -> uwsgi --http :8080 --http-subscription-server :2626 -> uwsgi -- > emperor /apps/ > > This way I could start as many backends as needed without touching varnish > config, which is great because it allowes me to dynamically manage amount > of > backends (or even automate it a bit) for given web app. > I could put nginx between varnish and uwsgi but it seems pointless to me, > it > would be just another layer that does nothing usefull since uwsgi can do > the > same, and it's not exposed directly to clients since it's behind varnish. > But AFAIK varnish can't speak WSGI (after all it's not job for reverse > proxy) > so I need to expose uwsgi load balancing over HTTP. > If I'm wrong than please correct me, after reading [1] and [2] I'm not > totally > sure if I understand the differences between those two right. >
Hi, the fastrouter and the http-router (the one you run with --http) share 90% of the code base, but if i understand correctly, you are trying to directly connect uWSGI to varnish. Using the http-router is not needed as recent uWSGI can natively speak http using the --http-socket option (instead of --socket or --http): http://projects.unbit.it/uwsgi/wiki/Example#varnish It would be probably possibile to extend varnish to be "subscription-friendly" with a plugin. I will let you know asap. -- Roberto De Ioris http://unbit.it _______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
