Commit graph

35 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
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
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
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
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
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
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
Kevin Fenzi
603fe5e8e9 postgresql / db-koji: Move instead to logging just the slow stuff.
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-04-24 21:34:12 +02:00
Kevin Fenzi
b5f8425273 postgresql / db-koji01: log queries
I'd like to log queries on db-koji01 for a short time to try and see whats causing us such pain.
After we have collected a bunch of queries we can revert this until we sort out what needs
to be changed. We may also change this log all to log just slow queries (per smooge's suggestion).
Hopefully this will get us the info we need to track this down.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-04-24 21:34:12 +02:00
Kevin Fenzi
66c7df9a53 postgresql / db-koji01: more tweaks
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-04-24 21:34:12 +02:00
Kevin Fenzi
184f4c93bc postgresql / db_koji01: adjust stuff to hopefully give us good backups.
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-04-24 21:34:12 +02:00
Kevin Fenzi
6052756805 postgresql_server / db-koji01: Adjust a bunch more for performance.
The current settings cause database dumps to drive the load way up
and make the entire application slow, so we need to adjust.
Using pgtune, these values might well be better.

shared_buffers + effective_cache_size should = total memory.
random_page_cost should be lowered a bunch since we are on ssds there.
1.1 is only slightly more than 1.0 for sequential.
effective_io_concurrency should also be raised a bunch for ssds.
a few other values should be higher based on memory.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-04-24 21:34:12 +02:00
Kevin Fenzi
f0c596c427 Try and make a public anitya dump with the right tables. 2018-10-08 17:41:07 +00:00
Pierre-Yves Chibon
fb53a3430a Looks like checkpoint_segments is not liked by postgresql on Fedora 2017-05-11 17:29:07 +02:00
Kevin Fenzi
4dad64e596 Clean up postgresql template and move variables into host vars for each db host as they are memory dependent. 2016-04-01 23:32:00 +00:00
Kevin Fenzi
ee6d457c84 Adjust db01 postgresql config also. 2016-03-15 18:00:36 +00:00
Kevin Fenzi
f1d26dda17 Tweak postgresql settings for db-koji01 2016-03-15 03:02:30 +00:00
Patrick Uiterwijk
e42361a563 Also apply the postgresql bytea pg-8 compat hotfix on db01 for bodhi1 2014-12-18 03:51:03 +00:00
Patrick Uiterwijk
9d744d71e3 Put pg into pg-8 compat mode for sqlalchemy with binary content 2014-12-16 23:42:53 +00:00
Kevin Fenzi
bb408a1c1f Fix postgresql role for smaller memory machines. 2014-12-08 14:47:06 +00:00
Ralph Bean
5e32fe5643 Move postgres backup cron task inside a bash flavored script. 2014-01-13 16:16:27 +00:00
Ralph Bean
12b88b57a1 Cron backups for db-datanommer01. 2014-01-10 21:29:20 +00:00
Ralph Bean
18100deb21 Remove unused pg_hba.conf.j2 file. 2014-01-10 21:27:45 +00:00
Kevin Fenzi
3dae75234b Move postgresql stuff around. 2013-09-12 22:56:34 +00:00