[FUGSPBR] Aumentar Memoria

Fernando Silveira fern2 em wings.com.br
Seg Nov 25 15:25:48 BRST 2002


Da-lhe Carlos,

Cheguei ao arquivo  etc/sysctl.conf mais não sei quanto esta sendo utilizado
de memoria e onde configurar ???
O texto abaixo explica o que tenho que fazer no RedHat, como fazer no
FreeBSD ??

"The single biggest thing that you have to do before running Postgresql, is
to provide enough shared buffer space. Let me repeat: provide enough buffer
space! Let's say you have about 512MB of ram on a dedicated database server,
then you need to turn over about 75-percent of it to this shared buffer.
Postgresql does best when it can load most or -- even better -- all of a
table into its shared memory space. In our case, since our database was
fairly small, I decided to allocate 128MB of RAM towards the shared buffer
space.

The file /var/lib/pgsql/data/postgresql.conf contains settings for the
database server. Postgresql uses system shared memory as a buffer. On a
Linux system, you can see how much shared memory was allocated by your
system by running the command:
cat /proc/sys/kernel/shmmax

And to view shared memory use on the system:
ipcs

The result will be in bytes. By default RedHat 7.1 allocates 32MB of shared
memory, hardly enough for postgresql. I increased this limit to 128MB by
doing the command:
echo 128000000 > /proc/sys/kernel/shmmax

Be aware that once you reboot the server, this setting will disappear. You
need to place this line in your postgresql startup file, or by editing the
/etc/sysctl.conf file for a more permanent setting.

Then in our postgresql.conf I set shared_buffers to 15200. Because
Postgresql uses 8K segments, I made a calculation of 128000/8192 plus a 512K
overhead. I also set our sort_mem to 32168 (32Megs for a sort memory area).
Since connection pooling was in effect, I set max_connections to 64. And
fsync was also set to false.

shared_buffers = 15200
sort_mem = 32168
max_connections=64
fsync=false"
http://www.phpbuilder.com/columns/smith20010821.php3?page=2







----- Original Message -----
From: "Carlos Alberto" <carlinho em xprt.eti.br>
To: <fugspbr em fugspbr.org>
Sent: Monday, November 25, 2002 8:23 AM
Subject: Re: [FUGSPBR] Aumentar Memoria


> de uma olhada no arquivo post-install-notes, que fica no diretorio ~pgsql.
> la existem varias informacoes referentes a alteracoes no kernel do
> FreeBSD, creio que a resposta a sua duvida pode estar nesse arquivo.
>
> carlinho.
> ---------- Original Message -----------
> From: "Fernando Silveira" <fern2 em wings.com.br>
> To: <fugspbr em fugspbr.org>
> Sent: Mon, 25 Nov 2002 08:36:23 -0400
> Subject: [FUGSPBR] Aumentar Memoria
>
> > Tenho o Postgresql instalado num servidor com FreeBSD 4.7 soh
> > que estou querendo ganhar um pouco mais de performance. Entao
> > quando postei esta duvida numa lista de post pediram para que
> > eu aumentasse a memoria do Kernel do SO, como fazer isto no
> > FreeBSD ???
> >
> > Fernando
> >
> > Minha Pergunta na Lista de Postgresql ...
> > Tenho uma maquina Servidor HP P4 com CPU 2G, 2.5G de memoria, tenho
> > instalado o Postgres com FreeBSD, alguns select mais recheados
> > estão consumindo tudo que existe de CPU, mais a memoria esta
> > lah livre.
> >
> > >Note que voce provavelmente deveria aumentar o valor de >memoria
> > >compartilhada do nucleo do seu sistema operacional. No >GNU/Linux isso
e'
> > >muito facil. O padrao geralmente e' 32 MiB. Para aumentar para >128
MiB,
> > >por exemplo, voce faria:
> >
> > >echo 128000000 > /proc/sys/kernel/shmmax
> >
> > _______________________________________________________________
> > Sair da Lista: http://www2.fugspbr.org/mailman/listinfo/fugspbr
> > Historico: http://www4.fugspbr.org/lista/html/FUG-BR/
> ------- End of Original Message -------
>
> _______________________________________________________________
> Sair da Lista: http://www2.fugspbr.org/mailman/listinfo/fugspbr
> Historico: http://www4.fugspbr.org/lista/html/FUG-BR/
>
>


_______________________________________________________________
Sair da Lista: http://www2.fugspbr.org/mailman/listinfo/fugspbr
Historico: http://www4.fugspbr.org/lista/html/FUG-BR/



Mais detalhes sobre a lista de discussão freebsd