pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pg_dump out of memory
7+ messages / 4 participants
[nested] [flat]

* pg_dump out of memory
@ 2018-07-04 02:43 Andy Colson <andy@squeakycode.net>
  2018-07-04 03:21 ` Re: pg_dump out of memory Adrian Klaver <adrian.klaver@aklaver.com>
  2018-07-04 04:39 ` Re: pg_dump out of memory George Neuner <gneuner2@comcast.net>
  2018-07-04 05:31 ` Re: pg_dump out of memory David Rowley <david.rowley@2ndquadrant.com>
  0 siblings, 3 replies; 7+ messages in thread

From: Andy Colson @ 2018-07-04 02:43 UTC (permalink / raw)
  To: pgsql-general

Hi All,

I moved a physical box to a VM, and set its memory to 1Gig.  Everything
runs fine except one backup:


/pub/backup# pg_dump -Fc -U postgres -f wildfire.backup wildfirep

g_dump: Dumping the contents of table "ofrrds" failed: PQgetResult() failed.
pg_dump: Error message from server: ERROR:  out of memory
DETAIL:  Failed on request of size 1073741823.
pg_dump: The command was: COPY public.ofrrds (id, updateddate, bytes) TO
stdout;

I've been reducing my memory settings:

maintenance_work_mem = 80MB
work_mem = 5MB
shared_buffers = 200MB

But it doesnt seem to make a difference.
The tables looks like:

wildfire=# \dt+ ofrrds
                    List of relations
  Schema |  Name  | Type  | Owner | Size  | Description
--------+--------+-------+-------+-------+-------------
  public | ofrrds | table | andy  | 15 MB |


ildfire=# \d ofrrds
               Table "public.ofrrds"
    Column    |          Type          | Modifiers
-------------+------------------------+-----------
  id          | character varying(100) | not null
  updateddate | bigint                 | not null
  bytes       | bytea                  |
Indexes:
     "ofrrds_pk" PRIMARY KEY, btree (id)


wildfire=# select id, length(bytes) from ofrrds;
         id         |  length
-------------------+-----------
  muc_rooms         | 152330241
  packet_count      |  76165121
  muc_users         |  76165121
  sessions          |  76165121
  muc_occupants     |   9520641
  muc_traffic       |
  server_bytes      | 301850625
  proxyTransferRate |  76165121
  server_sessions   | 152330241
  conversations     | 304660481
(10 rows)


I'm not sure how to get this backup to run.  Any hints would be appreciated.

-Andy






^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_dump out of memory
  2018-07-04 02:43 pg_dump out of memory Andy Colson <andy@squeakycode.net>
@ 2018-07-04 03:21 ` Adrian Klaver <adrian.klaver@aklaver.com>
  2018-07-04 03:28   ` Re: pg_dump out of memory Andy Colson <andy@squeakycode.net>
  2 siblings, 1 reply; 7+ messages in thread

From: Adrian Klaver @ 2018-07-04 03:21 UTC (permalink / raw)
  To: Andy Colson <andy@squeakycode.net>; pgsql-general

On 07/03/2018 07:43 PM, Andy Colson wrote:
> Hi All,
> 
> I moved a physical box to a VM, and set its memory to 1Gig.  Everything
> runs fine except one backup:
> 
> 
> /pub/backup# pg_dump -Fc -U postgres -f wildfire.backup wildfirep
> 
> g_dump: Dumping the contents of table "ofrrds" failed: PQgetResult() 
> failed.
> pg_dump: Error message from server: ERROR:  out of memory
> DETAIL:  Failed on request of size 1073741823.
> pg_dump: The command was: COPY public.ofrrds (id, updateddate, bytes) TO
> stdout;
> 
> I've been reducing my memory settings:
> 
> maintenance_work_mem = 80MB
> work_mem = 5MB
> shared_buffers = 200MB
> 
> But it doesnt seem to make a difference.
> The tables looks like:
> 
> wildfire=# \dt+ ofrrds
>                     List of relations
>   Schema |  Name  | Type  | Owner | Size  | Description
> --------+--------+-------+-------+-------+-------------
>   public | ofrrds | table | andy  | 15 MB |
> 
> 
> ildfire=# \d ofrrds
>                Table "public.ofrrds"
>     Column    |          Type          | Modifiers
> -------------+------------------------+-----------
>   id          | character varying(100) | not null
>   updateddate | bigint                 | not null
>   bytes       | bytea                  |
> Indexes:
>      "ofrrds_pk" PRIMARY KEY, btree (id)
> 
> 
> wildfire=# select id, length(bytes) from ofrrds;
>          id         |  length
> -------------------+-----------
>   muc_rooms         | 152330241
>   packet_count      |  76165121
>   muc_users         |  76165121
>   sessions          |  76165121
>   muc_occupants     |   9520641
>   muc_traffic       |
>   server_bytes      | 301850625
>   proxyTransferRate |  76165121
>   server_sessions   | 152330241
>   conversations     | 304660481
> (10 rows)
> 
> 
> I'm not sure how to get this backup to run.  Any hints would be 
> appreciated.

Maybe:

1) Try:
	pg_dump -t ofrrds
    to dump only that table.

2) If that works then:

	pg_dump -T ofrrds
    to dump everything but that table.

> 
> -Andy
> 
> 
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_dump out of memory
  2018-07-04 02:43 pg_dump out of memory Andy Colson <andy@squeakycode.net>
  2018-07-04 03:21 ` Re: pg_dump out of memory Adrian Klaver <adrian.klaver@aklaver.com>
