Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Bootrapping improved #49

Merged
merged 2 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions bootstrap/pgbouncer/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ variable "load_balancer" {
}

variable "certs_configmap_name" {
type = string
type = string
default = "pgbouncer-certs"
}

Expand All @@ -41,22 +41,22 @@ variable "pg_bouncer_user_settings" {
}

variable "pg_bouncer_auth_user_password" {
type = string
type = string
default = ""
}

variable "postgres_secret_name" {
type = string
type = string
default = ""
}

variable "instance_role" {
type = string
type = string
default = "pgbouncer"
}

variable "postgres_instance_name" {
type = string
type = string
default = "postgres-dbsync-v3-ar9"
}

Expand Down
2 changes: 1 addition & 1 deletion bootstrap/pgbouncer/pg-bouncer.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ resource "kubernetes_deployment_v1" "pgbouncer" {
}

spec {
replicas = 1
replicas = var.pg_bouncer_replicas

strategy {
rolling_update {
Expand Down
3 changes: 1 addition & 2 deletions bootstrap/postgres/postgres.tf
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,8 @@ resource "kubernetes_stateful_set_v1" "postgres" {
}

volume_mount {
mount_path = "/etc/postgresql/postgresql.conf"
mount_path = "/etc/postgresql"
name = "config"
sub_path = "postgresql.conf"
}

volume_mount {
Expand Down
6 changes: 3 additions & 3 deletions bootstrap/postgres/postgresql.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
listen_addresses = '*'
max_connections = 100
shared_buffers = 12GB
effective_cache_size = 36GB
max_connections = 125
shared_buffers = 15GB
effective_cache_size = 45GB
maintenance_work_mem = 2GB
checkpoint_completion_target = 0.9
wal_buffers = 16MB
Expand Down
7 changes: 4 additions & 3 deletions bootstrap/postgres/queries.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
-- create pg bouncer role and user_search function - add to each database

CREATE ROLE pgbouncer WITH PASSWORD 'pgbounceruserpass';
ALTER ROLE pgbouncer WITH LOGIN;

CREATE OR REPLACE FUNCTION user_search(uname TEXT) RETURNS TABLE (usename name, passwd text) as
$$
Expand Down Expand Up @@ -724,7 +725,7 @@ CREATE INDEX IF NOT EXISTS idx_tx_metadata_collection_offers ON public.tx_metada



CREATE INDEX stake_address_idx ON stake_address("view");
CREATE INDEX IF NOT EXISTS stake_address_idx ON stake_address("view");


--- BLOCKFROST
Expand Down Expand Up @@ -762,7 +763,7 @@ CREATE INDEX IF NOT EXISTS bf_idx_reference_tx_in_tx_in_id ON reference_tx_in (t
CREATE INDEX IF NOT EXISTS bf_idx_collateral_tx_in_tx_in_id ON collateral_tx_in (tx_in_id);


CREATE INDEX CONCURRENTLY IF NOT EXISTS bf_idx_redeemer_script_hash ON redeemer USING HASH (encode(script_hash, 'hex'));
CREATE INDEX IF NOT EXISTS bf_idx_redeemer_script_hash ON redeemer USING HASH (encode(script_hash, 'hex'));


CREATE INDEX IF NOT EXISTS bf_idx_redeemer_tx_id ON redeemer USING btree (tx_id);
Expand All @@ -774,4 +775,4 @@ CREATE INDEX IF NOT EXISTS bf_idx_col_tx_out ON collateral_tx_out USING btree (t
CREATE INDEX IF NOT EXISTS bf_idx_ma_tx_mint_ident ON ma_tx_mint USING btree (ident);


CREATE INDEX CONCURRENTLY IF NOT EXISTS bf_idx_ma_tx_out_ident ON ma_tx_out USING btree (ident);
CREATE INDEX IF NOT EXISTS bf_idx_ma_tx_out_ident ON ma_tx_out USING btree (ident);
Loading
Loading