0

I've long noticed that ESXI wasn't showing disk READ activity for my Ubuntu Postgres database server. I figured maybe it was just a weird bug with ESXI, as it would show disk WRITE activity.

I decided to install Zabbix and see if I could monitor disk read activity with that but same thing, under a very heavy DB read activity, disk read rate is 0. not close to zero, or low. but absolutely 0.

I realized that if I open a large file to transfer a file of the DB server, I DO see disk read activity then. So it's only Postgres reads not showing.

Is there some sort of way that Postgres is able to "bypass" the OS so it's not able to see\report disk read usage?

EDIT: it's also entirely possible the only write activity I'm seeing are archive files, not table writes.

enter image description here

4
  • We don't know how much DB traffic there is, so maybe all of that is mostly reads and possibly covered by your DB's cache? Try to do a huge bunch of inserts and updates while monitoring disk activity. Additionally: Check for I/O activity on the DB VM itself, i.e. with iostat. Commented Jan 16, 2022 at 9:41
  • Most probably postgres does not need to read from disk because the requested records are cached in RAM. Commented Jan 17, 2022 at 12:53
  • It's possible it's pulling from ram, but one process I have runs through an entire table with a couple hundred thousand rows. it takes a while, so maybe it's pulling small enough chunks at a time to not really register. I've edit the post to attach the graph I'm paying attention to Commented Jan 20, 2022 at 4:07
  • so I think I figured it out. I think it's Linux caching the db files in ram. I noticed pg_dump also wasn't showing and disk activity for a roughly 3gb database. I restarted postgres, and still nothing. I then backed up another db on the same machine, and saw a ton of disk activity. this VM has 16gb of ram, and it's just a dev machine, so otherwise nothing else going on Commented Feb 1, 2022 at 3:40

1 Answer 1

0

This turned out to be not so much postgres caching data, but the OS itself. With 12gb of memory available and no other processes on the machine, Linux had most of the DB files cached in memory. After clearing out the ram it immediately showed high disk usage with a pg_dump

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.