NETATOPD(8)

πŸ“¦ version 7.3.1, in nixos 26.05, nixpkgs unstable

πŸ’– netatopd β€” section 8, bestie πŸ’–

Okay so boom: this is the netatopd manual page, section 8, System Manager's Manual vibes. It's giving daemon-that-logs-network-stats-of-finished-processes realness. Periodt.

✨ NAME ✨

netatopd β€” log network statistics of finished processes.

πŸ¦‹ DESCRIPTION πŸ¦‹

This page is the whole lore drop on the netatopd daemon: it reads the counters of exited processes delivered by the netatop module and writes those counters to a logfile.

The 'usual' state of this daemon is the getsockopt() command NETATOP_GETCNT_EXIT. With this command, netatopd blocks until an exited task is available on the exitlist of the netatop module. The obtained netpertask struct that contains the counters of an exited process is written to a logfile (similar to the process accounting info provided by the base kernel itself). The daemon stops logging when there is only 5% of free space left in the filesystem of the logfile.

🚨 Bestie, that 5% free-space thing is the cutoff: when the logfile's filesystem has only 5% free space left, netatopd stops logging. Not me making the rules β€” that's the page.

The logfile starts with a small header struct that contains a.o. a sequence number indicating how many netpertask structs are currently logged. This header is mmapped and can be consulted by analysis processes like atop that consult the logfile. Behind the header, the netpertask structs can be found in compressed form. Every compressed netpertask struct is preceded by one byte specifying the size of the compressed netpertask struct.

Before an analysis process starts using the logfile, it has to subscribe itself by decrementing a semaphore owned by the netatopd daemon. In this way, netatopd knows how many analysis processes are currently using the logfile. When no processes use the logfile any more, netatopd truncates the logfile and starts building a new one as soon as a new subscription of an analysis process is noticed.

πŸŽ€ FILES πŸŽ€

  • /var/run/netatop.log β€” file in which netatopd writes the compressed accounting records about processes that have finished.

🌈 SEE ALSO 🌈

πŸ‘‘ AUTHOR πŸ‘‘

Gerlof Langeveld (gerlof.langeveld@atoptool.nl)


πŸ’– That's the whole serve, bestie: Linux, October 2012, and this iconic NETATOPD(8) moment. Bye! πŸ’–

πŸ“¦ where this page comes from