Score:1

systemctl status not showing (block) IO, systemctl show showing invalid values for IO

mv flag

I'm using Ubuntu 20.04. I'm trying to get IO and BlockIO for the postgres process (and all its children).

`systemctl status [email protected]`  

shows memory and CPU time used, but not IO:

[email protected] - PostgreSQL Cluster 14-main
     Loaded: loaded (/lib/systemd/system/[email protected]; enabled-runtime; >
     Active: active (running) since Tue 2021-12-14 17:13:19 WET; 2min 21s ago
    Process: 1285 ExecStart=/usr/bin/pg_ctlcluster --skip-systemctl-redirect 14>
   Main PID: 1395 (postgres)
      Tasks: 11 (limit: 37513)
     Memory: 263.2M
        CPU: 32.372s
     CGroup: /system.slice/system-postgresql.slice/[email protected]
             ├─1395 /usr/lib/postgresql/14/bin/postgres -D /var/lib/postgresql/>
             ├─1442 postgres: 14/main: checkpointer
             ├─1444 postgres: 14/main: background writer
             ├─1445 postgres: 14/main: walwriter
             ├─1446 postgres: 14/main: autovacuum launcher
             ├─1447 postgres: 14/main: stats collector
             ├─1448 postgres: 14/main: TimescaleDB Background Worker Launcher
             ├─1449 postgres: 14/main: logical replication launcher
             ├─1450 postgres: 14/main: TimescaleDB Background Worker Scheduler
             ├─1453 postgres: 14/main: TimescaleDB Background Worker Scheduler
             └─5990 postgres: 14/main: postgres tsenergydata 127.0.0.1(55312) I>

First, I tried the following:

  1. Under /etc/systemd/system.conf, I set the IO Accounting options to yes:

DefaultIOAccounting=yes

DefaultBlockIOAccounting=yes

  1. and then reboot the system.

However, it does not seem to make a difference. The IO is not shown.

Then, I've tried systemctl --all --full show [email protected]:

  • The output actually does show values for I/O: IOReadBytes=18446744073709551615 IOReadOperations=18446744073709551615 IOWriteBytes=18446744073709551615 IOWriteOperations=18446744073709551615
  • However, these values do not seem to make any sense (seems to be in the petabyte region). I've done nothing but start up postgres. This can't generate anywhere close so much IO, surely. Moreover, the values for reads, writes and operations are all identical, which seems suspicious.
  • The values shown by systemctl show for CPU and memory are identical to the values shown using the systemctl status command. So not all values are off the charts.

Is there a way to get the IO of a particular service (even if that service uses multiple processes)?

I'm looking for something more straightforward than looping through proc/$pid/io and adding up the read/writes for each related process.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.