LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: [Linux-ha-dev] Re: LVSM inital beta release

To: linux-ha-dev@xxxxxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [Linux-ha-dev] Re: LVSM inital beta release
Cc: lvs-users@xxxxxxxxxxxxxxxxxxxxxx, linux-cluster@xxxxxxxxxxxx, lvsm@xxxxxxxxxx
From: bmartin@xxxxxxxxxxxxxxxxxxxx
Date: Wed, 23 May 2001 10:35:02 -0700
On Wed, May 23, 2001 at 09:23:09AM +0200, Roberto Nibali wrote:
> > What does LVSM offer?
> > 
> >  - Level 4 switching with LVS
> >  - High Availabity with heartbeat
> >  - Service Level monitoring with mon
> >  - Web based gui
> >  - On the fly configuration
> >  - Cluster Statistics reporting
> > 
> > The LVSM homepage is at http://lvsm.theory.org
> 
> Cool, yet another cluster manager software :)
>  
> > Please send any questions / feedback / complaints to the
> > lvsm mailing list at lvsm@xxxxxxxxxxx
> 
> Ok, I just downloaded the code, extracted it and had a 15 minute look
> at it (random stuff I would complain about):
> 
> o It's very difficult to understand the code:
>       - indentation is only 2 chars
>       - c++ , just kidding :) [very advanced c++ for me!]
>       - some prototype definitions are missing or should go into *.h files
>           e.g, Select.cc is ugly as it gets :))

Well, I suppose readability is subjective, but I'm sorry you find my
code hard to read.  

I'm one of those people who thinks 2 space indentation is a good thing :)

Also I like c++.  I know most free projects disavow c++ but I think it 
has gotten a bad rap.  I feel I have used basic c++ features such as 
templates and inheritance appropriately.     

And yes, Select.cc is an ugly hack.  You seem to be good at finding them :)   

> o Why do you use the ``ipchains -L -vnx --line-numbers'' approach to get the
>   statistics? [ipchains_stats.cc]:
> 
Well, let's just say it's a first cut.

>   if(use_chains) 
>     ipch = popen("/sbin/ipchains -L -vnx --line-numbers", "r");
>   else
>     ipch = popen("/sbin/iptables -L -vnx --line-numbers", "r");
> 
>   fgets(buf, 4096, ipch);
>   keep_going = true;
>   char * ptr = NULL;
>   int c = 0;
>   while(keep_going) {
>     if(strstr(buf, "Chain ")==buf && strstr(buf, chain) - buf == 6) {
>       fgets(buf, 4096, ipch);
>       fgets(buf, 4096, ipch);
>       while(strstr(buf, "Chain")!=buf) {
>       if(num_rules == c) {
>         if(use_chains) {
>           ptr = strchr(buf, '-');
>           if(!ptr) {
>             l->log(LL_WARN, "couldn't find str '-' in buf '%s'\n", buf);
>           }
>         } else {
>           ptr = buf; // aye aye aye..  /\d+[^\d+]\d+[^\d+]\d+\s+/
>           while(isdigit(*ptr)) ptr++;
>           while(!isdigit(*ptr)) ptr++;
>           while(isdigit(*ptr)) ptr++;
>           while(!isdigit(*ptr)) ptr++;
>           while(isdigit(*ptr)) ptr++;
>           while(isspace(*ptr)) ptr++;
>         }
>         break;
>       }
>       c++;
>   
> o very interesting code, but very CPU intensive! I have 15000 iptables rules,
>   and all together 5000 concurrent connections -> iptables -L -vnx is a pain
>   in the ass, that's why we have /proc/net/ip_masq/vs_stats.

Ok, yes I see your complaint with ipchains now.  That is a _lot_ of rules.
The stats are modular so I will write one for /proc/net/ip_masq/vs_stats 
(already on my TODO)

> o you plvsd daemon is not really portable to other architectures or at least
>   it takes quite some time: You seem to use the pthreads in a way Plan9 or
>   HP/UX would not support them. You assume, everybody is running Linux as
>   real servers.

Well, portability was not an initial design goal.  Also, I work at a linux
shop and have only linux at home so I develop for linux.  

My use of pthreads is sparing, and only once do I call pthread_create().
I'm not really sure why other OS's that claim to have pthread support 
would not work.

> o not everybody has the pidof(8) installed on the system, but everybody for
>   sure has ps. Generally, make sure you use basic Unix tools and not for
>   example distro-specific tools.
> 
Well, at the end of the INSTALL file is a known problems section.  This is
listed :)

The init scripts are for redhat now.  Sucks but writing them portably is
really hard.  Yes everyone has ps but the switches are different in many
places.

Did I mention I hate shell scripting :)

Anyways, thanks for your input.

Brian


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