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 1m2CVG-0007cX-RU for pgsql-hackers@arkaria.postgresql.org; Sat, 10 Jul 2021 12:54:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m2CVE-0007Ge-Mx for pgsql-hackers@arkaria.postgresql.org; Sat, 10 Jul 2021 12:54:40 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m2CVE-0007GW-Dz for pgsql-hackers@lists.postgresql.org; Sat, 10 Jul 2021 12:54:40 +0000 Received: from mx0b-0050f201.pphosted.com ([148.163.141.54]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m2CVC-00032v-1E for pgsql-hackers@postgresql.org; Sat, 10 Jul 2021 12:54:39 +0000 Received: from pps.filterd (m0203370.ppops.net [127.0.0.1]) by mx0b-0050f201.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 16ACJ23V008064 for ; Sat, 10 Jul 2021 21:54:36 +0900 Received: from sraihe.sra.co.jp (sraihe.sra.co.jp [221.255.117.38]) by mx0b-0050f201.pphosted.com with ESMTP id 39psb78kum-1 for ; Sat, 10 Jul 2021 21:54:36 +0900 Received: from srascb.sra.co.jp (srascb [133.137.8.65]) by sraihe.sra.co.jp (Postfix) with ESMTP id F16AA2A6863 for ; Sat, 10 Jul 2021 21:54:35 +0900 (JST) Received: from sranhm.sra.co.jp (osspc25 [133.137.174.97]) by srascb.sra.co.jp (Postfix) with ESMTP id D1C335802CC for ; Sat, 10 Jul 2021 21:54:35 +0900 (JST) Received: from localhost (sraihb-hub.sra.co.jp [133.137.8.6]) by sranhm.sra.co.jp (Postfix) with ESMTP id 87757A144D; Sat, 10 Jul 2021 21:54:35 +0900 (JST) Date: Sat, 10 Jul 2021 21:54:35 +0900 (JST) Message-Id: <20210710.215435.1626054813661714284.t-ishii@gmail.com> To: nagata@sraoss.co.jp Cc: coelho@cri.ensmp.fr, thomas.munro@gmail.com, m.polyakova@postgrespro.ru, alvherre@2ndquadrant.com, pgsql-hackers@postgresql.org, teodor@sigaev.ru Subject: Re: [HACKERS] WIP aPatch: Pgbench Serialization and deadlock errors From: Tatsuo Ishii In-Reply-To: <20210708083506.30fa700e2432d6da81c59393@sraoss.co.jp> References: <20210701000213.bd91004653d86255979bbdc0@sraoss.co.jp> <20210708083506.30fa700e2432d6da81c59393@sraoss.co.jp> X-Mailer: Mew version 6.7 on Emacs 25.2 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Proofpoint-ORIG-GUID: Dh_Fw43Wsc1dlM9NbW3lFXbnllo6lAXm X-Proofpoint-GUID: Dh_Fw43Wsc1dlM9NbW3lFXbnllo6lAXm X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10040 signatures=668682 X-Proofpoint-Spam-Details: rule=spam_low_notspam policy=spam_low score=3 spamscore=3 bulkscore=0 malwarescore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 mlxscore=3 impostorscore=0 clxscore=1034 adultscore=0 phishscore=0 mlxlogscore=156 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107100024 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I have played with v14 patch. I previously complained that pgbench always reported 9 errors (actually the number is always the number specified by "-c" -1 in my case). $ pgbench -p 11000 -c 10 -T 10 --max-tries=0 test pgbench (15devel, server 13.3) starting vacuum...end. transaction type: scaling factor: 1 query mode: simple number of clients: 10 number of threads: 1 duration: 10 s number of transactions actually processed: 974 number of failed transactions: 9 (0.916%) number of transactions retried: 651 (66.226%) total number of retries: 8482 latency average = 101.317 ms (including failures) initial connection time = 44.440 ms tps = 97.796487 (without initial connection time) To reduce the number of errors I provide "--max-tries=9000" because pgbench reported 8482 errors. $ pgbench -p 11000 -c 10 -T 10 --max-tries=9000 test pgbench (15devel, server 13.3) starting vacuum...end. transaction type: scaling factor: 1 query mode: simple number of clients: 10 number of threads: 1 duration: 10 s number of transactions actually processed: 1133 number of failed transactions: 9 (0.788%) number of transactions retried: 755 (66.112%) total number of retries: 9278 maximum number of tries: 9000 latency average = 88.570 ms (including failures) initial connection time = 23.384 ms tps = 112.015219 (without initial connection time) Unfortunately this didn't work. Still 9 errors because pgbench terminated the last round of run. Then I gave up to use -T, and switched to use -t. Number of transactions for -t option was calculated by the total number of transactions actually processed (1133) / number of clients (10) = 11.33. I rouned up 11.33 to 12, then multiply number of clients (10) and got 120. The result: $ pgbench -p 11000 -c 10 -t 120 --max-tries=9000 test pgbench (15devel, server 13.3) starting vacuum...end. transaction type: scaling factor: 1 query mode: simple number of clients: 10 number of threads: 1 number of transactions per client: 120 number of transactions actually processed: 1200/1200 number of transactions retried: 675 (56.250%) total number of retries: 8524 maximum number of tries: 9000 latency average = 93.777 ms initial connection time = 14.120 ms tps = 106.635908 (without initial connection time) Finally I was able to get a result without any errors. This is not a super simple way to obtain pgbench results without errors, but probably I can live with it. Best regards, -- Tatsuo Ishii SRA OSS, Inc. Japan English: http://www.sraoss.co.jp/index_en.php Japanese:http://www.sraoss.co.jp