0

hello i have a postgresql-server in a docker container. nobody is connected to this server but the server produce i/o loads. the question is why? stats_temp_directory is set to the /tmp dir

total  access  close_write  close_nowrite  open  filename
317    237     16           24             40    /media/RAID/owncloud/db/base/16385/
82     34      8            16             24    /media/RAID/owncloud/db/global/

this i/o load prevent the harddrives to spin down

Floyd
  • 101
  • 2

1 Answers1

1

Why on earth would you want your hard drives to spin down? This is a server, and is meant to be available. Are using desktop-class "green" drives? If so, don't expect them to last longer than a few months with the number of spin up/down events they'll have.

As to what the source of the IO is? Well, you have a running RDBMS that keeps its files on disk. One would expect that, even absent client load, the server daemon would need to perform periodic IO for health checks, garbage collection, and other internal bookkeeping processes. Perhaps it's writing to its log file as well.

Overall, this seems like a problem that you should not be concerned about resolving.

EEAA
  • 109,363
  • 18
  • 175
  • 245
  • Its a private owncloud server with postgresql backend. The drives are normaly not in use between 0:00am and 06:00am and between 09:00am and 03:00pm. This are 4 NAS-HDD-Drives (WD Red & Seagate NAS). – Floyd Mar 08 '16 at 19:43
  • But electricity costs something in my country and why should drives that are not being used, run? after half an hour of inactivity between those times they can go to sleep. – Floyd Mar 08 '16 at 19:46
  • If you really want this, then just schedule postgres to shut down (and any other process that might write to those drives). – EEAA Mar 08 '16 at 19:48
  • this was my plan B :) – Floyd Mar 08 '16 at 19:50
  • 1
    @Floyd In addition to checkpoints logged every X seconds, postgresql performs maintenance such as autovacuuming tables when idle. I don't think there's a way to completely stop it from working other then shutting it off like EEAA says. If you shut off the autovacuum then you *must* schedule vacuuming the tables yourself. – DerfK Mar 08 '16 at 20:11
  • Weekly vacuuming is an option. I will disable autovacumming completly and check the i/o loads. – Floyd Mar 08 '16 at 20:29
  • disable autovacuuming solved it. but in this case setting autovacuum_naptime = 604800 # = 1 week; is the better option, because i doesn't need a cron job – Floyd Mar 08 '16 at 21:04