Getting abnormal I/O usage Postgresql and JBD2

928 views Asked by At

I am currently working on an EC2 instance on AWS with EBS volume and I got an alert because I have constant I/O consumption even when server is idling.

the iotop command shows:

TID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN      IO    COMMAND
160 be/3 root          0.00 B     27.58 M  0.00 %  0.06 % [jbd2/xvda1-8]
10016 be/4 root          0.00 B      0.00 B  0.00 %  0.00 % [flush-202:1]
10014 be/4 postgres      0.00 B    947.35 M  0.00 %  0.00 % postgres: stats collector     process
 534 be/4 root          0.00 B    136.00 K  0.00 %  0.00 % dhclient3 -e IF_METRIC=100 -pf /var/run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases -1 eth0

The postgresql run with postgis extension, the database is almost empty, so I really don't know why it is constantly collecting stats, sometimes there is also a postgres writting process. Another thing is the Jbd2 (ext4 journal) process which also constantly using I/O

1

There are 1 answers

0
Chris Travers On BEST ANSWER

The best answer would be that if you can have another volume to move the journal onto another volume. EXT4 sees much better throughput in that case.

What's probably happening is that you have a small database under some degree of general load, and autovacuum is running in the background. Autovacuum will analyze used tables and write data to the stats tables periodically.

If the load is low, you may be able to tweak your autovacuum settings to avoid the problem as well.