Sven Willenberger
2005-Jun-29 13:00 UTC
PostgreSQL's vacuumdb fails to allocate memory for non-root users
FreeBSD 5.4-Release PostgreSQL 8.0.3 I noticed that the nightly cron consisting of a vacuumdb was failing due to "unable to allocate memory". I do have maintenance_mem set at 512MB, and the /boot/loader.conf file sets the max datasize to 1GB (verified by limit). The odd thing is that if I run the command (either vacuumdb from the command line or vacuum verbose analyze from a psql session) as the Unix user root (and any psql superuser) the vacuum runs fine. It is when the unix user is non-root (e.g. su -l pgsql -c "vacuumdb -a -z") that this memory error occurs. All users use the "default" class for login.conf purposes which has not been modified from its installed settings. Any ideas on how to a) troubleshoot this or b) fix this (if it is something obvious that I just cannot see). Thanks, Sven
Douglas McNaught
2005-Jun-29 13:50 UTC
[GENERAL] PostgreSQL's vacuumdb fails to allocate memory for non-root users
Sven Willenberger <sven@dmv.com> writes:> FreeBSD 5.4-Release > PostgreSQL 8.0.3 > > I noticed that the nightly cron consisting of a vacuumdb was failing due > to "unable to allocate memory". I do have maintenance_mem set at 512MB, > and the /boot/loader.conf file sets the max datasize to 1GB (verified by > limit). The odd thing is that if I run the command (either vacuumdb from > the command line or vacuum verbose analyze from a psql session) as the > Unix user root (and any psql superuser) the vacuum runs fine. It is when > the unix user is non-root (e.g. su -l pgsql -c "vacuumdb -a -z") that > this memory error occurs. All users use the "default" class for > login.conf purposes which has not been modified from its installed > settings. Any ideas on how to a) troubleshoot this or b) fix this (if it > is something obvious that I just cannot see).Is the out-of-memory condition occurring on the server or client side? Is there anything in the Postgres logs? You might put a 'ulimit -a' command in your cron script to make sure your memory limit settings are propagating correctly... -Doug
Vivek Khera
2005-Jun-29 18:59 UTC
PostgreSQL's vacuumdb fails to allocate memory for non-root users
On Jun 29, 2005, at 9:01 AM, Sven Willenberger wrote:> Unix user root (and any psql superuser) the vacuum runs fine. It is > when > the unix user is non-root (e.g. su -l pgsql -c "vacuumdb -a -z") that > this memory error occurs. All users use the "default" class for > login.conf purposes which has not been modified from its installed > settings. Any ideas on how to a) troubleshoot this or b) fix this > (if it > is something obvious that I just cannot see).This doesn't make sense: the actual command is executed by the backend postgres server, so the uid of the client program doens't make a bit of difference. You need to see exactly who is generating that error. It certainly is not the Pg backend.