Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kcHHy-00079c-RZ for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Nov 2020 00:13:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kcHHv-0003US-Sk for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Nov 2020 00:13:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kcHHv-0003UL-HH for pgsql-hackers@lists.postgresql.org; Tue, 10 Nov 2020 00:13:31 +0000 Received: from mail-ej1-x643.google.com ([2a00:1450:4864:20::643]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kcHHs-0007Ng-4W for pgsql-hackers@postgresql.org; Tue, 10 Nov 2020 00:13:31 +0000 Received: by mail-ej1-x643.google.com with SMTP id o23so14922456ejn.11 for ; Mon, 09 Nov 2020 16:13:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=F+NOIIHtlJZ98CvKYX8m96lgJBTD/cN4hPWrOCa++jM=; b=gVwno9b5TuMNO5jcpMrtUeSthz4jzhi+Wg1jowSuRvvdjZg7OazPszoXsuc1Y684Hc FZklDl9jghJ0Tk00Rx/09utqOvJp+VISRGDQl598fEhY+SOdEh+oUdfyA+cILUx8Bj9z kBTW56vANF/haenp+bJRHo5t7oicSM61I5lgPvIXnuOB5mnYDCCOiHsr6q6zUlHAxTsG SzxrknDBJIZSq4qZf2DykWDMZE7YC0ASluOHuDf5k1GiOSo9Ud8bE4+RJO6CaMswRy3A 2Q8m8ER8YlnkQ155sAr6RrduWabixP/RrmJ0k0RNK4v6kUuqm4hhINDert9MmhJpij4Y H1iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=F+NOIIHtlJZ98CvKYX8m96lgJBTD/cN4hPWrOCa++jM=; b=W7wamLgqzTbztIzPoH4Cw6XFzy0m6gFfN1sR8evKpb4xA3bO2NuItc/H4Z7b0jOR3v d4YcGqF6y4chNHJn3Mp9Mu8rfcYOgs6g7hynrMYVTLBBBk718biW929ub5jCwgRJigXf o0Ry3IN+yMrWRqS9FPvswVK/xo10FkiglBIrK7qdy437JgS+XDbNgGo4YtU3g5/Wgtes 4/Q0X8sahKZQu4J7Gjp9hgI7oX0eJZOpHOKQQRQSBl+xSbZW5umvROVAjvAVPAcvRr+9 8wuZHFGr+bcyRbtxLn8w7Wfh2muJUBKcW8sS+1PcphCc/RjuFuvtpIUMBzTmC2gzfajI Nxyg== X-Gm-Message-State: AOAM531NtlAujl/3XLDq5of/qJ4iMPptrBOFZ3AkiUwRL88M9Pp34daH We8VFItiwYgGXgO39z39KXLzHN/6pSgimoADxwSwn4Gf6OpUqU4UUQjO438tEZ6zDO2s9TGYjJG huV046/c2znqHstPoj/2ctRVwnUjIL7UdNklqEiYQf4wsR6VZ70LZGQ8P5GvdijcF7GUhHNhbNH WFGiylWEdLXG4VbtE0FgvTiU7DF7MJNlkwDey8n/x7eK76EWhJcjH1hqZzNvqkpTHqiVzTuNCR4 OVILFRem8gdmeF+5uHuN7kNgOEnJydrObB++Wp3 X-Google-Smtp-Source: ABdhPJxJz2CpqD+l+UsZdRO6ucdgUqLknUcsg2VEUwks4f7RLViqBiZV0kxNDSOVVRJZJTw2wAFE8Q== X-Received: by 2002:a17:906:d784:: with SMTP id pj4mr4385111ejb.78.1604967205325; Mon, 09 Nov 2020 16:13:25 -0800 (PST) Received: from [10.137.0.4] (ip-86-49-245-76.net.upcbroadband.cz. [86.49.245.76]) by smtp.gmail.com with ESMTPSA id l20sm9524356eja.40.2020.11.09.16.13.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Nov 2020 16:13:24 -0800 (PST) Subject: Re: MultiXact\SLRU buffers configuration To: Andrey Borodin , Tomas Vondra Cc: Alexander Korotkov , Anastasia Lubennikova , Daniel Gustafsson , Kyotaro Horiguchi , pgsql-hackers References: <2087E87D-44CA-4443-8E6A-5087F07443F4@yandex-team.ru> <8A94938B-054C-4439-9866-2C220B4D0DD7@yandex-team.ru> <20201028013651.de5cj2xadgmba5nf@development> <13D8FD63-559A-4737-B7FD-05288D1CEF8B@yandex-team.ru> <20201028233243.ygm6yqlynkqpzekr@development> <43F3DE92-F236-4EA5-B4D6-39BEF6BD849D@yandex-team.ru> <20201029134933.xd4mh2cofuf6tdfz@development> <65C1B4BA-D16F-4939-978B-AC8F370F5A5E@yandex-team.ru> From: Tomas Vondra Message-ID: <9b4d17df-b811-8323-16be-3cab913216d1@enterprisedb.com> Date: Tue, 10 Nov 2020 01:13:22 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <65C1B4BA-D16F-4939-978B-AC8F370F5A5E@yandex-team.ru> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, After the issue reported in [1] got fixed, I've restarted the multi-xact stress test, hoping to reproduce the issue. But so far no luck :-( I've started slightly different tests on two machines - on one machine I've done this: a) init.sql create table t (a int); insert into t select i from generate_series(1,100000000) s(i); alter table t add primary key (a); b) select.sql SELECT * FROM t WHERE a = (1+mod(abs(hashint4(extract(epoch from now())::int)), 100000000)) FOR KEY SHARE; c) pgbench -n -c 32 -j 8 -f select.sql -T $((24*3600)) test The idea is to have large table and many clients hitting a small random subset of the rows. A sample of wait events from ~24h run looks like this: e_type | e_name | sum ----------+----------------------+---------- LWLock | BufferContent | 13913863 | | 7194679 LWLock | WALWrite | 1710507 Activity | LogicalLauncherMain | 726599 Activity | AutoVacuumMain | 726127 Activity | WalWriterMain | 725183 Activity | CheckpointerMain | 604694 Client | ClientRead | 599900 IO | WALSync | 502904 Activity | BgWriterMain | 378110 Activity | BgWriterHibernate | 348464 IO | WALWrite | 129412 LWLock | ProcArray | 6633 LWLock | WALInsert | 5714 IO | SLRUWrite | 2580 IPC | ProcArrayGroupUpdate | 2216 LWLock | XactSLRU | 2196 Timeout | VacuumDelay | 1078 IPC | XactGroupUpdate | 737 LWLock | LockManager | 503 LWLock | WALBufMapping | 295 LWLock | MultiXactMemberSLRU | 267 IO | DataFileWrite | 68 LWLock | BufferIO | 59 IO | DataFileRead | 27 IO | DataFileFlush | 14 LWLock | MultiXactGen | 7 LWLock | BufferMapping | 1 So, nothing particularly interesting - there certainly are not many wait events related to SLRU. On the other machine I did this: a) init.sql create table t (a int primary key); insert into t select i from generate_series(1,1000) s(i); b) select.sql select * from t for key share; c) pgbench -n -c 32 -j 8 -f select.sql -T $((24*3600)) test and the wait events (24h run too) look like this: e_type | e_name | sum -----------+-----------------------+---------- LWLock | BufferContent | 20804925 | | 2575369 Activity | LogicalLauncherMain | 745780 Activity | AutoVacuumMain | 745292 Activity | WalWriterMain | 740507 Activity | CheckpointerMain | 737691 Activity | BgWriterHibernate | 731123 LWLock | WALWrite | 570107 IO | WALSync | 452603 Client | ClientRead | 151438 BufferPin | BufferPin | 23466 LWLock | WALInsert | 21631 IO | WALWrite | 19050 LWLock | ProcArray | 15082 Activity | BgWriterMain | 14655 IPC | ProcArrayGroupUpdate | 7772 LWLock | WALBufMapping | 3555 IO | SLRUWrite | 1951 LWLock | MultiXactGen | 1661 LWLock | MultiXactMemberSLRU | 359 LWLock | MultiXactOffsetSLRU | 242 LWLock | XactSLRU | 141 IPC | XactGroupUpdate | 104 LWLock | LockManager | 28 IO | DataFileRead | 4 IO | ControlFileSyncUpdate | 1 Timeout | VacuumDelay | 1 IO | WALInitWrite | 1 Also nothing particularly interesting - few SLRU wait events. So unfortunately this does not really reproduce the SLRU locking issues you're observing - clearly, there has to be something else triggering it. Perhaps this workload is too simplistic, or maybe we need to run different queries. Or maybe the hw needs to be somewhat different (more CPUs? different storage?) [1] https://www.postgresql.org/message-id/20201104013205.icogbi773przyny5@development regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company