Google Cloud Compute + FreeBSD + PostgreSQL = timecounter issue

From: "Maeldron T(dot)" <maeldron(at)gmail(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Google Cloud Compute + FreeBSD + PostgreSQL = timecounter issue
Date: 2016-11-23 19:43:18
Message-ID: 0cca4ce1-a3fa-adc7-c894-08960ff7cc0f@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

In short:

The available timecounters on Google Compute Instances seem to be random.

The setting in the official FreeBSD image is wrong (not available on any
of my test instances). FreeBSD will pick up a timecounter at random.

When either the TSC or the TSC-low counter is used, explain analyze
behaves normally. The system clock will be wrong with a few seconds in
each minute. ntpd won’t (and shouldn’t) fix that. Daemons panic. Time
travel gets real.

When ACPI-fast is used, the system clock stays normal. However, an
"explain analyze select count(1) from table" will run for 30000ms
instead of 300ms.

pg_test_timing doesn’t show the problem, or I read the output wrong.

In long:

https://forums.freebsd.org/threads/58666/

Notes:

$ pg_test_timing
Testing timing overhead for 3 seconds.
Per loop time including overhead: 6346.80 nsec
Histogram of timing durations:
< usec % of total count
1 0.00000 0
2 0.00000 0
4 0.00000 0
8 96.37600 455552
16 2.26939 10727
32 0.62727 2965
64 0.08801 416
128 0.56634 2677
256 0.04824 228
512 0.01523 72
1024 0.00508 24
2048 0.00275 13
4096 0.00085 4
8192 0.00042 2
16384 0.00000 0
32768 0.00021 1
65536 0.00000 0
131072 0.00021 1

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Maeldron T. 2016-11-23 19:45:30 Re: Google Cloud Compute + FreeBSD + PostgreSQL = timecounter issue
Previous Message Andres Freund 2016-11-23 18:32:38 Re: [bugfix] commit timestamps ERROR on lookup of FrozenTransactionId