Re: Memory issues

From: Shiran Kleiderman <shirank1(at)gmail(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Memory issues
Date: 2012-10-15 02:36:02
Message-ID: CAGYUkGWWzAi2UusQo6_KrpMi9hWdDb97tCBS8fQNGF_XoUt38g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-performance

Hi
This is the output of meminfo when the system is under some stress.
Thanks

cif(at)ip-10-194-167-240:/tmp$ cat /proc/meminfo
MemTotal: 7629508 kB
MemFree: 37820 kB
Buffers: 2108 kB
Cached: 5500200 kB
SwapCached: 332 kB
Active: 4172020 kB
Inactive: 3166244 kB
Active(anon): 1864040 kB
Inactive(anon): 1568760 kB
Active(file): 2307980 kB
Inactive(file): 1597484 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 524284 kB
SwapFree: 0 kB
Dirty: 23336 kB
Writeback: 0 kB
AnonPages: 1835716 kB
Mapped: 1610460 kB
Shmem: 1596916 kB
Slab: 136168 kB
SReclaimable: 123820 kB
SUnreclaim: 12348 kB
KernelStack: 1176 kB
PageTables: 23148 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 4339036 kB
Committed_AS: 4517524 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 26152 kB
VmallocChunk: 34359710052 kB
HardwareCorrupted: 0 kB
AnonHugePages: 0 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
DirectMap4k: 7872512 kB
DirectMap2M: 0 kB

On Mon, Oct 15, 2012 at 2:45 AM, Shiran Kleiderman <shirank1(at)gmail(dot)com>wrote:

> Hi
> I've returned the memory configs to the default, erased data from my db
> and am testing the system again.
>
> This is the output of *cat /proc/meminfo*
> Thanks
>
> root(at)ip-10-194-167-240:~# cat /proc/meminfo
> MemTotal: 7629508 kB
> MemFree: 170368 kB
> Buffers: 10272 kB
> Cached: 6220848 kB
> SwapCached: 0 kB
> Active: 3249748 kB
> Inactive: 3936960 kB
> Active(anon): 971336 kB
> Inactive(anon): 2103844 kB
> Active(file): 2278412 kB
> Inactive(file): 1833116 kB
> Unevictable: 0 kB
> Mlocked: 0 kB
> SwapTotal: 524284 kB
> SwapFree: 522716 kB
> Dirty: 83068 kB
> Writeback: 3080 kB
> AnonPages: 955856 kB
> Mapped: 2132564 kB
> Shmem: 2119424 kB
> Slab: 157200 kB
> SReclaimable: 144488 kB
> SUnreclaim: 12712 kB
> KernelStack: 1184 kB
> PageTables: 21092 kB
> NFS_Unstable: 0 kB
> Bounce: 0 kB
> WritebackTmp: 0 kB
> CommitLimit: 4339036 kB
> Committed_AS: 3637424 kB
> VmallocTotal: 34359738367 kB
> VmallocUsed: 26152 kB
> VmallocChunk: 34359710052 kB
> HardwareCorrupted: 0 kB
> AnonHugePages: 0 kB
> HugePages_Total: 0
> HugePages_Free: 0
> HugePages_Rsvd: 0
> HugePages_Surp: 0
> Hugepagesize: 2048 kB
> DirectMap4k: 7872512 kB
> DirectMap2M: 0 kB
>
>
> On Thu, Sep 27, 2012 at 8:59 AM, Andres Freund <andres(at)2ndquadrant(dot)com>wrote:
>
>> On Monday, September 24, 2012 08:45:06 AM Shiran Kleiderman wrote:
>> > Hi,
>> > I'm using and Amazon ec2 instance with the following spec and the
>> > application that I'm running uses a postgres DB 9.1.
>> > The app has 3 main cron jobs.
>> >
>> > *Ubuntu 12, High-Memory Extra Large Instance
>> > 17.1 GB of memory
>> > 6.5 EC2 Compute Units (2 virtual cores with 3.25 EC2 Compute Units each)
>> > 420 GB of instance storage
>> > 64-bit platform*
>> >
>> > I've changed the main default values under file *postgresql.conf* to:
>> > shared_buffers = 4GB
>> > work_mem = 16MB
>> > wal_buffers = 16MB
>> > checkpoint_segments = 32
>> > effective_cache_size = 8GB
>> >
>> > When I run the app, after an hour or two, free -m looks like below ans
>> the
>> > crons can't run due to memory loss or similar (i'm new to postgres and
>> db
>> > admin).
>> > Thanks!
>> >
>> > free -m, errors:
>> >
>> > total used free shared buffers cached
>> > Mem: 17079 13742 3337 0 64 11882
>> > -/+ buffers/cache: 1796 15283
>> > Swap: 511 0 511
>> >
>> > total used *free* shared buffers cached
>> > Mem: 17079 16833 *245 *0 42 14583
>> > -/+ buffers/cache: 2207 14871
>> > Swap: 511 0 511
>> >
>> > **free above stays low even when nothing is running.
>> >
>> > **errors:
>> > *DBI connect('database=---;host=localhost','postgres',...) failed: could
>> > not fork new process for connection: Cannot allocate memory*
>> > could not fork new process for connection: Cannot allocate memory
>> >
>> > and
>> > execute failed: ERROR: out of memory
>> > DETAIL: Failed on request of size 968. [for Statement "
>> > SELECT DISTINCT....
>> could you show cat /proc/meminfo?
>>
>> Greetings,
>>
>> Andres
>> --
>> Andres Freund http://www.2ndQuadrant.com/
>> PostgreSQL Development, 24x7 Support, Training & Services
>>
>
>
>
> --
> Best,
> Shiran Kleiderman
> +972 - 542380838
> Skype - shirank1
>
>

--
Best,
Shiran Kleiderman
+972 - 542380838
Skype - shirank1

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2012-10-15 03:27:10 Re: Re: [GENERAL] Mapping PostgreSQL data types to DB2 Federated Server
Previous Message Craig Ringer 2012-10-15 01:47:48 Re: Re: [GENERAL] Mapping PostgreSQL data types to DB2 Federated Server

Browse pgsql-performance by date

  From Date Subject
Next Message John Nash 2012-10-15 08:22:00 WebSphere Application Server support for postgres
Previous Message John R Pierce 2012-10-15 01:05:28 Re: Mapping PostgreSQL data types to DB2 Federated Server