Re: Postgres replaces SQLite as well as it replaces Oracle?

From: Josh Berkus <josh(at)berkus(dot)org>
To: Joshua Kramer <joskra42(dot)list(at)gmail(dot)com>
Cc: PostgreSQL Advocacy <pgsql-advocacy(at)postgresql(dot)org>, Bruce Momjian <bruce(at)momjian(dot)us>
Subject: Re: Postgres replaces SQLite as well as it replaces Oracle?
Date: 2017-02-27 17:05:50
Message-ID: 8bc68d39-510c-233a-43b0-bf28d5331726@berkus.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-advocacy

On 02/25/2017 07:53 PM, Joshua Kramer wrote:
>> Poll the size of the various system catalogs as you go; you may discover
>> that keeping it small is mostly a matter of aggressively vacuuming them.
>
> Here's what's interesting in that regard: I actually want to tune PG
> to have as few disk writes as possible, so as to not burn through SD
> cards.

A few tips:

1. Put the stats cache on a ramdisk.
2. No autovacuum, use scheduled vaccum instead (and if you have nightly
downtime, consider rebuilding the database instead of vacuum)
3. Put tmp/sorting space on a ramdisk

>
> Given that even a modest Raspberry Pi has 1GB of RAM, I thought I
> would store all of the Postgres database files (and other stuff under
> /var) in a RAM disk, then archive the ram disk on shutdown (and
> restore the archive on startup). I'm not quite there yet. I wrote a
> couple of systemd Units. One unit archives /var upon system shutdown
> and one un-archives upon startup (but before the multi-user target
> starts other services). The problem is, I have not been able to get
> systemd to do things in a sane manner. It always insists upon
> starting multi-user.target at the same time the un-archive is running,
> so services that depend on /var being complete do not start cleanly.
> Same with shutdown- it always kills power while the archive script is
> running.
>
> At this time it's running as-is. I've enabled sysstat so I can keep
> track of disk writes and tune as needed.

I think Bruce did a bunch of work tracking all the places where we write
to disk, once upon a time. Bruce?

--
Josh Berkus
Containers & Databases Oh My!

In response to

Responses

Browse pgsql-advocacy by date

  From Date Subject
Next Message Bruce Momjian 2017-02-28 20:56:15 Re: Postgres replaces SQLite as well as it replaces Oracle?
Previous Message Joshua Kramer 2017-02-26 03:53:46 Re: Postgres replaces SQLite as well as it replaces Oracle?