Lima, uma das coisas que me ajudaram a ter algum ganho de performance foi ajustar os parâmetros do Kernel, tais como:
vi /etc/sysctl.conf # ***** CONFIGURAÇÃO ***** # cat /proc/meminfo | grep Huge # exemplo => Hugepagesize: 2048 kB # nr_hugepages => (1.6 * 1024-Mb * 1024-Kb) / 2048-Kb = 819,20 # echo 820 > /proc/sys/vm/nr_hugepages # getconf PAGE_SIZE # /sbin/sysctl -a | grep shm # ipcs -lm # cat /proc/sys/kernel/sem # /proc/sys/kernel/shmmax - The maximum size of a shared memory segment. # /proc/sys/kernel/shmmni - The maximum number of shared memory segments. # /proc/sys/kernel/shmall - The maximum amount of shared memory # Controls the maximum number of shared memory segments, in pages #shmall => shmmax / PAGE_SIZE (4096) = 786432 # Controls the maximum shared segment size, in bytes #shmmax => 3 x 1024-Mb * 1024-Kb * 1024-Byte = 3221225472 #shmmni => 1 x 1024-Mb * 1024-Kb * 1024-Byte = 1073741824 #shmmni => 4096 kernel.sem = 250 32000 100 128 kernel.shmmax = 3221225472 kernel.shmall = 786432 kernel.shmmni = 4096 vm.overcommit_memory = 2 vm.overcommit_ratio = 90 vm.nr_hugepages = 264 net.core.rmem_default = 16777216 net.core.wmem_default = 16777216 net.core.wmem_max = 16777216 net.core.rmem_max = 16777216 fs.file-max = 65536 Outra é liberar o limite (min, max) hard e soft para o processo Postgres vi /etc/security/limits.conf postgres soft noproc 4096 postgres soft nofile 4096 postgres hard noproc 65536 postgres hard nofile 65536 E também utilizar o sistema de arquivos XFS: vi /etc/fstab /dev/sda3 /dados xfs noatime,nodiratime,nobarrier 0 2 vi /etc/rc.local echo '512' > /sys/block/sda/queue/nr_requests echo 'deadline' > /sys/block/sda/queue/scheduler E o mais importante é ter o pg_xlog em outro disco, então eu lhe indico comprar outro HD SAS e montá-lo somente para o pg_xlog, comisso seu tempo irá cair ainda MUITO MAIS, tenha a certeza disso. Utilizando o pgfounie você verá grandes mudanças, e acredito qeu vc. consiga pegar mais orientações utilizando o kSar para obter alguns gráficos de pico de I/O no momento em que tua aplicação fica lenta e acabar melhorando o intervalo do segment point. Dennys 2011/8/11 Lima - Lojas Fricke Ltda <[email protected]> > > Outros valores são esses Euler > > vmstat -S M 1 5 > procs -----------memory---------- ---swap-- -----io---- --system-- > -----cpu------ > r b swpd free buff cache si so bi bo in cs us sy > id wa st > 4 0 0 3298 166 10235 0 0 3 15 6 0 2 0 > 97 0 0 > 1 0 0 3297 166 10235 0 0 0 24 1491 1119 1 0 > 99 0 0 > 1 1 0 3304 166 10235 0 0 0 364 1267 683 6 0 > 93 1 0 > 1 0 0 3304 166 10235 0 0 0 24 1530 1625 1 0 > 99 0 0 > 0 0 0 3331 166 10235 0 0 0 84 2112 2570 1 1 > 98 0 0 > > > Lucas > _______________________________________________ > pgbr-geral mailing list > [email protected] > https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral > -- Atenciosamente, *Dennys Santos Sobrinho* Analista, DBA e Desenvolvedor Sênior Centro de Informática - FAESP-SENAR / SP (11) 3121-7233 Ramal 1071 *www.faespsenar.com.br* *Plante, cultive e colha a Paz*.
_______________________________________________ pgbr-geral mailing list [email protected] https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral
