Обсуждение: Re out of memory error with large insert

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

Re out of memory error with large insert

От
"Sriram Dandapani"
Дата:

-----Original Message-----
From: Sriram Dandapani
Sent: Tuesday, March 21, 2006 4:01 PM
To: 'Tom Lane'
Subject: RE: [ADMIN] out of memory error with large insert

Upon monitoring with top, the insert statement process keeps eating up
memory until there is nothing left on the linux box

Why doesn't Postgres use swap in this situation

Can we control this behavior thru postgresconf.sql


-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: Tuesday, March 21, 2006 2:38 PM
To: Sriram Dandapani
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] out of memory error with large insert

"Sriram Dandapani" <sdandapani@counterpane.com> writes:
> On a large transaction involving an insert of 8 million rows, after a
> while Postgres complains of an out of memory error.

If there are foreign-key checks involved, try dropping those constraints
and re-creating them afterwards.  Probably faster than retail checks
anyway ...

            regards, tom lane

Re: Re out of memory error with large insert

От
Tom Lane
Дата:
"Sriram Dandapani" <sdandapani@counterpane.com> writes:
> Why doesn't Postgres use swap in this situation

Perhaps you need to adjust the ulimit settings that the postmaster is
started under.

            regards, tom lane

Re: Re out of memory error with large insert

От
"Sriram Dandapani"
Дата:
What are the recommended ulimit settings. A single postgres connection
that does an insert(with no other database activity) of say 6 million
rows into a 15 column table (all integer columns) cannot complete due to
an out of memory error

This happens on a 4Gb Linux box with shmmax set to 1gb and about 50000
shared_buffers

I would really appreciate any help ...

Thanks

Sriram

-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: Tuesday, March 21, 2006 7:24 PM
To: Sriram Dandapani
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Re out of memory error with large insert

"Sriram Dandapani" <sdandapani@counterpane.com> writes:
> Why doesn't Postgres use swap in this situation

Perhaps you need to adjust the ulimit settings that the postmaster is
started under.

            regards, tom lane