Measure traffic across private network

I have a number of web nodes that only serve data across private IP. Is there a way I can measure the traffic on port 80 between specific nodes.

The aim is measure how much each node uses out of the pooled public bandwidth.

6 Replies

Well, the graphs in the manager show private traffic on its own (and combined with everything else), so if you look at each web node's graphs…

Add iptables rules with no actions:

iptables --append INPUT --destination 192.0.2.0/24 --destination-port 80
iptables --append OUTPUT --source 192.0.2.0/24 --source-port 80

… will catch all traffic involving the local machine talking to web servers in 192.0.2.0/24. Adjust address and ports and --destination-port vs. --source-port accordingly.

Then, "iptables -L -n -v -x" will show the cumulative packet and byte counts for that rule. Sic something like munin on it and you're in the gravy boat.

EDIT: And indeed, if it's only the bandwidth quota you care about, the graphs and counters on the Linode manager already account for this.

@hoopycat:

Add iptables rules with no actions:

iptables --append INPUT --destination 192.0.2.0/24 --destination-port 80
iptables --append OUTPUT --source 192.0.2.0/24 --source-port 80

… will catch all traffic involving the local machine talking to web servers in 192.0.2.0/24. Adjust address and ports and --destination-port vs. --source-port accordingly.

Then, "iptables -L -n -v -x" will show the cumulative packet and byte counts for that rule. Sic something like munin on it and you're in the gravy boat.

EDIT: And indeed, if it's only the bandwidth quota you care about, the graphs and counters on the Linode manager already account for this.
For example, linode panel graph shows private out average of 362.23 kb/s for the last 30 days. This is about 120GB. However, I can't tell from that how much of the data ended up leaving the private network. I appreciate that (given my calculation is correct) this is within a 512 node. But the busy period is expected in about 6 weeks.

I'm using ufw to manage my iptables. Presumably ufw will barf any rules added directly via iptables?

I thought that traffic across the private network did not count against your bandwidth allotment. Also, bandwidth is pooled across all your nodes, so if you have 2 512 nodes, you actually have 400GB of bandwidth total, not 200GB for each node.

If my understanding is correct, the servers talking on the private network only won't ever count against your bandwidth allotment.

@waldo:

I thought that traffic across the private network did not count against your bandwidth allotment. Also, bandwidth is pooled across all your nodes, so if you have 2 512 nodes, you actually have 400GB of bandwidth total, not 200GB for each node.

If my understanding is correct, the servers talking on the private network only won't ever count against your bandwidth allotment. I have two public facing nodes with failover IP that route traffic onto backend nodes over private network. I want to know how much each backend node contributes to the overall public bandwidth usage.

You could use ufw to set an allow rule for the traffic you want to log; I think ufw will pretty-print the iptables counters with one of the status commands, too.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct