Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1j6Jv2-0002yl-7p for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Feb 2020 20:01:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j6Jv0-0002tW-8c for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Feb 2020 20:01:30 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j6Juy-0002tH-3w for pgsql-hackers@lists.postgresql.org; Mon, 24 Feb 2020 20:01:30 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j6Juu-0003Ou-I8 for pgsql-hackers@lists.postgresql.org; Mon, 24 Feb 2020 20:01:26 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 3E304209; Mon, 24 Feb 2020 15:01:22 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Mon, 24 Feb 2020 15:01:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=jcgJ5UOxn2cqA1/fDaWlLEW/7Qu EyfsdRteBFwVRKDI=; b=R61cWnllO8drDs67cGFHTPAqE0sgKsaaKFZlaSPo2/X 9M0QTrZGCkxDMn79LxFpc3Ej6IY7HxqCzc47cxuP/qZZb+uzsCp0yIi7IzjIwJQ4 w7kmUKjFGOkV5ZSAbR/ushw6SemfyVo9HOnJ1Xueo0+8ijedww8NvOCKM9Wo9cGf dpxlTTtjIXkJLgzfLOCS0XRMgPl2FMCc35tokLSuWK0rxPca8WO1ieFujrIZwkf3 gxsMMv6n9J3XE3KI26sBruLCIisXosa+HDSPFZf1LWhOQ/i117kpCg2iIRl+8H72 BjX9hZ6VPqf2sy72z7kmbefUhdpVmun0M48oONxVAtQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=jcgJ5U Oxn2cqA1/fDaWlLEW/7QuEyfsdRteBFwVRKDI=; b=iPHlqq0Bnv3jCdGqPkPVdJ yA1lFBpT21sHaQqeUug8MdQPMDeaJOpsBSnswhIR+aqYjAPR2MOkjMmqLXRz1UMM 48Qhnxia6lh0EXI23VTgHOc0crbaHW/e0EVIq5+tEhuo2tsKmbGep7U9MfZM8JGW Y5T4v5r9ZJI6j7BPD3Q6MjhCFM/IKKycLtmw6TnAg+/LAtZRhiLsGDSKadV7aYFO kB0lWjex4okAMrkrhwaGCA3tX+4ieQx9IrVMbWUnxV3M2CAPvcPi/t2w+eGHi8dv 08Y5ouQm4MH9rbI0E+46ObWtyAQKP34+hNm2ENH/JadiAwn0EEdUL5kSFeg3yH+g == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrledtgddufeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeetnhgurhgv shcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucffohhmrg hinhepmhhitghrohhsohhfthdrtghomhenucfkphepieejrdduiedtrddvudejrddvhedt necuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghnug hrvghssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Received: from intern.anarazel.de (c-67-160-217-250.hsd1.ca.comcast.net [67.160.217.250]) by mail.messagingengine.com (Postfix) with ESMTPA id C602A328005E; Mon, 24 Feb 2020 15:01:20 -0500 (EST) Date: Mon, 24 Feb 2020 12:01:19 -0800 From: Andres Freund To: Alvaro Herrera Cc: Tom Lane , Thomas Munro , =?utf-8?B?UsOpbWk=?= Zara , Michael Paquier , PostgreSQL Hackers Subject: Re: pgsql: Add kqueue(2) support to the WaitEventSet API. Message-ID: <20200224200119.x27tfdybwpzde3cy@alap3.anarazel.de> References: <16353.1582555469@sss.pgh.pa.us> <20200224191453.GA711@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200224191453.GA711@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 2020-02-24 16:14:53 -0300, Alvaro Herrera wrote: > But the C runtime does: > https://docs.microsoft.com/en-us/cpp/c-runtime-library/file-handling?view=vs-2019 > I suppose we do use the C runtime. There's a reference to > _setmaxstdio() being able to raise the limit from the default of 512 to > up to 8192 open files. We don't currently invoke that. > https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/setmaxstdio?view=vs-2019 If we ever go for that, we should also consider raising the limit on unix systems up to the hard limit when hitting the fd ceiling. I.e. get the current limit with getrlimit(RLIMIT_NOFILE) and raise rlim_cur [closer] to rlim_max with setrlimit. Perhaps it'd even be worthwhile to just always raise the limit, if possible, in set_max_safe_fds(), by max_safe_fds + NUM_RESERVED_FDS. That way PLs, other shared libs, would have a more usualy amount of FDs available. Rather than a fairly small number, but only when the backend has been running for a while in the right workload. Greetings, Andres Freund