Re: "Out of memory" errors.. - Mailing list pgsql-general

From Lim Berger
Subject Re: "Out of memory" errors..
Date
Msg-id 69d2538f0708131947l45f7f110i32e247d214701749@mail.gmail.com
Whole thread Raw
In response to Re: "Out of memory" errors..  ("Sander Steffann" <s.steffann@computel.nl>)
Responses Re: "Out of memory" errors..
List pgsql-general
On 8/14/07, Sander Steffann <s.steffann@computel.nl> wrote:
> Hi Lim,
>
> >> It might also be in /etc/security/limits.conf.
> >
> > Thanks. I see these two lines in that file:
> >
> > postgres        soft    nofile  8192
> > postgres        hard    nofile  8192
> >
> > How should I change these values? I am not sure how this reflects the
> > "ulimit" options.
>
> Those are limits to the allowed number of open files (ulimit -n). I think
> 8192 should be enough for PostgreSQL. The problem you had were related to
> other settings, so if only the "nofile" setting is changed your strange
> ulimits do not come from here :-)


I think I have located the problem. It is in "/etc/profile" where some
ulimits are added. This is the offending text, I think:


#********************* cPanel Added Limit Protections -- BEGIN

#unlimit so we can run the whoami
ulimit -n 4096 -u 14335 -m unlimited -d unlimited -s 8192 -c 1000000
-v unlimited 2>/dev/null

LIMITUSER=$USER
if [ -e "/usr/bin/whoami" ]; then
        LIMITUSER=`/usr/bin/whoami`
fi
if [ "$LIMITUSER" != "root" ]; then
        ulimit -n 100 -u 20 -m 200000 -d 200000 -s 8192 -c 200000 -v
200000 2>/dev/null
else
        ulimit -n 4096 -u 14335 -m unlimited -d unlimited -s 8192 -c
1000000 -v unlimited 2>/dev/null
fi
#********************* cPanel Added Limit Protections -- END



I am not much of a shell scripter so I am afraid of breaking this, but
how can I change the line "if [ "$LIMITUSER" != "root" ];" to include
the postgres user as well? Can I do something like:

   if [ "$LIMITUSER" != "root" and "$LIMITUSER" != "postgres" ];

Would appreciate any thoughts!

pgsql-general by date:

Previous
From: "Lim Berger"
Date:
Subject: Postgresql INSERT speed (how to improve performance)?
Next
From: Ow Mun Heng
Date:
Subject: Copy command and duplicate items (Support Replace?)