Commit graph

118 commits

Author SHA1 Message Date
Kevin Fenzi
73b0029f20 postgresql server: double work_mem
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-02-10 13:06:59 -08:00
Aurélien Bompard
78da9de518
Also setup timescaledb on db-datanommer01 in staging
Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
2021-11-17 11:23:27 +01:00
Kevin Fenzi
79e99af9ce postgresql_server: Do not run the timescaledb setup on all the staging db servers.
We only want to run this on db-datanommer02, not that and all the other
staging postgresql servers. :)

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2021-09-30 15:49:33 -07:00
Aurélien Bompard
530d4672de
Syntax fix
Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
2021-09-17 10:47:06 +02:00
Aurélien Bompard
bd3a1b3912
Datanommer: enable the timescaledb extension on the DB
Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
2021-09-17 10:45:52 +02:00
Aurélien Bompard
4b4f1b99d8
datanommer: create the database and users
Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
2021-09-17 10:26:00 +02:00
Aurélien Bompard
4cf50fdad2
datanommer02: deploy timescaledb
Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
2021-09-17 09:55:32 +02:00
Aurélien Bompard
73f19b84e3
Use import instead of include
Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
2021-08-10 10:54:18 +02:00
Aurélien Bompard
76d3ead677
Deploy TimescaleDB on staging datanommer DB
Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
2021-08-10 10:37:24 +02:00
Kevin Fenzi
c1d0206256 postgresql: up connection limit to 2000
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2021-07-31 09:04:21 -07:00
Kevin Fenzi
e25775ed59 postgresql: fix db-fas01.stg breakage from playbook runs
In prod db-fas01 is rhel7 and uses postgresql 9.6.
In staging db-fas01.stg is rhel8, and should also use postgresql 9.6,
but we were blanket making rhel8 hosts use postgresql 12.
We could drop this by reinstalling db-fas01.stg with rhel7, or waiting
until we finally kill fas2 and just setting them both to use postgresql
12.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2021-07-26 13:53:56 -07:00
Kevin Fenzi
2379b465ab postgres / server / koji sessions script: remove
Turns out copy module doesn't actually have a 'absent' state.
So, just remove this (we no longer need it as there's a timer on koji
hub that does this from there).

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-08-26 13:50:33 -07:00
Kevin Fenzi
72424c52fb postgresql / db-koji01: allow adjusting max_workers and friends
db-koji01 has been running with this since before the mass rebuild, and
it seems to make it have a higher load, but process faster and without
stalling when doing backups or when long/bad koji-gc queries for old
versions of texlive hit it.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-08-05 16:28:08 -07:00
Kevin Fenzi
310a64c713 postgresql / db-koji: adjust postgresl some more
Turns out we were not setting effective_cache_size even tho it was set
for some servers (pagure). Adjust a few parameters on db-koji to try and
get some more performance out of it.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-07-22 16:23:33 -07:00
Kevin Fenzi
e2b5c6a42c postgresql_server: check for existance of vars
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-06-22 15:16:27 -07:00
Kevin Fenzi
8530a1c075 postgresql_server: new shiny template .conf file for postgresql 12
I took the default postgresql.conf from postgresql 12 and then added in
various changes we already manually made and variable substitions we
already had setup back in the postgresq 9.2 days.

