[Linux-ha-dev] [hack] Packet statistics for heartbeat!
Lars Marowsky-Bree
lmb at suse.de
Wed Feb 23 15:15:08 MST 2005
Hi all,
the following evil one liner will throw in a once-per-second message of
the number of packets & data size sent into the heartbeat logs. If run
on any of the nodes (and using broadcast), this will give you a pretty
good idea of the network load we incur at any given stage:
tcpdump -lnqi eth1 -tt udp port 697 | perl -ne 'BEGIN { $|=1; $sum=0; $t0=time; $c=0; } @a=split; $t=int(shift @a); $s=pop @a; if ($t > $t0) { print "Bytes: $sum Packet count: $c\n"; $t0=$t; $c=0; $sum=0; } $sum+=$s; $c++;' | logger -p local7.info -t traffic
Of course, adjust the filter port and logging facility et cetera to
please.
This, or something similar if someone wants to hack a C equivalent ;-),
will give us a good idea of whether we're anywhere close to hitting
bandwidth limits. Right now, in an 8 node cluster, it looks like we're
doing a whopping 20kb/s (or 85 packets/s) during the election phase, and
nothing bigger than that.
Sincerely,
Lars Marowsky-Brée <lmb at suse.de>
--
High Availability & Clustering
SUSE Labs, Research and Development
SUSE LINUX Products GmbH - A Novell Business
More information about the Linux-HA-Dev
mailing list