Re: Roundrobin can not work well when a server's weight is 256

2013-07-23 Thread Godbach
2013/7/22 Willy Tarreau > On Sun, Jul 21, 2013 at 10:56:26PM +0800, Godbach wrote: > > On 2013-7-21 16:53, Willy Tarreau wrote: > > >Hi Godbach, > > > > > >I carefully checked and for me we can set SRV_UWGHT_MAX to > SRV_UWGHT_RANGE. > > >It will have the effect of limiting the maximum number of

Re: Roundrobin can not work well when a server's weight is 256

2013-07-23 Thread Godbach
2013/7/21 Godbach > On 2013-7-21 21:17, Willy Tarreau wrote: > >> No, I really mean UWGHT_MAX set to UWGHT_RANGE since it is used to >> fix set highest user weight that can be set. >> >> Willy >> >> >> > Yeah, I get what you meant now. With the following fix: > > diff --git a/include/types/server

Re: Roundrobin can not work well when a server's weight is 256

2013-07-22 Thread Willy Tarreau
Hi Godbach, On Mon, Jul 22, 2013 at 08:25:44AM +0800, Godbach wrote: > Hi Willy, > I have merged all four patches into a single one according to your > suggestion. If you have not megered them yet, the new patch can be usefull > and please do any change in case that anything necessary. Perfec

Re: Roundrobin can not work well when a server's weight is 256

2013-07-21 Thread Willy Tarreau
On Sun, Jul 21, 2013 at 10:56:26PM +0800, Godbach wrote: > On 2013-7-21 16:53, Willy Tarreau wrote: > >Hi Godbach, > > > >I carefully checked and for me we can set SRV_UWGHT_MAX to SRV_UWGHT_RANGE. > >It will have the effect of limiting the maximum number of servers a full > >weight to 4095 instead

Re: Roundrobin can not work well when a server's weight is 256

2013-07-21 Thread Godbach
On 2013-7-21 16:53, Willy Tarreau wrote: Hi Godbach, I carefully checked and for me we can set SRV_UWGHT_MAX to SRV_UWGHT_RANGE. It will have the effect of limiting the maximum number of servers a full weight to 4095 instead of 4128 (so please update the doc for this). It is also used in the lea

Re: Roundrobin can not work well when a server's weight is 256

2013-07-21 Thread Godbach
On 2013-7-21 21:17, Willy Tarreau wrote: No, I really mean UWGHT_MAX set to UWGHT_RANGE since it is used to fix set highest user weight that can be set. Willy Yeah, I get what you meant now. With the following fix: diff --git a/include/types/server.h b/include/types/server.h index b58a062..

Re: Roundrobin can not work well when a server's weight is 256

2013-07-21 Thread Willy Tarreau
On Sun, Jul 21, 2013 at 06:28:00PM +0800, Godbach wrote: > On 2013-7-21 18:16, Godbach wrote: > > On 2013-7-21 16:53, Willy Tarreau wrote: > >> Hi Godbach, > >> > >> That's quite a good analysis. I'm realizing that durnig the development > >> of the algorithm, the maximum weight was 255, and it was

Re: Roundrobin can not work well when a server's weight is 256

2013-07-21 Thread Godbach
On 2013-7-21 18:16, Godbach wrote: > On 2013-7-21 16:53, Willy Tarreau wrote: >> Hi Godbach, >> >> That's quite a good analysis. I'm realizing that durnig the development >> of the algorithm, the maximum weight was 255, and it was later >> changed to >> 256. The test code that was used for this is

Re: Roundrobin can not work well when a server's weight is 256

2013-07-21 Thread Godbach
On 2013-7-21 16:53, Willy Tarreau wrote: Hi Godbach, That's quite a good analysis. I'm realizing that durnig the development of the algorithm, the maximum weight was 255, and it was later changed to 256. The test code that was used for this is still in tests/filltab25.c if you're curious. It dis

Re: Roundrobin can not work well when a server's weight is 256

2013-07-21 Thread Willy Tarreau
Hi Godbach, On Sat, Jul 20, 2013 at 06:45:14PM +0800, Godbach wrote: > Hi Willy, > > I have done a test for haproxy on latest snapshot which has two servers > with such key configuration > lb algo is roundrobin > server A: weight 128 > server B: weight 256 > > I sent 9 requests and the order for

Roundrobin can not work well when a server's weight is 256

2013-07-20 Thread Godbach
Hi Willy, I have done a test for haproxy on latest snapshot which has two servers with such key configuration lb algo is roundrobin server A: weight 128 server B: weight 256 I sent 9 requests and the order for getting responses from server is expected as: BBABBABBA But I got the unexpected order