LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: What is "load"? Monitoring, load-informed scheduling and so on..

To: Chetan Ahuja <ahuja@xxxxxxxxxxxxxxxxx>
Subject: Re: What is "load"? Monitoring, load-informed scheduling and so on..
Cc: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
From: Julian Anastasov <uli@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 2 Jul 2000 11:04:15 +0300 (EEST)
        Hello,

On Sat, 1 Jul 2000, Chetan Ahuja wrote:

> Hi,
> I've been a lurker here on this list. This is my first post... but I've
> been tracking  the list off and on for the past year or so.
> 
>   There's been  talk of a Monitoring framework for LVS here for
> the past 6 months or so. Also the TODO list on the web page has included  
> a Load-informed scheduling scheme for a long time now. I might implement 
> that as a Masters project in computer science to be done this summer and
> fall. I'm preparing a small presentation for my group to discuss the idea.  
> Right now my main focus is on the following question:
>  
>  What exactly constitutes "Load" on a real server and how often should it
> be measured? 

        Only the LVS user can decide what is "Load" and what
is  the preferred period to update its values. The different
real services change different parameters in the real hosts.
We  have to allow the user  to select which parameters to be
monitored for each real service.

> 
>  I know there are a lot of people on this list who have been using LVS for
> a variety of applications. Do you guys think a load informed scheduling
> scheme would be useful ?

        Yes! Any other opinions?

>    If yes, what kind of things should be measured as "load". The astute
> reader would shoot back immediately with stuff like CPU, memory and
> network load. Let's treat them one by one:

        Yes,  the user  will like to  build expressions from
many  parameters. The result from the expression will be the
real server's weight (WRR scheduling method). For example:

weight=cpuidle_in_percents+freeram_megabytes+
        cached_megabytes+buffers_megabytes

> 
> (All of the following is assuming that the realservers are runnig linux.
>   At least  I'm going to deal with only such cases for now)
> 
> 1) CPU: How good is polling  /proc/loadavg? My problem with that is the
>   load  introduced by the measurement itself if polling is done too often.

        5  seconds is  not fatal.  20 real  servers mean the
director  will receive 4infos/sec. The  weight for each real
service  will be changed on each  5 seconds smoothly. And if
some  parameters are not selected  in the expression you can
skip  to get their values from  the kernel (to save some CPU
cycles).   Some of the  values can be  averaged for the used
period.   But  warning!  We  need  some  optimizations:  the
generated  info can be used from  many directors, so it must
be  generated only  once. For example,  such simple protocol
can be used:

director -> RS:
                        interval 5
                        get loadavg, freeram, freeswap

        i.e. register for these parameters


On each 5 seconds:
RS -> director:         loadavg=10.0
                        freeram=100
                        freeswap=128

        "Here  are the values,  evaluate the expressions for
all my real services on all virtual services"

> 
>         Besides, how good is the info in loadavg?   Doesn't it just
>  measure  the number of processes in the queue every few  milliseconds or
>  so to calculate the load. One could argue  (and many  people do argue)
>  that this is not a good metric of CPU load. Any ideas ??

        Yes,  loadavg is not good for web and the other well
known  services.   But  the  user still  can  run  some real
services  that eat CPU. If the  loadavg can be high the user
can select it as load parameter.

> 
> 2) Memory: We could just do  what free command does (which is
>    just   reading   /proc/meminfo). Is that good enough. Anybody see any
>    pitfalls in that approach?  Of course, polling /proc too often is again
>    a problem here. Besides that ??

        Yes,  you  can  create  many  load  parameters  from
/proc/meminfo.   Even "Cached" and "Buffers" are useful. And
sometimes  it is faster to open  and read from /proc than to
to read the parameters one by one by using other interfaces.

> 
> 3) Network: This is the hardest one. What would be a good metric of
>   network  load... number of alive TCP connections??  Is that good
>   enough... I'm not deeply familiar with the kernel networking code. Could
>   somebody who is more familiar would throw some more light on this....

        You  can try with /proc/net/dev. There are bytes and
packets for each interface but the drawback is that they are
sometimes zeroed and the interfaces sometimes disappear :)

> 
> 
>    I'm eagerly looking forward to a good discussion on these topics...
> Please feel free to send me a direct email if you don't want to send one
> to the list.

        The list is a good place for such discussion :)

        More ideas:

- use ioctls to add/delete LVS services/destinations

- use  all kinds of virtual services, forwarding methods and
scheduling  methods (configured from the user). IOW, all LVS
feauters.

- user  space tool to manage the config file and the network
interfaces/routes/settings. For example:

<tool> start <domain>   send gratuitous ARP, set ifaces, etc
<tool> stop <domain>    stop ifaces, etc
<tool> secondary <domain>       role: director -> real server
<tool> primary <domain>         role: real server -> director

- call  scripts to play with policy routing and other kernel
settings, etc.

- support for backup directors working as real servers

But there are LVS users with different needs and experience.
I'm ready for discussion :)

> 
>   Chetan Ahuja
>   Masters student in Comp. Sci.
>   Mich. State Univ.


Regards

--
Julian Anastasov <uli@xxxxxxxxxxxxxxxxxxxxxx>



<Prev in Thread] Current Thread [Next in Thread>