waha icon indicating copy to clipboard operation
waha copied to clipboard

[Question] Optimize PostgreSQL in NOWEB

Open matteus-siqueira opened this issue 2 months ago • 11 comments

I'm noticing a bottleneck in using PostgreSQL to save sessions, with many connections being opened and closed, and uncontrolled usage of the PostgreSQL-dedicated server. Has anyone used PgBouncer to manage pooled connections? What are the recommended settings? Transaction or session pool mode? Please provide information. @devlikepro , your help here is greatly appreciated.

patron:PLUS

matteus-siqueira avatar Oct 07 '25 04:10 matteus-siqueira

Portuguese


Estou percebendo um gargalo ao usar o PostgreSQL para salvar sessões, com muitas conexões sendo abertas e fechadas e o uso não controlado do servidor dedicado ao PostGresql. Alguém usou o PGBouncer para gerenciar conexões agrupadas? Quais são as configurações recomendadas? Modo de transação ou pool de sessão? Forneça informações. @devlikepro, sua ajuda aqui é muito apreciada.

github-actions[bot] avatar Oct 07 '25 04:10 github-actions[bot]

I can second this, please help me with this in any way you can as well

patron:PLUS

whoami-netizen avatar Oct 07 '25 20:10 whoami-netizen

Portuguese


Posso apoiar isso, por favor me ajude com isso da maneira que você puder também

github-actions[bot] avatar Oct 07 '25 20:10 github-actions[bot]

I went from sqllite to postgresql and everything went haywire, this is so much more slower and much worse

patron:PLUS

whoami-netizen avatar Oct 07 '25 20:10 whoami-netizen

Portuguese


Passei do sqlite para o postgresql e tudo deu errado, isso é muito mais lento e muito pior

github-actions[bot] avatar Oct 07 '25 20:10 github-actions[bot]

These commands can help you

shared_buffers=1024MB -c work_mem=64MB -c maintenance_work_mem=128MB -c effective_cache_size=2048MB -c wal_buffers=16MB -c max_wal_size=4GB -c checkpoint_timeout=30min -c checkpoint_completion_target=0.9 -c bgwriter_lru_maxpages=5000 -c bgwriter_lru_multiplier=5.0 -c bgwriter_delay=20ms -c wal_writer_delay=200ms -c random_page_cost=2.0 -c default_statistics_target=100

patron:PLUS

theeusmartins avatar Oct 08 '25 01:10 theeusmartins

Portuguese


Esses comandos podem ajudá -lo

shared_buffers = 1024MB -C WORK_MEM = 64MB -C MANUTILIVEL_WORK_MEM = 128MB -C EFFEFFICEND_CACHE_SIZE = 2048MB -C WAL_BUFFERS = 16MB -C MAX_WAL_SIZE = 4GB -C -CHECTIPOT_TIMEOUT = 30MIN -CECTIME bgwriter_lru_maxpages = 5000 -C bgwriter_lru_multiplier = 5.0 -c bgwriter_delay = 20ms -c wal_writer_delay = 200ms -c random_page_cost = 2.0 -c default_statistics_target = 100 @@@@@page_page_cost = 2.0 -c default_statistics_target = 100

github-actions[bot] avatar Oct 08 '25 01:10 github-actions[bot]

Hello can you confirm if this config is safe to use for all purposes, and wont have any effect on the functionality like webhooks etc?

patron:PLUS

whoami-netizen avatar Oct 13 '25 14:10 whoami-netizen

Portuguese


Title: undefined

Olá, você pode confirmar se esta configuração é segura para uso para todos os fins e não terá nenhum efeito na funcionalidade, como webhooks, etc?

github-actions[bot] avatar Oct 13 '25 14:10 github-actions[bot]

Hello can you confirm if this config is safe to use for all purposes, and wont have any effect on the functionality like webhooks etc?

patron:PLUS

They are safe, these commands are for postgres.. improving its cache but RAM consumption should increase

patron:PLUS

theeusmartins avatar Oct 13 '25 14:10 theeusmartins

Portuguese


Title:

Olá, você pode confirmar se esta configuração é segura para uso para todos os fins e não terá nenhum efeito na funcionalidade, como webhooks, etc.?

![patrono:PLUS](https://camo.githubusercontent.com/f2a0b7f7aaa0c26af112ef46229c9b6d343fec757c08f78ef210a4894d290146/68747470733a2f2f696 d672e736869656c64732e696f2f62616467652f706174726f6e2d504c55532d613065366261)

Eles são seguros, esses comandos são para postgres.. melhorando seu cache, mas o consumo de RAM deve aumentar

github-actions[bot] avatar Oct 13 '25 14:10 github-actions[bot]