Question

I have configured Hight Avaliabily WAL Log Shipping Hot Standby (SSL) with one node. But after I configure, both hosts (primary and secondary) take 100% CPU usage.

The most strange is because I have only one database called "TESTE" with one table called "EXAMPLE" to check if replication was OK. The replication worked perfectly but I don't understand why my CPU takes 100% usage because I don't have any application connect on my cluster.

I ran HTOP command and get this results:

Image 1 - Primary Server HTOP Info

Image 1 - Primary Server HTOP info

Image 2 - Secondary Server HTOP info

Image 2 - Secundary Server HTOP info

S.O. version:

No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 10 (buster)
Release:        10
Codename:       buster

PostgreSQL version:

postgres (PostgreSQL) 12.3 (Debian 12.3-1.pgdg100+1)

Primary server postgres.conf file:

max_connections = 100
SSL = on
shared_buffers = 2GB
work_mem = 10485kb
maintenance_work_mem = 512MB
dynamic_shared_memory_type = posix
effective_io_concurrency = 200
max_worker_processes = 4
max_parallel_maintenance_workers = 2
max_parallel_workers_per_gather = 2
max_parallel_workers = 4
wal_level = replica
wal_buffers = 16MB
max_wal_size = 200MB
min_wal_size = 80MB
checkpoint_completion_target = 0.7
archive_mode = on
max_wal_senders = 3
wal_keep_segments = 8
hot_standby = on
hot_standby_feedback = on
random_page_cost = 1.1
effective_cache_size = 6GB
default_statistics_target = 100

pg_stat_activity info:

enter image description here

pg_stat_archiver info:

enter image description here

pg_stat_replication info: enter image description here

If I stop postgres service in both servers the CPU still has 100% usage.

Anyone can help me?

Was it helpful?

Solution

By exposing a database with a weak superuser password to the internet you invited somebody to break in and use your CPU for their own purposes, probably mining crypto-currencies.

Take the machine from the internet, wipe it clean and re-install the operating system. In the case of a hosted database, decommission the database and get a new one.

To protect yourself from this problem, choose good passwords.

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top