Re: [INFO] - vm.dirty_ratio/background_ratio - Mailing list pgsql-admin

From Victor Yegorov
Subject Re: [INFO] - vm.dirty_ratio/background_ratio
Date
Msg-id CAGnEboi83_TcZqJzuGcs6vFASSZ1EoN8m2Q8yXWWj466nOOEiA@mail.gmail.com
Whole thread Raw
In response to [INFO] - vm.dirty_ratio/background_ratio  ("drum.lucas@gmail.com" <drum.lucas@gmail.com>)
Responses Re: upsert example about postgres9.5  (koff10 <koff10@hotmail.com>)
List pgsql-admin
2016-04-05 2:27 GMT+03:00 drum.lucas@gmail.com <drum.lucas@gmail.com>:
I've got a 128GB server with SATA disks.. and I'm having I/O issue....
...
[root@741293-03 ~]$ sysctl -a | grep dirty
vm.dirty_background_ratio = 20
vm.dirty_background_bytes = 0
vm.dirty_ratio = 25
vm.dirty_bytes = 0
vm.dirty_writeback_centisecs = 500
vm.dirty_expire_centisecs = 3000

I think you should lower your `dirty_background_ratio`, 'cos currently kernel will start writing down dirty data from the cache when 20% of `Active` (as reported by /proc/vmstat) is filled,
on 128GB server this can be a lot. You should base your settings on your IO subsystem capabilities — somewhere around the size of the cache of your RAID array.

If you really have IO issues, consider checking more kernel parameters:

    sysctl -a|egrep '^vm.(dirty|swap|over)'

and also check `pg_stat_bgwriter` data, it shows accumulated data about IO performed by checkpoints, bgwriter and individual backends.


For reference, I really like the following pages:


--
Victor Y. Yegorov

pgsql-admin by date:

Previous
From: "drum.lucas@gmail.com"
Date:
Subject: [INFO] - vm.dirty_ratio/background_ratio
Next
From: Dave Johansen
Date:
Subject: Disk reads when using streaming replication?