This will apply to db-koji01, db-qa01, db-datanommer01 at least.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-06-22 15:08:23 -07:00
Kevin Fenzi
d92ff41412 postgresql: do NOT put a recovery.conf file on db-koji01 anymore
In phx2 we had a warm standby database host (db-koji02), but we no
longer have that host in iad2, so we shouldn't try and make db-koji01
handle that. Also, this was just changed mistakenly as it's the warm
standby host that should get the recovery.conf file.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-06-21 09:20:12 -07:00
Kevin Fenzi
f2a1a3f203 postgresql_server: make sure db-koji01 gets the right backup script.
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-06-18 18:54:12 -07:00
Kevin Fenzi
98ccbf3156 postgresql / servers: fix db-fas01 not having temp_buffers and rename backup-database for db-koji01
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-06-16 14:58:36 -07:00
Stephen Smoogen
12c486cda3 remove some hosts in inventory file which do not exist in IAD2. 2020-06-14 19:51:27 -04:00
Kevin Fenzi
ab7d661781 koji hub: re-enable gc jobs, disable session cleanup on db-koji01
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-06-11 12:08:59 -07:00
Kevin Fenzi
2fe67cd8c1 postgresql-server: fix indent
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-06-10 11:55:55 -07:00
Stephen Smoogen
7ed926aafc backup-database needs to be installed on all postgres boxes 2020-06-09 15:04:43 -04:00
Stephen Smoogen
b0c389b2dc make backups on all systems 2020-06-09 15:01:30 -04:00
Stephen Smoogen
e76b85ec2d and this will unfix my fix by fixing the other fix for postgres 2020-06-09 14:51:04 -04:00
Stephen Smoogen
422265dc0b RHEL-8 postgres boxes needed pxz and other items spelled out 2020-06-09 14:47:38 -04:00
Stephen Smoogen
3015b75976 remove db-koji02 as it is now db-koji01 2020-06-09 14:29:28 -04:00
Pierre-Yves Chibon
6710db8d0d Make some more of the postgresql configuration key adjustable
Basically, if the variables are defined in the host, use them, otherwise
use the current values.

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2020-05-22 09:08:00 +00:00
Kevin Fenzi
b9eed95b04 db-fas01.iad2: move back to rhel7, fas is not happy with new postgres
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-05-20 14:40:29 -07:00
Kevin Fenzi
c034afc53c postgresql server: fix indent
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-05-19 12:20:58 -07:00
Kevin Fenzi
e918a3b08f postgresql / server: enable the postgresql 12 module on rhel8 hosts
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-05-19 12:16:45 -07:00
Pierre-Yves Chibon
13ad0cea66 postgresql_server: do not install our current postgresql.conf on RHEL8
Our postgresql.conf is from postgresql 9.2 while RHEL8 ships 10.x which
leads to postgresql no longer wanting to start (as seen on pagure-stg01).

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2020-04-24 21:34:29 +02:00
Pierre-Yves Chibon
e7673a2538 postgresql_server: adjust the name of the packages for RHEL8
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2020-04-24 21:34:29 +02:00
Pierre-Yves Chibon
56cf212d1f postgresql_server: there is no python2-psycopg on RHEL8, so use python3
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
2020-04-24 21:34:29 +02:00
Kevin Fenzi
7242a1a583 db-koji02: actually deploy the right backup script
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-04-24 21:34:28 +02:00
Kevin Fenzi
bd50c6e4bc db-koji02: make sure backup uses all cpus
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-04-24 21:34:28 +02:00
Kevin Fenzi
fd6a78e876 postgresql_server: increase autovacuum_freeze_max_age to avoid autovaccum locking the buildroot_listing table (for a while more)
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-04-24 21:34:21 +02:00
Kevin Fenzi
e93d539e29 postgresql_server: also set this on db-koji02 ad they have to match
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-04-24 21:34:20 +02:00
Kevin Fenzi
b4f82f8e38 postgresql_server: adjust connections only for db-koji01, leave pagure01 and others back at 750
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-04-24 21:34:20 +02:00
Kevin Fenzi
fa46e8bc0e koji_hub: switch to event workers in apache and bump limits way up.
By default apache uses prefork and a limit of 250. It's possible that this limit was
the thing causing us issues over the last week. This moves to the event mpm and ups limits
a lot. It also needs to up limits on db connections or the increased workers will just
cause the db server to overload.

With this setup, builders are no longer dropping out, but it's not clear if it's solved
all the issues we have been seeing.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-04-24 21:34:20 +02:00
Kevin Fenzi
3641c508fd postgresql defaults: move default to defaults.
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-04-24 21:34:16 +02:00
48ef2735d3 postgresql_server: add conditional for small postgresql instances
The recent changes to postgresql_server increased the required memory past
what one of my VMs had. I've added a conditional in postgresql.conf to put
some memory settings back where they used to be (controlled by
small_postgres_instance, default is false) and created a default to not use
the small_postgres_instance settings unless specified
2020-04-24 21:34:16 +02:00
Kevin Fenzi
993fd9f64e postgresql_server / db-koji02: set max_standby_streaming_delay to -1 ( ∞ )
Turns out I had set this on the master (db-koji01) which is ignored.
We need to set it on the standby. With a value of -1, the standby will wait
for conflicting transactions/locks to complete however long it takes.
If this doesn't work to get us a good backup on db-koji02, no harm and we
can try something else.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-04-24 21:34:14 +02:00
Kevin Fenzi
05e5b4fe79 postgresql: increase the max_standby_streaming_delay to 90s
It's hoped that this would allow us to get more reliable backups on the hot spare.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-04-24 21:34:13 +02:00
Kevin Fenzi
955db508b1 postgresql_server: also set hot_standby_feedback or the master might delete rows the standby needs during a pg_dump
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-04-24 21:34:13 +02:00
Kevin Fenzi
d2fa094677 postgresql_server: add missing ' to end of connection statement
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-04-24 21:34:13 +02:00
Kevin Fenzi
0c895651fa postgresql / kojidb standby: try connecting 02 to 01, not 02 to itself.
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-04-24 21:34:13 +02:00
Kevin Fenzi
0a5cb2c51c postgresql_server: Fix spelling mistake
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-04-24 21:34:13 +02:00
Kevin Fenzi
1613c724ca postgresql-server: sadly, "all" doesn't match replication, that has to be seperate.
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-04-24 21:34:13 +02:00
Kevin Fenzi
9747e55c72 db-koji02: create vm and config files for hot standby kojidb.
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-04-24 21:34:12 +02:00