PostgresSQL im Container weckt HDD auf. Wie finde ich die Ursache

fowr0yl

Member
Mar 15, 2022
41
7
8
63
Braunschweig
Hallo,
ich habe mehrere Container laufen. Mache auch mit bind mounts. Alle Platten eines zusätzlich installierter ZFS Pools gingen bislang auch immer schön brav in den Standby Modus, wenn sie nicht genutzt werden. Es handelt sich also nicht um ein generelles Problem.

Jetzt habe ich einen zusätzlichen Container "DBS" mit einer PostgreSQL Datenbank installiert. Der "data" Pfad der Datenbank ist ebenfalls über einen bind-mount nach /zPool/postgres eingebunden.

Code:
mp0: /zPool/postgres,mp=/zPool/postgres,shared=1,replicate=0

Das Verzeichnis, in das Postgres seine Statistiken schreibt, habe ich angepasst, so das damit auch keine Schreibzugriffe auf das gemountete DataSet erfolgen.
Code:
[root@DBS ~]# cat /zPool/postgres/data/postgresql.conf |grep stats_
#stats_temp_directory = 'pg_stat_tmp'
stats_temp_directory = '/run/postgresql'

Wenn ich in dem Container nachsehe, welche Dateien sich geändert haben, sehe ich das sich innerhalb der letzten halben Stunde erwartungsgemäß keine Dateien geändert haben.
Code:
[root@DBS ~]# find /zPool/ -mmin -30 -type f -exec ls -l {} +

Wenn ich jetzt die Festplatten in den standby schicke, dann passiert das zunächst auch wie gewünscht.
Code:
root@pve:/# hdparm -y /dev/sda /dev/sdb /dev/sdc
/dev/sda:
 issuing standby command
/dev/sdb:
 issuing standby command
/dev/sdc:
 issuing standby command

root@pve:/# hdparm -C /dev/sda /dev/sdb /dev/sdc
/dev/sda:
 drive state is:  standby
/dev/sdb:
 drive state is:  standby
/dev/sdc:
 drive state is:  standby

Nach ca. 10 Sekunden sind die Platten aber wieder im active/idle Modus.
Stoppe ich den PostgreSQL Server in dem Container, so bleiben die Platten schön im standby.

Klar ist also, das PostgreSQL oder die drum herumlaufenden Prozesse die Platten irgendwie wieder aktiviert.

Wie kann ich denn jetzt herausbekommen, welcher Prozess dafür verantwortlich ist?
Und muss ich das innerhalb des Containers, oder auf dem Host prüfen?

Alles was ich dazu bislang gefunden habe, hat mich nicht weiter gebracht :(
 
Last edited:
Installier dir mal die inotify tools mit "apt install inotify-tools" und dann schau mir "inotifywait -mr /zPool/postgres" was da so passiert. Inotify zeigt dir alle Dateisystem actions an.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!