@ 2018-07-04 03:28   ` Andy Colson <andy@squeakycode.net>
  2018-07-04 04:04     ` Re: pg_dump out of memory Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 1 reply; 7+ messages in thread

From: Andy Colson @ 2018-07-04 03:28 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; pgsql-general

On 07/03/2018 10:21 PM, Adrian Klaver wrote:
> On 07/03/2018 07:43 PM, Andy Colson wrote:
>> Hi All,
>>
>> I moved a physical box to a VM, and set its memory to 1Gig.  Everything
>> runs fine except one backup:
>>
>>
>> /pub/backup# pg_dump -Fc -U postgres -f wildfire.backup wildfirep
>>
>> g_dump: Dumping the contents of table "ofrrds" failed: PQgetResult() failed.
>> pg_dump: Error message from server: ERROR:  out of memory
>> DETAIL:  Failed on request of size 1073741823.
>> pg_dump: The command was: COPY public.ofrrds (id, updateddate, bytes) TO
>> stdout;
>>
>>
>>
>> I'm not sure how to get this backup to run.  Any hints would be appreciated.
> 
> Maybe:
> 
> 1) Try:
>      pg_dump -t ofrrds
>     to dump only that table.
> 

It didnt work.  I get the same error.

Also, I'm running Slackware 14.2, and PG 9.5.11

-Andy






^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_dump out of memory
  2018-07-04 02:43 pg_dump out of memory Andy Colson <andy@squeakycode.net>
  2018-07-04 03:21 ` Re: pg_dump out of memory Adrian Klaver <adrian.klaver@aklaver.com>
  2018-07-04 03:28   ` Re: pg_dump out of memory Andy Colson <andy@squeakycode.net>
@ 2018-07-04 04:04     ` Adrian Klaver <adrian.klaver@aklaver.com>
  0 siblings, 0 replies; 7+ messages in thread

From: Adrian Klaver @ 2018-07-04 04:04 UTC (permalink / raw)
  To: Andy Colson <andy@squeakycode.net>; pgsql-general

On 07/03/2018 08:28 PM, Andy Colson wrote:
> On 07/03/2018 10:21 PM, Adrian Klaver wrote:
>> On 07/03/2018 07:43 PM, Andy Colson wrote:
>>> Hi All,
>>>
>>> I moved a physical box to a VM, and set its memory to 1Gig.  Everything
>>> runs fine except one backup:
>>>
>>>
>>> /pub/backup# pg_dump -Fc -U postgres -f wildfire.backup wildfirep
>>>
>>> g_dump: Dumping the contents of table "ofrrds" failed: PQgetResult() 
>>> failed.
>>> pg_dump: Error message from server: ERROR:  out of memory
>>> DETAIL:  Failed on request of size 1073741823.
>>> pg_dump: The command was: COPY public.ofrrds (id, updateddate, bytes) TO
>>> stdout;
>>>
>>>
>>>
>>> I'm not sure how to get this backup to run.  Any hints would be 
>>> appreciated.
>>
>> Maybe:
>>
>> 1) Try:
>>      pg_dump -t ofrrds
>>     to dump only that table.
>>
> 
> It didnt work.  I get the same error.

Well all I can think of is to give the VM more memory.

> 
> Also, I'm running Slackware 14.2, and PG 9.5.11
> 
> -Andy
> 
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_dump out of memory
  2018-07-04 02:43 pg_dump out of memory Andy Colson <andy@squeakycode.net>
@ 2018-07-04 04:39 ` George Neuner <gneuner2@comcast.net>
  2 siblings, 0 replies; 7+ messages in thread

From: George Neuner @ 2018-07-04 04:39 UTC (permalink / raw)
  To: pgsql-general

On Tue, 3 Jul 2018 21:43:38 -0500, Andy Colson <andy@squeakycode.net>
wrote:

>Hi All,
>
>I moved a physical box to a VM, and set its memory to 1Gig.  Everything
>runs fine except one backup:
>
>
>/pub/backup# pg_dump -Fc -U postgres -f wildfire.backup wildfirep
>
>g_dump: Dumping the contents of table "ofrrds" failed: PQgetResult() failed.
>pg_dump: Error message from server: ERROR:  out of memory
>DETAIL:  Failed on request of size 1073741823.
                                    ^^^^^^^^^^

pg_dump is trying to allocate 1GB.  Obviously it can't if 1GB is all
you have.


