Project

General

Profile

Actions

Idea #3826

closed

[Crunch] Display network activity in crunchstat

Added by Peter Amstutz over 9 years ago. Updated over 9 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
Crunch
Target version:
Start date:
10/10/2014
Due date:
Story points:
2.0

Description

(TC) sysfs provides traffic statistics. I tried this in a docker container, after doing a few pings:

# head /sys/devices/virtual/net/*/statistics/*_bytes
==> /sys/devices/virtual/net/eth0/statistics/rx_bytes <==
1116

==> /sys/devices/virtual/net/eth0/statistics/tx_bytes <==
1170

==> /sys/devices/virtual/net/lo/statistics/rx_bytes <==
168

==> /sys/devices/virtual/net/lo/statistics/tx_bytes <==
168
In order to read these stats from outside the container, use the "setns" syscall to set your network namespace to match the netns of any process inside the container. Close the filehandle after each use, though: otherwise it will keep the container alive after all processes exit.
  • Update: "setns" turns out to be complicated: e.g., threaded programs can't use it. Instead, we settle for parsing /proc/PID/net/dev after choosing an appropriate PID.

Subtasks 4 (0 open4 closed)

Task #4198: Review 3826-crunchstat-netstatsResolvedTom Clegg10/10/2014Actions
Task #4181: Collect container-level network statsResolvedTom Clegg10/10/2014Actions
Task #4225: Review 3826-crunchstat-netstats -- esp for language issuesResolvedTim Pierce10/10/2014Actions
Task #4152: Talk to WardResolvedTom Clegg10/10/2014Actions

Related issues

Related to Arvados - Bug #3843: [Crunchstat] Report CPU accounting numbers accurately.ResolvedTom CleggActions
Related to Arvados - Bug #4185: [Crunch] crunchstat memory reports seem suspect for multithreaded programsResolvedTom Clegg10/14/2014Actions
Blocked by Arvados - Bug #3824: [Crunch] crunch-job should create task execution environment inside docker container, not on worker host.ResolvedTom Clegg10/10/2014Actions
Actions

Also available in: Atom PDF