Re: VACUUM FULL out of memory
Re: VACUUM FULL out of memory
От:
"Michael Omotayo Akinde" <michael.o.akinde@met.no>
Дата:
Just to conclude on the issue we had here. As far as I can see, the ulimits are set up as they should; and on a 64-bit machine with 16GB RAM, I don't see there should be a problem with allocating 2 GB maintenance work memory. In any case, I have serious difficulty believing that the ulimits can be the problem since PostgreSQL reacts the same even with maintenance work memory set very low. Basically, all of the tests we've run over the past couple of weeks end the same. VACUUM FULL on the tables runs out of memory and crashes. Ordinary VACUUM runs fine (albeit slowly) - but recommends that one runs VACUUM FULL. Unfortunately, we will not have resources to run further test runs on this for a while. If we get time next month, I may try to create a small test case that demonstrates the problem (shouldn't be too hard to do - I expect throwing in some gigabytes of objects should do the trick), if anyone is interested. Our solution to the issue will have to be simply to warn users/adopters of our system to never run VACUUM FULL on the largeobject table. Regards, Michael Akinde Database Architect, Met.no ---- Michael wrote: ---- Thanks for the explanation on the ulimits; I can see how that could turn out a problem in some cases. Following Tom's suggestion, here is the startup script I used: #!/bin/sh ulimit -a > $PGHOST/server.ulimit pg_ctl start -l $PGHOST/server.log The ulimits seem to be the same, though: $> cat server.ulimit core file size (blocks, -c) 100000000 data seg size (kbytes, -d) unlimited max nice (-e) 0 file size (blocks, -f) unlimited pending signals (-i) unlimited max locked memory (kbytes, -l) unlimited max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) unlimited max rt priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) unlimited virtual memory (kbytes, -v) unlimited file locks (-x) unlimited Regards, Michael A. Tom Lane wrote: > Andrew Sullivan writes: > >> On Tue, Jan 08, 2008 at 05:27:16PM +0100, Michael Akinde wrote: >> >>> Those are the ulimits of the db_admin account (i.e., the user that set >>> up and runs the DB processes). Is Postgres limited by other settings? >>> >> On one system I used many years ago, /bin/sh wasn't what I thought it was, >> and so the ulimit that I got when logged in was not what the postmaster was >> starting under. Took me many days to figure out what was up. >> > > The only thing I find convincing is to insert "ulimit -a >someplace" > into the script that starts the postmaster, adjacent to where it does > so, and then reboot. There are too many systems on which daemons are > launched under settings different from what interactive shells use > (a policy that's often a good one, too). > > regards, tom lane > Content-Type: multipart/alternative;boundary="------------060809000001070209000406" --------------060809000001070209000406 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Thanks for the explanation on the ulimits; I can see how that could turn out a problem in some cases. Following Tom's suggestion, here is the startup script I used: #!/bin/sh ulimit -a > $PGHOST/server.ulimit pg_ctl start -l $PGHOST/server.log The ulimits seem to be the same, though: $> cat server.ulimit core file size (blocks, -c) 100000000 data seg size (kbytes, -d) unlimited max nice (-e) 0 file size (blocks, -f) unlimited pending signals (-i) unlimited max locked memory (kbytes, -l) unlimited max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) unlimited max rt priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) unlimited virtual memory (kbytes, -v) unlimited file locks (-x) unlimited Regards, Michael A. Tom Lane wrote: > Andrew Sullivan writes: > >> On Tue, Jan 08, 2008 at 05:27:16PM +0100, Michael Akinde wrote: >> >>> Those are the ulimits of the db_admin account (i.e., the user that set >>> up and runs the DB processes). Is Postgres limited by other settings? >>> >> On one system I used many years ago, /bin/sh wasn't what I thought it was, >> and so the ulimit that I got when logged in was not what the postmaster was >> starting under. Took me many days to figure out what was up. >> > > The only thing I find convincing is to insert "ulimit -a >someplace" > into the script that starts the postmaster, adjacent to where it does > so, and then reboot. There are too many systems on which daemons are > launched under settings different from what interactive shells use > (a policy that's often a good one, too). > > regards, tom lane > --------------060809000001070209000406 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Thanks for the explanation on the ulimits; I can see how that could turn out a problem in some cases.
Following Tom's suggestion, here is the startup script I used:
#!/bin/sh
ulimit -a > $PGHOST/server.ulimit
pg_ctl start -l $PGHOST/server.log
The ulimits seem to be the same, though:
$> cat server.ulimit
core file size (blocks, -c) 100000000
data seg size (kbytes, -d) unlimited
max nice (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) unlimited
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) unlimited
max rt priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) unlimited
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
Regards,
Michael A.
Tom Lane wrote:Andrew Sullivan <ajs@crankycanuck.ca> writes:On Tue, Jan 08, 2008 at 05:27:16PM +0100, Michael Akinde wrote:Those are the ulimits of the db_admin account (i.e., the user that set up and runs the DB processes). Is Postgres limited by other settings?On one system I used many years ago, /bin/sh wasn't what I thought it was, and so the ulimit that I got when logged in was not what the postmaster was starting under. Took me many days to figure out what was up.The only thing I find convincing is to insert "ulimit -a >someplace" into the script that starts the postmaster, adjacent to where it does so, and then reboot. There are too many systems on which daemons are launched under settings different from what interactive shells use (a policy that's often a good one, too). regards, tom lane
--------------060809000001070209000406--
Re: VACUUM FULL out of memory
От:
Simon Riggs <simon@2ndquadrant.com>
Дата:
On Wed, 2008-01-16 at 21:53 +0100, Michael Omotayo Akinde wrote: > As far as I can see, the ulimits are set up as they should; and on a > 64-bit machine with 16GB RAM, I don't see there should be a problem > with allocating 2 GB maintenance work memory. In any case, I have > serious difficulty believing that the ulimits can be the problem since > PostgreSQL reacts the same even with maintenance work memory set very > low. > > Basically, all of the tests we've run over the past couple of weeks > end the same. VACUUM FULL on the tables runs out of memory and > crashes. Ordinary VACUUM runs fine (albeit slowly) - but recommends > that one runs VACUUM FULL. Not surprising: AFAIK VACUUM FULL does not limit itself to maintenance_work_mem. Or put another way, VF ignores both kinds of work_mem completely. -- Simon Riggs 2ndQuadrant http://www.2ndQuadrant.com