> 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:
>
>

Well, the best approach seems to have a subscription server that send its
data (domain names and backends) to varnish via its admin protocol.

Varnish will continue to directly connect to uWSGI instances (in native
http mode) but its configuration will be constantly upgraded/adapted by
this additional (and very cheap) process.

At low level it will became something like this:

uWSGI node1 subscribe to subscription server
uWSGI node2 subscribe to subscription server

subscription server constabtly check if something is changed and
eventually generate a new director stanza for varnish and will update it
via its internal admin protocol.

Someone interested in this kind of plugin ? Maybe we could follow a more
generic approach and execute custom code in a dumb subscription server:

def status_change(domain_name):
    # something is changed for domain domain_name
    # get the node list from the 'dumb' subscription server
    nodes = uwsgi.get_subscription_nodes('dumb',domain_name)
    # generate and send to varnish (or you could do whatever you want)
    send_to_varnish("""
director foobar {
    backend node1 {
        ....
        ....
    }
}
""")

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

Reply via email to