toluaina / pgsync

Postgres to Elasticsearch/OpenSearch sync
https://pgsync.com
MIT License
1.16k stars 181 forks source link

SSL error #351

Open Role911 opened 1 year ago

Role911 commented 1 year ago

PGSync version: 2.3.2

Postgres version: 13

Elasticsearch version: 7.5

Python version: 3.9

Problem Description: Our pgsync is running on vm, that is connected on our Postgres (cloud). Our vm is stable, but we have problem with Postgres, cpu is on 100 %, after some time, the db is down. We changed our flags : tcp_keepalives_count 100, tcp_keepalives_interval 200 tcp_keepalives_idle 200 , that is suggested in earlier issues. Initial sync is always stable, but after some time we have problem with postgres. Also all indices are there.

PGsync config: POLL_TIMEOUT=1.0 ELASTICSEARCH_CHUNK_SIZE=100 ELASTICSEARCH_MAX_CHUNK_BYTES=1242880 ELASTICSEARCH_MAX_RETRIES=8 ELASTICSEARCH_QUEUE_SIZE=1 ELASTICSEARCH_THREAD_COUNT=1 ELASTICSEARCH_TIMEOUT=180 QUERY_CHUNK_SIZE=100 CONSOLE_LOGGING_HANDLER_MIN_LEVEL=ERROR REPLICATION_SLOT_CLEANUP_INTERVAL=30.0

Postgres: vCPUs: 1 Memory: 3.75 GB SSD storage: 25 GB

toluaina commented 1 year ago
Role911 commented 1 year ago

Hello, all resources on db is ok. (cpu, memory and storege). Also all indices exists. After some time resource usage is climbing but not over the limits. The db log is this: server process (PID 60605) was terminated by signal 9: Killed this is query (i can't copy all): SELECT count(*) AS count_1 FROM public.visit AS visit_1 LEFT OUTER JOIN LATERAL (SELECT CAST(JSON_BUILD_OBJECT('mission', CAST(JSON_BUILD_OBJECT('id', JSON_BUILD_ARRAY(mission_1.id)) AS JSONB)) AS JSONB) || CAST(JSON_BUILD_ARRAY(anon_2._keys) AS JSONB) || CAST(JSON_BUILD_ARRAY(anon_3._keys) AS JSONB) AS _keys, CAST(JSON_BUILD_OBJECT('id', mission_1.id, 'startDate', mission_1."startDate", 'endDate', mission_1."endDate", 'type', mission_1.type, 'serviceId', mission_1."serviceId", 'deletedAt', mission_1."deletedAt", 'service', anon_2.service, 'poa', anon_3.poa) AS JSONB) AS mission, mission_1.id AS id FROM public.mission AS mission_1 LEFT OUTER JOIN LATERAL (SELECT CAST(JSON_BUILD_OBJECT('service', CAST(JSON_BUILD_OBJECT('id', service_1.id) AS JSONB)) AS JSONB) || CAST(JSON_BUILD_ARRAY(anon_4._keys) AS JSONB) || CAST(JSON_BUILD_ARRAY(anon_5._keys) AS JSONB) AS _keys, CAST(JSON_BUILD_OBJECT('id', service_1.id, 'createdAt', service_1."createdAt", 'name', service_1.name, 'client', anon4.client, 'process', anon

Pgsync is running as vm that is connected with db. We have master/replication db. We run this on google cloud platform.

Role911 commented 1 year ago

db_1 pgsync log_db

toluaina commented 1 year ago

Can you please try off the latest main branch. I feel this has now been addressed.

Role911 commented 1 year ago

I try your last version, but i have the same problem. We have project that is currently in production, can we have some skype call, or other channel of communication ?

toluaina commented 1 year ago

Can you please connect with me on discord? My user id is taina#4505

@Role911