LB logic

1 view
Skip to first unread message

myke

unread,
Jun 11, 2008, 12:31:23 PM6/11/08
to scalr-discuss
Using the scalr.net interface, I have a app server with a min LA of
1.0 and max LA of 2.0.
Executing cpuburn on the launched app server drives the load up to 2.0
and a new instance is launched.

The weird thing is that once that new server is added to the load
balancer, the old app instance is terminated. Why is that?

I would expect it to keep both machines in the pool and keep adding
more as load continues to increase.

Thanks

Alex Kovalyov

unread,
Jun 11, 2008, 12:45:35 PM6/11/08
to scalr-discuss
This is a good question.
It happens because once your second instance is launched, load failes
down to minLA, and scalr downscales your role.
In real life, it is pretty much applicable - you had a traffic spike,
then its gone and you no longer need all instances that were started
to handle it.

The practical advice is: Set the appropriate difference between MinLA
and MaxLA.

myke

unread,
Jun 11, 2008, 12:49:39 PM6/11/08
to scalr-discuss
Alex,
Thanks for the reply. That's what I thought was happening but since
scalr is looking at the 15min LA, won't that almost always cause the
new instance to be below the 1.0 minimum LA allowed?

I would imagine that a new instance shouldn't be controlled by the
min/max LA until it's been up for 10 minutes or so (unless scalr
starts looking at the 1min LA)

Alex Kovalyov

unread,
Jun 11, 2008, 1:37:07 PM6/11/08
to scalr-discuss
Scalr actually looks for cumulative LA on entire role. This is
(LA1+LA2)/2 in case of two instances.
So, say, your 1st instance overloads, and LA is 3.
2nd is started, its load is 0.3. The cumulative LA on the role is 1.65
After some time, when requests are spreaded between roles, LA on both
instances will be ~1.5. And cumulative LA will be 1.5.

So what I was trying to say is since you ran a synthetic test, you
need to carefully think out a difference between MinLA and MaxLA.

We're open for suggestions... I have a feeling that we should make
this formula non-linear.
> > > Thanks- Hide quoted text -
>
> - Show quoted text -

myke

unread,
Jun 11, 2008, 4:27:02 PM6/11/08
to scalr-discuss
So I have both min&max LA's set to 1.0 (lowest possible setting).

In theory, if I run the first app server up to 3.0, after the second
app server comes up (with a load of 0 initially) the cumulative LA
would be 1.5 and should not shutdown the first app server - it does.

Does the logic have a divide by 0 problem? Or am I just confused
somewhere.

What I would personally like to see is that the calculation is done on
the 5 minute LA, and once a new instance is launched any shutdown on
that role would be frozen for the first 5 minutes. It would be
quicker to scale up, and slower to scale down . Also (especially for
the small instance) that the min/max LA #'s could be less then 1.0

Thanks

Alex Kovalyov

unread,
Jun 12, 2008, 7:37:00 AM6/12/08
to scalr-discuss
Would you imagine.. there was an error in algo. It was fixed, and you
are now able to set LAs lower than 1.00.
Thanks for helping us find it.
> > > - Show quoted text -- Hide quoted text -
Reply all
Reply to author
Forward
0 new messages