Re: Urgent -- High memory usage on PostgreSQL server - Mailing list pgsql-general

From Jan Kesten
Subject Re: Urgent -- High memory usage on PostgreSQL server
Date
Msg-id 4D05D19F.30507@dafuer.de
Whole thread Raw
In response to Urgent -- High memory usage on PostgreSQL server  (savio rodriges <sj_savio@yahoo.com>)
List pgsql-general
Hello Savio,

> top - 21:43:35 up 55 days,  8:07,  4 users,  load average: 0.05,
> 0.25, 0.17 Tasks: 257 total,   1 running, 256 sleeping,   0 stopped,
> 0 zombie Cpu(s):  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,
> 0.0%hi,  0.0%si,  0.0%st Mem:   8165696k total,  7943160k used,
> 222536k free,   282044k buffers Swap:  8385920k total,   112828k
> used,  8273092k free,  4793732k cached

this looks kind of normal behaviour. Your system uses almost your entire
ram right, but if you look at buffers and cached  in your top output
about 5 GB of your 8GB are used there. Only the remaining 3GB are used
by postgres or other applications.

Every "new" linux I know will use non-used ram for caching your
filesystem data for example to achieve 100% memory usage. This is "a
good thing" (TM) as postgres will run better if there is caching on os
level and the instance knows about this:

> effective_cache_size = <num> — This value tells PostgreSQL's
> optimizer how much memory PostgreSQL has available for caching data
> and helps in determing whether or not it use an index or not. The
> larger the value increases the likely hood of using an index. This
> should be set to the amount of memory allocated to shared_buffers
> plus the amount of OS cache available. Often this is more than 50% of
> the total system memory.

So don't worry - everything is fine. You should pay attention that your
system doesn't start swapping.

Cheers,
Jan

pgsql-general by date:

Previous
From: Paul McGarry
Date:
Subject: Re: Urgent -- High memory usage on PostgreSQL server
Next
From: Jan Kesten
Date:
Subject: Re: pg_dump order of rows