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 1q7I3V-0004EB-Lm for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Jun 2023 16:00:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q7I3U-0000HD-J2 for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Jun 2023 16:00:08 +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 1q7I3T-00008B-NO for pgsql-hackers@lists.postgresql.org; Thu, 08 Jun 2023 16:00:08 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q7I3R-0013Hy-8x; Thu, 08 Jun 2023 16:00:07 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 911625C01F3; Thu, 8 Jun 2023 12:00:04 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 08 Jun 2023 12:00:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1686240004; x=1686326404; bh=Yx8farycgSmHcqsrz+VWSDcdjppZJm5Ox29 oLu6vj48=; b=limOzg10VScBDcxQsB4JOYeEz6O4Fc9Rc1b8ABqGWdwhmiHCrfK 9T4OECYo3rRrN3SbmoeP45BndQAEaoa4AxeBq/mOGYI1yqW41OSD+dMAmP6o00zy Qv8/O19NWY/tg96Q4BM0U5Xn6DdR+kLGCjsa1WD2ZUVDzc+bhzefzVrBl+JZeT+t 3Ai000eNzzDeBAh7YlGELkJX+UQfH3Z9zkGZHrS+1oKEvMKyb8RoaeiAwexbORzm B/JCZlavSFl8TSvtGEFrGbGMhwOYJ9d6yhDjS/CRTniSlb3o/U11GJgUGzRDEKw0 OJ9fdYrX3pDKfK/QIfhGI5kvhDeO2aOxb5g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1686240004; x=1686326404; bh=Yx8farycgSmHcqsrz+VWSDcdjppZJm5Ox29 oLu6vj48=; b=gY7bt+dC48CE6LxWTOjKrOBUvsx8dHDr0Kkc0kDF0yMhrX68OJa uljW0C4Md0In424cDF+/trJZVOq0G9VsJvO+AQ87EXgDZfWdJ7NqxBiZvd8XQiDC vypl5jrS+vFeQculortDEPmY+/1zl2KHV3lqWgRP0aQAJjrEgfMZk7JK939gFWI0 YQB1JSPoro3gFaLMOFXyeRzfoEqyNWkFei+Ae1dHs3EYaUe5CU0a+L66DhuLqJpA e5fPj5IvYVbLczV68McwRLvfRVDCagvxEJA8rYDQTAgdSEn5t+cihbGurv/VU8LG 2lEFb4Wb5te2fYXwNDp4ah67DkeqyT4FXPw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgedtiedgleehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetnhgu rhgvshcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtf frrghtthgvrhhnpefhieetgfelveettdffjeevudejkeejudfgtdevffejledvtdefkeeg gfejhffggeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpegrnhgurhgvshesrghnrghrrgiivghlrdguvg X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 8 Jun 2023 12:00:03 -0400 (EDT) Date: Thu, 8 Jun 2023 09:00:02 -0700 From: Andres Freund To: Hannu Krosing Cc: "Jonathan S. Katz" , Heikki Linnakangas , Tom Lane , pgsql-hackers Subject: Re: Let's make PostgreSQL multi-threaded Message-ID: <20230608160002.qeollvbvfcrbq7sh@awork3.anarazel.de> References: <31cc6df9-53fe-3cd9-af5b-ac0d801163f4@iki.fi> <4178104.1685978307@sss.pgh.pa.us> <4ce6c0f8-e8a4-1672-93fd-49d3fa975ee5@iki.fi> <20230607213721.al3etgcgtija3ytz@awork3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2023-06-08 12:15:58 +0200, Hannu Krosing wrote: > On Thu, Jun 8, 2023 at 11:54 AM Hannu Krosing wrote: > > > > On Wed, Jun 7, 2023 at 11:37 PM Andres Freund wrote: > > > > > > Hi, > > > > > > On 2023-06-05 13:40:13 -0400, Jonathan S. Katz wrote: > > > > 2. While I wouldn't want to necessarily discourage a moonshot effort, I > > > > would ask if developer time could be better spent on tackling some of the > > > > other problems around vertical scalability? Per some PGCon discussions, > > > > there's still room for improvement in how PostgreSQL can best utilize > > > > resources available very large "commodity" machines (a 448-core / 24TB RAM > > > > instance comes to mind). > > > > > > I think we're starting to hit quite a few limits related to the process model, > > > particularly on bigger machines. The overhead of cross-process context > > > switches is inherently higher than switching between threads in the same > > > process - and my suspicion is that that overhead will continue to > > > increase. Once you have a significant number of connections we end up spending > > > a *lot* of time in TLB misses, and that's inherent to the process model, > > > because you can't share the TLB across processes. > > > > > > This part was touched in the "AMA with a Linux Kernale Hacker" > > Unconference session where he mentioned that the had proposed a > > 'mshare' syscall for this. As-is that'd just lead to sharing page table, not the TLB. I don't think you currently do sharing of the TLB for parts of your address space on x86 hardware. It's possible that something like that gets added to future hardware, but ... > Also, the *static* huge pages already let you solve this problem now > by sharing the page tables You don't share the page tables with huge pages on linux. - Andres