Re: Should we cacheline align PGXACT?

From: Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>
To: Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>
Cc: Bernd Helmle <mailings(at)oopsware(dot)de>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Should we cacheline align PGXACT?
Date: 2017-02-15 14:52:34
Message-ID: CAPpHfdtEKN0+20=dFUEwgECF8x4rL7dLD8_u_mV9149p0+bqVA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Feb 15, 2017 at 11:49 AM, Alexander Korotkov <
a(dot)korotkov(at)postgrespro(dot)ru> wrote:

> On Mon, Feb 13, 2017 at 8:02 PM, Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>
> wrote:
>
>> I too have performed benchmarking of this patch on a large machine
>> (with 128 CPU(s), 520GB RAM, intel x86-64 architecture) and would like
>> to share my observations for the same (Please note that, as I had to
>> reverify readings on few client counts, it did take some time for me
>> to share these test-results.)
>>
>
> Great! Thank you very much for testing.
>
> Case3: Data fits in shared buffer, Read-write workload:
>> ------------------------------------------------------------
>> -----------------
>> In this case, I could see that the tps on head and patch are very
>> close to each other with a small variation of (+-)3-4% which i assume
>> is a run-to-run variation. PFA result sheet
>> 'results-readwrite-300-1000-SF' containing the test-results.
>>
>
> I wouldn't say it's just a variation. It looks like relatively small but
> noticeable regression in the patch.
> According to Andres comment [1] I made a version of patch
> (pgxact-align-3.patch) which align PGXACT to 16 bytes.
> That excludes situation when single PGXACT is spread over 2 cache lines.
> Results of read-only tests are attached. We can see that 16-byte
> alignment gives speedup in read-only tests, but it's a bit less than
> speedup of cache line alignment version.
> Read-write tests are now running. Hopefully 16-byte alignment version of
> patch wouldn't cause regression in read-write benchmark.
>
> 1. https://www.postgresql.org/message-id/20160822021747.u5bq
> x2xwwjzac5u5(at)alap3(dot)anarazel(dot)de
>

RW-benchmark on 72-cores machine is completed.

+-----------+--------+--------+--------+--------+--------+--
------+--------+--------+--------+
| | master | pgxact-align-2 |
pgxact-align-3 |
| clients | 1 | 2 | 3 | 1 | 2 | 3 | 1
| 2 | 3 |
|-----------+--------+--------+--------+--------+--------+--
------+--------+--------+--------|
| 1 | 4696 | 4773 | 4777 | 4449 | 4766 | 4731 | 4658
| 4670 | 4807 |
| 2 | 9127 | 9154 | 9300 | 9224 | 8801 | 9055 | 9278
| 9245 | 8902 |
| 4 | 17377 | 17779 | 17740 | 17936 | 17560 | 17900 | 17806
| 17782 | 17934 |
| 8 | 34348 | 34233 | 34656 | 34204 | 33617 | 34226 | 34446
| 34105 | 34554 |
| 16 | 64350 | 64530 | 64574 | 63474 | 62852 | 63622 | 63942
| 62268 | 63396 |
| 20 | 76648 | 76515 | 75026 | 75123 | 74624 | 76461 | 77756
| 77245 | 76263 |
| 40 | 98566 | 100429 | 103499 | 103118 | 100186 | 99550 | 101489
| 102363 | 102015 |
| 60 | 106871 | 107842 | 107724 | 107168 | 107645 | 104791 | 109388
| 109367 | 106146 |
| 80 | 109461 | 108467 | 108913 | 104780 | 109742 | 106929 | 111254
| 107688 | 109581 |
| 100 | 98772 | 98641 | 94742 | 100390 | 102977 | 99691 | 99296
| 95699 | 103675 |
| 120 | 92740 | 94659 | 93876 | 91856 | 90732 | 91560 | 92334
| 88746 | 94663 |
| 140 | 88400 | 89448 | 89600 | 87173 | 90152 | 88190 | 88174
| 92784 | 91788 |
| 150 | 87292 | 92834 | 89714 | 86626 | 93090 | 88887 | 89407
| 88234 | 92760 |
| 160 | 88704 | 86890 | 87668 | 91025 | 89734 | 86875 | 88398
| 87846 | 87659 |
| 180 | 85451 | 84611 | 81913 | 86939 | 85888 | 86000 | 87287
| 85644 | 82915 |
| 200 | 73796 | 81149 | 81674 | 76179 | 73104 | 79381 | 82456
| 79920 | 76239 |
| 220 | 68113 | 69765 | 67871 | 67611 | 74125 | 66436 | 64810
| 72282 | 71387 |
| 240 | 63528 | 61462 | 65662 | 61711 | 61697 | 63032 | 65435
| 61804 | 59918 |
+-----------+--------+--------+--------+--------+--------+--
------+--------+--------+--------+

Difference between master, pgxact-align-2 and pgxact-align-3 doesn't exceed
per run variation.
Thus, at this test we can't confirm neither regression in pgxact-align-2,
neither improvement in pgxact-align-3.
Ashutosh, could you please repeat your benchmarks with pgxact-align-3?

------
Alexander Korotkov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Attachment Content-Type Size
image/png 51.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2017-02-15 14:56:14 Re: UPDATE of partition key
Previous Message Alvaro Herrera 2017-02-15 14:37:34 Re: Documentation improvements for partitioning