From: Laurent Martelli <laurent.martelli@enercoop.org>
To: pgsql-performance@postgresql.org
Subject: Re: One long transaction or multiple short transactions?
Date: Fri, 09 Oct 2015 08:45:28 +0200
Message-ID: <56176288.9040500@enercoop.org> (raw)
In-Reply-To: <00fe01d10159$8e731980$ab594c80$@stonebanks.ca>
References: <002a01d0ffe4$2c630e60$85292b20$@stonebanks.ca>
<003d01d0ffe4$9ae8f890$d0bae9b0$@stonebanks.ca>
<A76B25F2823E954C9E45E32FA49D70ECCD54DF53@mail.corp.perceptron.com>
<00fe01d10159$8e731980$ab594c80$@stonebanks.ca>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>
Le 08/10/2015 01:40, Carlo a écrit :
>
> >> How many cores do you have on that machine?
>
> Test if limiting number of simultaneous feeds, like bringing their
> number down to half of your normal connections has the same positive
> effect.
>
> <<
>
> I am told 32 cores on a LINUX VM. The operators have tried limiting
> the number of threads. They feel that the number of connections is
> optimal. However, under the same conditions they noticed a sizable
> boost in performance if the same import was split into two successive
> imports which had shorter transactions.
>
> I am just looking to see if there is any reason to think that lock
> contention (or anything else) over longer vs. shorter single-row-write
> transactions under the same conditions might explain this.
>
I don't think inserts can cause contention on the server. Insert do not
lock tables during the transaction. You may have contention on sequence
but it won't vary with transaction size.
Have you checked the resource usage (CPU,memory) on the client side ?
How do you insert rows ? Do you use plain postgres API ?
Regards,
Laurent
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: laurent.martelli@enercoop.org
Subject: Re: One long transaction or multiple short transactions?
In-Reply-To: <56176288.9040500@enercoop.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox