On Mon, Feb 2, 2009 at 3:23 PM, Kacheong Poon <kacheong.poon at sun.com> wrote: > A belated reply... > > > Peter Tribble wrote: > >> What are you expecting the kstat namespace to look like? > > > Yes, I think this is the question we want to solicit > comments. In the current code under development, the > ILB kstat name space has three components. One is the > overall ILB stats, the following is the current stats > > > # kstat -m ilb -n global > module: ilb instance: 0 > name: global class: kstat > crtime 120.069249523 > ip_frag_dropped 0 > ip_frag_in 0 > num_rules 1 > snaptime 271.135933144
OK, two problems crop up. The first is that 'global' isn't a terribly useful name. What's wrong with naming this 'statistics'? The second is that if you were to follow the naming scheme below then you can't have a rule called 'global'. There's going to be the possibility of a name collision with any name you choose. > Then there is the rule stats. Given the rule name, one > can do a `kstat -m ilb -n <rule name>` to get it. Suppose > there is an ILB rule called telnet, the following is the > rule stats. > > > # kstat -m ilb -n telnet > module: ilb instance: 0 > name: telnet class: rulestat > bytes_dropped 0 > bytes_not_processed 0 > crtime 235.285750779 > icmp_dropped 0 > icmp_echo_processed 0 > icmp_too_big_dropped 0 > icmp_too_big_processed 0 > nomem_bytes_dropped 0 > nomem_pkt_dropped 0 > noport_bytes_dropped 0 > noport_pkt_dropped 0 > num_servers 3 > pkt_dropped 0 > pkt_not_processed 0 > snaptime 291.508981116 No, I wouldn't do it like this. I would have a kstat something like module: ilb instance: 1 name: rule class: rulestat rulename > As shown above, one can also use `kstat -m ilb -c rulestat` > to get stats of all rules. The kstats for a rule is > dynamically created when a new rule is added. > > The third component is the server stats for each back end > server in a rule. This is the question of this thread. > Continuing the above example with a telnet load balancing > rule with 3 back end servers, we are thinking to export the > following stats, > > > # kstat -m ilb -c telnet-sstat > module: ilb instance: 0 > name: 55 class: telnet-sstat > bytes_processed 0 > crtime 235.296354986 > ip_address ::ffff:82.0.0.55 > pkt_processed 0 > snaptime 325.31409978 > > module: ilb instance: 0 > name: 56 class: telnet-sstat > bytes_processed 0 > crtime 235.300426292 > ip_address ::ffff:82.0.0.56 > pkt_processed 0 > snaptime 325.314491603 > > module: ilb instance: 0 > name: 57 class: telnet-sstat > bytes_processed 0 > crtime 235.304316672 > ip_address ::ffff:82.0.0.57 > pkt_processed 0 > snaptime 325.314692033 > > > So one can use `kstat -m ilb -c <rule name>-sstat` to get > the stats for all servers of a rule. The name in the kstat > (55, 56 and 57 in the above example) is given by the user > to represent each server. If a server is used in multiple > rules, one can use `kstat -m ilb -n <server name>` to get > the stats of a server in different rules, assuming that the > user sets the server to the same name in each rule. The > question is on this name. > > We've considered using the IP address as the name so that > it is easy for a user to retrieve the stats of a server with > a specified address. And the user does not need to do any > mapping. While it is OK for IPv4 address, it is not possible > for IPv6 address due to the kstat name length. So we require > the user to specify a name. > > What we want to find out is if this is reasonable. We will > provide a command to "pretty print" available stats. But > we also want to provide a usable method via the kstat command > if sys admin wants to get the raw data. Hence the question. > > > -- > > K. Poon. > kacheong.poon at sun.com > > -- -Peter Tribble http://www.petertribble.co.uk/ - http://ptribble.blogspot.com/