Thread: too many LWLocks taken

too many LWLocks taken

From
Alex Vinogradovs
Date:
Guys,


I've got a pretty large database, and since certain time
it started giving me "too many LWLocks taken" when running
some batch inserts... Any parameter can be ajusted ?


Thanks!

Best regards,
Alex Vinogradovs

Re: too many LWLocks taken

From
Tom Lane
Date:
Alex Vinogradovs <AVinogradovs@Clearpathnet.com> writes:
> I've got a pretty large database, and since certain time
> it started giving me "too many LWLocks taken" when running
> some batch inserts... Any parameter can be ajusted ?

Oh really?  That's a bug, not something you need to adjust a parameter
for.  Can you put together a self-contained test case?  What PG
version is this?

            regards, tom lane

Re: too many LWLocks taken

From
Alex Vinogradovs
Date:
Version is 8.2.5 running on FreeBSD 6.2. I can try upgrading
to 8.2.7, if you think that would help.

I don't think I can make a test case. Database had been
up for a year now, with about 2 thousand inherited tables
(partitioning) and about 2B rows in all tables...


On Fri, 2008-04-04 at 18:58 -0400, Tom Lane wrote:
> Alex Vinogradovs <AVinogradovs@Clearpathnet.com> writes:
> > I've got a pretty large database, and since certain time
> > it started giving me "too many LWLocks taken" when running
> > some batch inserts... Any parameter can be ajusted ?
>
> Oh really?  That's a bug, not something you need to adjust a parameter
> for.  Can you put together a self-contained test case?  What PG
> version is this?
>
>             regards, tom lane

Re: too many LWLocks taken

From
Tom Lane
Date:
Alex Vinogradovs <AVinogradovs@Clearpathnet.com> writes:
> Version is 8.2.5 running on FreeBSD 6.2. I can try upgrading
> to 8.2.7, if you think that would help.

Well, an upgrade would be a good idea on general principles, but
I doubt it will fix a previously unknown bug.

Does the postmaster log show any other odd behavior around these
errors?  Which process is throwing the error anyway?  If it's
a regular backend, what query is it executing?

            regards, tom lane

Re: too many LWLocks taken

From
Alex Vinogradovs
Date:
It appears the errors were caused by table corruption. I've
truncated and reloaded some large table (300m entries),
and the problem disappeared. Table corruption was probably
caused by hardware failure, not by PostgreSQL :)


On Fri, 2008-04-04 at 20:15 -0400, Tom Lane wrote:
> Alex Vinogradovs <AVinogradovs@Clearpathnet.com> writes:
> > Version is 8.2.5 running on FreeBSD 6.2. I can try upgrading
> > to 8.2.7, if you think that would help.
>
> Well, an upgrade would be a good idea on general principles, but
> I doubt it will fix a previously unknown bug.
>
> Does the postmaster log show any other odd behavior around these
> errors?  Which process is throwing the error anyway?  If it's
> a regular backend, what query is it executing?
>
>             regards, tom lane