Hola,

600 conexiones * 50MB de work_men = 30GB que sobrepasa los 8GB de tu
sistema.

Baja el work_men y si es posible tus *max_connections* ya que menos es
mejor.

Saludos.


El lun, 25 jul 2022 a las 9:42, jorge gerardo fernandez lugo (<
jorge...@hotmail.com>) escribió:

> Hola. Gracias por la ayuda.
> paso los datos
>
>
> top - 10:26:34 up 10 days, 12:06,  1 user,  load average: 0,14, 0,12, 0,08
> Tasks: 235 total,   1 running, 234 sleeping,   0 stopped,   0 zombie
> %Cpu0  :  1,0 us,  0,0 sy,  0,0 ni, 99,0 id,  0,0 wa,  0,0 hi,  0,0 si,
>  0,0 st
> %Cpu1  :  0,0 us,  0,0 sy,  0,0 ni,100,0 id,  0,0 wa,  0,0 hi,  0,0 si,
>  0,0 st
> %Cpu2  :  0,0 us,  0,0 sy,  0,0 ni,100,0 id,  0,0 wa,  0,0 hi,  0,0 si,
>  0,0 st
> %Cpu3  :  1,0 us,  2,0 sy,  0,0 ni, 97,1 id,  0,0 wa,  0,0 hi,  0,0 si,
>  0,0 st
> %Cpu4  :  0,0 us,  1,0 sy,  0,0 ni, 99,0 id,  0,0 wa,  0,0 hi,  0,0 si,
>  0,0 st
> %Cpu5  :  0,0 us,  0,0 sy,  0,0 ni,100,0 id,  0,0 wa,  0,0 hi,  0,0 si,
>  0,0 st
> KiB Mem :  *8010532* total,   197356 free,   353704 used,  7459472
> buff/cache
> KiB Swap:  2097148 total,  2097144 free,        4 used.  4721708 avail Mem
>
>
>
> USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
> postgres 10872  0.1  0.0 115508  2096 pts/0    Ss   10:11   0:00 -bash
> postgres 11199  0.0  0.0 151052  1824 pts/0    R+   10:11   0:00 ps -u
> -bash-4.2$ ps -u -U postgres
> USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
> postgres   366  0.0  0.0 2409776 4336 ?        Ss   jul18   0:00 postgres:
>  (47476) idle
> postgres  6373  0.0  1.0 2408516 85128 ?       Ss   jul14  12:14 /usr/
> *pgsql-9.6*/bin/postmaster -D /data/9.6/
> postgres  6375  0.0  0.0 211132  1776 ?        Ss   jul14   0:03 postgres:
> logger process
> postgres  6377  0.0  1.5 2408780 124148 ?      Ss   jul14   0:49 postgres:
> checkpointer process
> postgres  6378  0.0  0.2 2408672 22220 ?       Ss   jul14   0:35 postgres:
> writer process
> postgres  6379  0.0  0.2 2408516 18264 ?       Ss   jul14   1:12 postgres:
> wal writer process
> postgres  6380  0.0  0.0 2409328 3052 ?        Ss   jul14   0:29 postgres:
> autovacuum launcher process
> postgres  6381  0.0  0.0 213252  1808 ?        Ss   jul14   0:08 postgres:
> archiver process   last was 0000000100000634000000ED
> postgres  6382  0.0  0.0 213404  2040 ?        Rs   jul14   2:45 postgres:
> stats collector process
> postgres  7297  0.0  0.0 2409780 4344 ?        Ss   jul22   0:00 postgres:
>  (48444) idle
> postgres  9737  0.0  0.0 2409776 4336 ?        Ss   jul19   0:00 postgres:
>  (33064) idle
> postgres 10871  0.0  0.0 147940  2240 ?        S    10:11   0:00 sshd:
> postgres@pts/0
> postgres 10872  0.0  0.0 115508  2104 pts/0    Ss   10:11   0:00 -bash
> postgres 11224  0.0  0.0 2410016 7360 ?        Ss   10:11   0:00 postgres:
>  (50372) idle
> postgres 11230  0.0  0.0 151052  1832 pts/0    R+   10:11   0:00 ps -u -U
> postgres
> postgres 12146  0.0 20.3 2444812 1631576 ?     Ss   jul15  10:21 postgres:
>  (47674) idle
> postgres 12164  0.1 25.8 2452860 2073548 ?     Ss   jul15  15:21 postgres:
>  (47676) idle
> postgres 12165  0.0 23.1 2447584 1857588 ?     Ss   jul15   8:16 postgres:
>  (47678) idle
> postgres 17289  0.0  0.0 2409780 4340 ?        Ss   jul24   0:00 postgres:
>  (41100) idle
> postgres 18785  0.0  0.0 2409780 4336 ?        Ss   jul21   0:00 postgres:
>  (44324) idle
> postgres 20412  0.0  0.0 2409776 4336 ?        Ss   jul19   0:00 postgres:
>  (60838) idle
> postgres 20817  0.0  0.0 2409780 4332 ?        Ss   jul23   0:00 postgres:
>  (53720) idle
> postgres 21330  0.0  1.5 2412856 121000 ?      Ss   jul20   0:00 postgres:
>  (38838) idle
> postgres 21443  0.0  1.4 2412824 119932 ?      Ss   jul20   0:00 postgres:
>  (39064) idle
> postgres 21481  0.0  1.4 2412824 119920 ?      Ss   jul20   0:00 postgres:
>  (39140) idle
> postgres 21496  0.0  1.5 2412884 121324 ?      Ss   jul20   0:00 postgres:
>  (39170) idle
> postgres 21511  0.0  0.0 2409776 4332 ?        Ss   jul18   0:00 postgres:
>  (60008) idle
> postgres 21534  0.0  1.4 2412824 119920 ?      Ss   jul20   0:00 postgres:
>  (39244) idle
> postgres 21538  0.0  1.4 2410488 119448 ?      Ss   jul20   0:00 postgres:
>  (39252) idle
> postgres 21589  0.0  1.4 2412824 119916 ?      Ss   jul20   0:00 postgres:
>  (39354) idle
> postgres 21642  0.0  0.0 2409780 4340 ?        Ss   jul20   0:00 postgres:
>  (39458) idle
> postgres 21777  0.0  0.0 2409780 4336 ?        Ss   jul20   0:00 postgres:
>  (39728) idle
> postgres 23082  0.0  0.0 2409780 4336 ?        Ss   jul20   0:00 postgres:
>  (39994) idle
> postgres 30396  0.0  0.0 2409776 4340 ?        Ss   jul16   0:00 postgres:
>  (53150) idle
> postgres 30625  0.0 15.5 2420808 1246456 ?     Ss   jul21   0:48 postgres:
>  (37528) idle
> postgres 30674  0.0  0.0 2409780 4332 ?        Ss   jul21   0:00 postgres:
>  (37626) idle
> postgres 30736  0.0  0.0 2409776 4336 ?        Ss   jul18   0:00 postgres:
>  (45482) idle
> -bash-4.2$
>
>
>
> bash-4.2$ cat postgresql.conf | grep 'mem\|buff\|conn'
> # "postgres -c log_connections=on".  Some parameters can be changed at run
> time
> *max_connections = 600* # (change requires restart)
> superuser_reserved_connections = 10 # (change requires restart)
> *shared_buffers = 2GB* # min 128kB
> #temp_buffers = 8MB # min 800kB
> *work_mem = 50MB * # min 64kB
> maintenance_work_mem = 256MB # min 1MB
> #autovacuum_work_mem = -1 # min 1MB, or -1 to use maintenance_work_mem
> dynamic_shared_memory_type = posix # the default is the first option
> # use none to disable dynamic shared memory
> #bgwriter_lru_maxpages = 100 # 0-1000 max buffers written/round
> #bgwriter_lru_multiplier = 2.0 # 0-10.0 multiplier on buffers scanned/round
> #wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers
> #log_connections = off
> #log_disconnections = off
> bash-4.2$
>
>
> Espero sirva para analizar,
> Aguardo comentarios.
> Saludos cordiales
>
>
> ------------------------------
> *De:* Jairo Graterón <jgrate...@gmail.com>
> *Enviado:* domingo, 24 de julio de 2022 18:34
> *Para:* jorge gerardo fernandez lugo <jorge...@hotmail.com>
> *Cc:* pgsql-es-ay...@postgresql.org <pgsql-es-ay...@postgresql.org>
> *Asunto:* Re: Limitar memoria postgresql
>
> Hola a todos
>
> Si tienes que revisar estas variables
>
> max_connections
> work_mem
> shared_buffers
> maintenance_work_mem
>
> Si puedes compartir esa información y el total de RAM. Además podrías
> ejecutar éste comando para ver cuanto consume cada proceso de postgres.
> ps -u -U postgres
>
> Saludos.
>
>
> El dom, 24 jul 2022 a las 11:19, jorge gerardo fernandez lugo (<
> jorge...@hotmail.com>) escribió:
>
> Bunas!
>
>
>
> Quisiera saber si existe algún parámetro del postgres.conf para limitar el
> uso de la memoria que Postgresql utiliza.
>
> El servidor de base de datos que utilizamos es un Linux dedicado solo al
> motor Postgresql, pero hace unos días que, el postgres consume toda la
> memoria disponible y, el SO, a fin de que no se cuelgue, dispara el oom
> killer y mata el PG.
>
>
>
> No estoy seguro si limitar el consumo de memoria es una combinación de los
> parámetros max_connections y el work_mem.
>
>
>
> Saludos cordiales a todos,
>
> Jorge Fernandez
>
>

Reply via email to