> Dnia wtorek, 29 listopada 2011 12:19:02 Łukasz Mierzwa pisze:
>> Dnia wtorek, 29 listopada 2011 11:47:35 Roberto De Ioris pisze:
>> > > Hi,
>> > >
>> > > I'm doing some stress test of uWSGI with 3 servers:
>> > >
>> > > nginx -> uwsgi fastrouter -> 2x uwsgi backend
>> > > (nginx and fastrouter are on same server)
>> > >
>> > > and one backend gets 2x more requests. I've tested it with apache
benchmark
>> > > using:
>> > >
>> > > ab -n 10000 -c 1 -H "Host: app.domain.com"
>> > > "http://$nginx_address/$some_url";
>> >
>> > Ok, just committed the fix for round robin and the support for
>> gathering
>> > statistics from the fastrouter.
>> >
>> > Some info for more "obscure" field:
>> >
>> > reference: is the amount of currently running requests for this node
>> >
>> > death_mark: if 1 this node is dead but there are still requests
>> hanging
>> > on it (it will be completely deleted after the last requests will
timeout)
>> >
>> > last_check: the last timestamp on which the node has been announced
>>
>> It works well and round robin not works, each node got 500 requests.
But during first test I've managed to put fastrouter into infinite
loop, unfortunately I can't reproduce it so I'll just discribe how I
got this bug:
>>
>> 1. I've upgraded uWSGI, added fastrouter-stats and restartet both workers
>> and fastrouter
>> 2. I've started ab as before
>> 3. immediately I've run curl "fasterouter_ip:fastrouter-stats_port" and
I've
>> got:
>
> [...]
>
> my fastrouter config:
>
> [uwsgi]
> shared-socket = 127.0.0.1:2500
> fastrouter = =0
> fastrouter = =0
> fastrouter-subscription-server = :2626
> fastrouter-stats = :2580
>
> I'm running it using 2 shared sockets, maybe it's related to it.
>
> Łukasz Mierzwa
>

Ok, i have found (and fixed) the bug.
The list of of hostnames is auto-optmized at each access. Under some
conditions the pointer to the next slot could point to the first slot
causing a loop. I have added a check for this case in both the slot getter
and the stats server.

As a side note, specifying multiple fastrouter option will lead to only
bind to multiple address. It will not spawn a new process as the old
fastrouter. You can remove it. After 1.0 i will add multithreading support
(no need to have another process) to the fastrouter to gain advantage in
SMP environments.

-- 
Roberto De Ioris
http://unbit.it



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

Reply via email to