>pg_dump: The command was: COPY public.ofrrds (id, updateddate, bytes) TO
>stdout;
>
>wildfire=# \dt+ ofrrds
>                    List of relations
>  Schema |  Name  | Type  | Owner | Size  | Description
>--------+--------+-------+-------+-------+-------------
>  public | ofrrds | table | andy  | 15 MB |
>
>
>wildfire=# \d ofrrds
>               Table "public.ofrrds"
>    Column    |          Type          | Modifiers
>-------------+------------------------+-----------
>  id          | character varying(100) | not null
>  updateddate | bigint                 | not null
>  bytes       | bytea                  |
>Indexes:
>     "ofrrds_pk" PRIMARY KEY, btree (id)
>

There must be a heck of a lot of data in that bytea column.


>I'm not sure how to get this backup to run.  Any hints would be appreciated.

As Adrian mentioned already, you're going to have to give it more
memory somehow.  Either more RAM or a big swap file.

George





^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_dump out of memory
  2018-07-04 02:43 pg_dump out of memory Andy Colson <andy@squeakycode.net>
@ 2018-07-04 05:31 ` David Rowley <david.rowley@2ndquadrant.com>
  2018-07-04 14:38   ` Re: pg_dump out of memory Andy Colson <andy@squeakycode.net>
  2 siblings, 1 reply; 7+ messages in thread

From: David Rowley @ 2018-07-04 05:31 UTC (permalink / raw)
  To: Andy Colson <andy@squeakycode.net>; +Cc: pgsql-general

On 4 July 2018 at 14:43, Andy Colson <andy@squeakycode.net> wrote:
> I moved a physical box to a VM, and set its memory to 1Gig.  Everything
> runs fine except one backup:
>
>
> /pub/backup# pg_dump -Fc -U postgres -f wildfire.backup wildfirep
>
> g_dump: Dumping the contents of table "ofrrds" failed: PQgetResult() failed.
> pg_dump: Error message from server: ERROR:  out of memory
> DETAIL:  Failed on request of size 1073741823.> pg_dump: The command was: COPY public.ofrrds (id, updateddate, bytes) TO
> stdout;

There will be less memory pressure on the server if the pg_dump was
performed from another host. When running pg_dump locally the 290MB
bytea value will be allocated in both the backend process pg_dump is
using and pg_dump itself. Running the backup remotely won't require
the latter to be allocated on the server.

> I've been reducing my memory settings:
>
> maintenance_work_mem = 80MB
> work_mem = 5MB
> shared_buffers = 200MB

You may also get it to work by reducing shared_buffers further.
work_mem won't have any affect, neither will maintenance_work_mem.

Failing that, the suggestions of more RAM and/or swap look good.

-- 
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: pg_dump out of memory
  2018-07-04 02:43 pg_dump out of memory Andy Colson <andy@squeakycode.net>
  2018-07-04 05:31 ` Re: pg_dump out of memory David Rowley <david.rowley@2ndquadrant.com>
@ 2018-07-04 14:38   ` Andy Colson <andy@squeakycode.net>
  0 siblings, 0 replies; 7+ messages in thread

From: Andy Colson @ 2018-07-04 14:38 UTC (permalink / raw)
  To: David Rowley <david.rowley@2ndquadrant.com>; +Cc: pgsql-general

On 07/04/2018 12:31 AM, David Rowley wrote:
> On 4 July 2018 at 14:43, Andy Colson <andy@squeakycode.net> wrote:
>> I moved a physical box to a VM, and set its memory to 1Gig.  Everything
>> runs fine except one backup:
>>
>>
>> /pub/backup# pg_dump -Fc -U postgres -f wildfire.backup wildfirep
>>
>> g_dump: Dumping the contents of table "ofrrds" failed: PQgetResult() failed.
>> pg_dump: Error message from server: ERROR:  out of memory
>> DETAIL:  Failed on request of size 1073741823.> pg_dump: The command was: COPY public.ofrrds (id, updateddate, bytes) TO
>> stdout;
> 
> There will be less memory pressure on the server if the pg_dump was
> performed from another host. When running pg_dump locally the 290MB
> bytea value will be allocated in both the backend process pg_dump is
> using and pg_dump itself. Running the backup remotely won't require
> the latter to be allocated on the server.
> 
>> I've been reducing my memory settings:
>>
>> maintenance_work_mem = 80MB
>> work_mem = 5MB
>> shared_buffers = 200MB
> 
> You may also get it to work by reducing shared_buffers further.
> work_mem won't have any affect, neither will maintenance_work_mem.
> 
> Failing that, the suggestions of more RAM and/or swap look good.
> 

Adding more ram to the vm is the simplest option.  I just seems a waste cuz of one backup.

Thanks all.

-Andy




^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2018-07-04 14:38 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-07-04 02:43 pg_dump out of memory Andy Colson <andy@squeakycode.net>
2018-07-04 03:21 ` Adrian Klaver <adrian.klaver@aklaver.com>
2018-07-04 03:28   ` Andy Colson <andy@squeakycode.net>
2018-07-04 04:04     ` Adrian Klaver <adrian.klaver@aklaver.com>
2018-07-04 04:39 ` George Neuner <gneuner2@comcast.net>
2018-07-04 05:31 ` David Rowley <david.rowley@2ndquadrant.com>
2018-07-04 14:38   ` Andy Colson <andy@squeakycode.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox