Re: Large amount of serialization errors in transactions - Mailing list pgsql-general

From Kevin Grittner
Subject Re: Large amount of serialization errors in transactions
Date
Msg-id 1368619999.93089.YahooMailNeo@web162903.mail.bf1.yahoo.com
Whole thread Raw
In response to Re: Large amount of serialization errors in transactions  (Vegard Bønes <vegard.bones@met.no>)
List pgsql-general
Vegard Bønes <vegard.bones@met.no> wrote:

> I tried increasing max_pred_locks_per_transaction by a factor 20,
> and that seems to have helped.

Good to know.  After I sent my response I was hoping you wouldn't
take it to imply that increating it by a factor of 10 was
necessarily the useful maximum.  It depends mostly on the maximum
number of different pages within a single table you want to track
at a finer-grained resolution than the relation level.  If you have
transactions which read a lot of pages from a single table, this
might need to go pretty high.

> is there any reason, beside memory concerns, not to have a very
> high value for max_pred_locks_per_transaction?

No, it is strictly a question of how much memory will be allocated
to the shared memory segment for the purpose of tracking these.

Well, I should say that we have some O(N^2) behavior in tracking
read-write conflicts that should probably be improved -- so if a
large number of predicate locks results in a large number of
read-write conflicts, performance could suffer.  Whether you run
into that depends a lot on your workload.  I have seen one report
of such an effect in one academic paper which compared various
techniques for implementing truly serializable transactions.  The
PostgreSQL implementation still scaled better than any of the
benchmarked alternatives, but they did hit a point where a large
percentage of the time was spent in that area.  Limiting the number
of active connections with a transaction-based connection pooler
(like pgbouncer configured in transaction mode) is currently your
best defence against hitting the wall on this issue.

--
Kevin Grittner
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-general by date:

Previous
From: Raghavendra
Date:
Subject: Re: pg_basebackup -R option in PG 9.3 beta
Next
From: sumita
Date:
Subject: Re: FATAL: database "a/system_data" does not exist