IPtables: How to Count Bandwidth Consumed by Local Alice Memcache
Due to last issues with memcache in Our Server, we need to count bandwidth consumed by local memcached instances (alice one for now).
This can be done by adding needed rules to iptables:
Get INPUT
iptables -I INPUT -p tcp -s 127.0.0.1 --sport 11211 -j ACCEPT
Get OUTPUT
iptables -I OUTPUT -p tcp -d 127.0.0.1 --dport 11211 -j ACCEPT
[[email protected] user]# iptables -I OUTPUT -p tcp -d 127.0.0.1 --dport 11211 -j ACCEPT
[[email protected]@web09 epetrenko]# iptables -I INPUT -p tcp -s 127.0.0.1 --sport 11211 -j ACCEPT
Checking - Confirmation
[[email protected] user]# iptables -nvL
Chain INPUT (policy ACCEPT 2211 packets, 1074K bytes)
pkts bytes target prot opt in out source destination
189 12405 ACCEPT tcp – 127.0.0.1 0.0.0.0/0 tcp spt:11211
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 2359 packets, 904K bytes)
pkts bytes target prot opt in out source destination
707 485K ACCEPT tcp – 0.0.0.0/0 127.0.0.1 tcp dpt:11211