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 00:45:06
Message-ID: CAGYUkGVsrZ0iqXEdX5D4seYg-=bJuZGZyrOL7WZh5gL=9A5wrw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-performance

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alexander Gataric 2012-10-15 00:52:09 Mapping PostgreSQL data types to DB2 Federated Server
Previous Message Tom Lane 2012-10-14 20:35:07 Re: Using incorrect default-value type

Browse pgsql-performance by date

  From Date Subject
Next Message Alexander Gataric 2012-10-15 00:52:09 Mapping PostgreSQL data types to DB2 Federated Server
Previous Message Tom Lane 2012-10-14 16:15:32 Re: Query with limit goes from few ms to hours