Обсуждение: Memory Problem

Поиск
Список
Период
Сортировка

Memory Problem

От
Nicolas Michel
Дата:
Hi here,

Our server had 2GB of RAM. We added some memory to have 16GB. We are on a debian etch. I installed the "bigmem" kernel to use the all memory :
~# cat /proc/meminfo
MemTotal:     16573232 kB
MemFree:      15448836 kB
Buffers:        133772 kB
Cached:         445388 kB
SwapCached:          0 kB
Active:         782764 kB
Inactive:       302760 kB
HighTotal:    15794120 kB
HighFree:     14838384 kB
LowTotal:       779112 kB
LowFree:        610452 kB
SwapTotal:     2658716 kB
SwapFree:      2658716 kB
Dirty:             452 kB
Writeback:           4 kB
AnonPages:      506336 kB
Mapped:         126524 kB
Slab:            27620 kB
PageTables:       3036 kB
NFS_Unstable:        0 kB
Bounce:              0 kB
CommitLimit:  10945332 kB
Committed_AS:  2187952 kB
VmallocTotal:   118776 kB
VmallocUsed:      3716 kB
VmallocChunk:   114640 kB

I wanted to give to postgres 4GB. So I tryied to set shmmax to 4Go :
sysctl kernel.shmmax=4294967296

But it doesn't work : if I launch after this modification this command :
sysctl kernel.shmmax
it gives me this response :
kernel.shmmax = 0

Why? Is there a limit to shmmax?

Re: Memory Problem

От
Thomas Markus
Дата:
hi,

i assume you have a 32bit system so you cant set shmmax to 4gb. as a
side effect your value 4294967296 in a binary 32bit representation is
exactly 0. look for previous threads about shmmax. and use a 64bit system :)

regards
thomas

Nicolas Michel schrieb:
> Hi here,
>
> Our server had 2GB of RAM. We added some memory to have 16GB. We are
> on a debian etch. I installed the "bigmem" kernel to use the all memory :
>
>     ~# cat /proc/meminfo
>     MemTotal:     16573232 kB
>     MemFree:      15448836 kB
>     Buffers:        133772 kB
>     Cached:         445388 kB
>     SwapCached:          0 kB
>     Active:         782764 kB
>     Inactive:       302760 kB
>     HighTotal:    15794120 kB
>     HighFree:     14838384 kB
>     LowTotal:       779112 kB
>     LowFree:        610452 kB
>     SwapTotal:     2658716 kB
>     SwapFree:      2658716 kB
>     Dirty:             452 kB
>     Writeback:           4 kB
>     AnonPages:      506336 kB
>     Mapped:         126524 kB
>     Slab:            27620 kB
>     PageTables:       3036 kB
>     NFS_Unstable:        0 kB
>     Bounce:              0 kB
>     CommitLimit:  10945332 kB
>     Committed_AS:  2187952 kB
>     VmallocTotal:   118776 kB
>     VmallocUsed:      3716 kB
>     VmallocChunk:   114640 kB
>
>
> I wanted to give to postgres 4GB. So I tryied to set shmmax to 4Go :
>
>     sysctl kernel.shmmax=4294967296
>
>
> But it doesn't work : if I launch after this modification this command :
>
>     sysctl kernel.shmmax
>
> it gives me this response :
>
>     kernel.shmmax = 0
>
> Why? Is there a limit to shmmax?


Re: Memory Problem

От
Iñigo Martinez Lasala
Дата:
If you are working in a 32bit environment you cannot address 4GB per process. Try with 3500000000 for example.

-----Original Message-----
From: Nicolas Michel <nicolas.michel@lemail.be>
To: pgsql-admin@postgresql.org
Subject: [ADMIN] Memory Problem
Date: Fri, 03 Apr 2009 11:35:42 +0200

Hi here,

Our server had 2GB of RAM. We added some memory to have 16GB. We are on a debian etch. I installed the "bigmem" kernel to use the all memory :
~# cat /proc/meminfo
MemTotal:     16573232 kB
MemFree:      15448836 kB
Buffers:        133772 kB
Cached:         445388 kB
SwapCached:          0 kB
Active:         782764 kB
Inactive:       302760 kB
HighTotal:    15794120 kB
HighFree:     14838384 kB
LowTotal:       779112 kB
LowFree:        610452 kB
SwapTotal:     2658716 kB
SwapFree:      2658716 kB
Dirty:             452 kB
Writeback:           4 kB
AnonPages:      506336 kB
Mapped:         126524 kB
Slab:            27620 kB
PageTables:       3036 kB
NFS_Unstable:        0 kB
Bounce:              0 kB
CommitLimit:  10945332 kB
Committed_AS:  2187952 kB
VmallocTotal:   118776 kB
VmallocUsed:      3716 kB
VmallocChunk:   114640 kB

I wanted to give to postgres 4GB. So I tryied to set shmmax to 4Go :
sysctl kernel.shmmax=4294967296

But it doesn't work : if I launch after this modification this command :
sysctl kernel.shmmax
it gives me this response :
kernel.shmmax = 0

Why? Is there a limit to shmmax?

Re: Memory Problem

От
Michael Monnerie
Дата:
On Freitag 03 April 2009 Nicolas Michel wrote:
> Why? Is there a limit to shmmax?

Works for me on kernel 2.6.28.9. What kernel do you have, are you root
and are there any logs in messages/warn or dmesg?

mfg zmi
--
// Michael Monnerie, Ing.BSc    -----      http://it-management.at
// Tel: 0660 / 415 65 31                      .network.your.ideas.
// PGP Key:         "curl -s http://zmi.at/zmi.asc | gpg --import"
// Fingerprint: AC19 F9D5 36ED CD8A EF38  500E CE14 91F7 1C12 09B4
// Keyserver: wwwkeys.eu.pgp.net                  Key-ID: 1C1209B4


Re: Memory Problem

От
Nicolas Michel
Дата:
Thank you very much. I didn't know that. I set my shmmax to 4000000000 but you're right, we will see to use a 64 bits system ;)


Le vendredi 03 avril 2009 à 12:37 +0200, Thomas Markus a écrit :
hi,

i assume you have a 32bit system so you cant set shmmax to 4gb. as a 
side effect your value 4294967296 in a binary 32bit representation is 
exactly 0. look for previous threads about shmmax. and use a 64bit system :)

regards
thomas

Nicolas Michel schrieb:
> Hi here,
>
> Our server had 2GB of RAM. We added some memory to have 16GB. We are 
> on a debian etch. I installed the "bigmem" kernel to use the all memory :
>
>     ~# cat /proc/meminfo
>     MemTotal:     16573232 kB
>     MemFree:      15448836 kB
>     Buffers:        133772 kB
>     Cached:         445388 kB
>     SwapCached:          0 kB
>     Active:         782764 kB
>     Inactive:       302760 kB
>     HighTotal:    15794120 kB
>     HighFree:     14838384 kB
>     LowTotal:       779112 kB
>     LowFree:        610452 kB
>     SwapTotal:     2658716 kB
>     SwapFree:      2658716 kB
>     Dirty:             452 kB
>     Writeback:           4 kB
>     AnonPages:      506336 kB
>     Mapped:         126524 kB
>     Slab:            27620 kB
>     PageTables:       3036 kB
>     NFS_Unstable:        0 kB
>     Bounce:              0 kB
>     CommitLimit:  10945332 kB
>     Committed_AS:  2187952 kB
>     VmallocTotal:   118776 kB
>     VmallocUsed:      3716 kB
>     VmallocChunk:   114640 kB
>
>
> I wanted to give to postgres 4GB. So I tryied to set shmmax to 4Go :
>
>     sysctl kernel.shmmax=4294967296
>
>
> But it doesn't work : if I launch after this modification this command :
>
>     sysctl kernel.shmmax
>
> it gives me this response :
>
>     kernel.shmmax = 0
>
> Why? Is there a limit to shmmax? 


Re: Memory Problem

От
Flavio Henrique Araque Gurgel
Дата:
Hello!

> Thank you very much. I didn't know that. I set my shmmax to 4000000000 but you're right, we will see to use a 64 bits
system;)  

My experience with this amount of memory in Debian Etch works much better in a 64bit environment. BIGMEM kernel handles
pagesin a way that the performance is a bit degraded.  

> I wanted to give to postgres 4GB. So I tryied to set shmmax to 4Go :
>
>     sysctl kernel.shmmax=4294967296
>
>
> But it doesn't work : if I launch after this modification this command :
>
>     sysctl kernel.shmmax
>
> it gives me this response :
>
>     kernel.shmmax = 0
>
> Why? Is there a limit to shmmax?

I don't see limits in shmmax but the command you're typing is wrong.
To set a value you need to do:
sysctl -w kernel.shmmax=VALUE

or alternatively:
cat VALUE > /proc/sys/kernel/shmmax

Don't forget to write in your /etc/sysctl.conf:
kernel.shmmax=VALUE
Without spaces. This will make your setting persistent.

Regards
Flavio