Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qxUTP-001CDi-GM for pgsql-general@arkaria.postgresql.org; Mon, 30 Oct 2023 15:46:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qxUTL-00FAuM-Vw for pgsql-general@arkaria.postgresql.org; Mon, 30 Oct 2023 15:46:35 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qxUTL-00FAuC-G6 for pgsql-general@lists.postgresql.org; Mon, 30 Oct 2023 15:46:35 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qxUTH-0034NG-7O for pgsql-general@lists.postgresql.org; Mon, 30 Oct 2023 15:46:33 +0000 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-32f7db21967so1529195f8f.1 for ; Mon, 30 Oct 2023 08:46:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20230601.gappssmtp.com; s=20230601; t=1698680787; x=1699285587; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=6PLp6NlSJRFoua4LDBHrQkp847F84jIG6L1X2CP8tUE=; b=yRsVjJ+AHVboVCu9Ib4u2LNMTxmMfLhzHnl2y9hAcuMpMrFVT8j0QFcqgkhKpVv1IF MdHZhLtda3/8KJZ2Fbra5ZoanSWYMyDQ2vP26IVEqogmnYagFHYiFUUCquh/bnJXcDy4 MfzwPD906/+zass4BVzGlVIl1TsHQ2smM6q/jDWDc+CJRqWqKF3Wlk3ha3iHdYF0+6pB L6jMY2cDJfGhYhJSUOfd7aix8fHpuqK3VXreYvrHZgc6+KdSFm5cGSHk2Q26322nBr/T U62bfszRjoehKJTXb/01xBeiStt3K58JJ4BJT0cY1PfGI19F7sJB+nF83iWKYXB31nc5 kwqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698680787; x=1699285587; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=6PLp6NlSJRFoua4LDBHrQkp847F84jIG6L1X2CP8tUE=; b=fKNx8s78JGP7FUATTaGm0L2cbkdINo+g+fNODIgszsCUUhn+MxggwvTQ+lPSpLPhIY LbRMHIZT/f/sajOMcJdkDjmXBjTkewNsiNkrQmj+B7eCjMG2R9jmQ5chpuXIwdbUYV1Z MHUtXp+Rk3KJ7TswIRqmguH43e6R+TH2IPuyuxSbeAs6KArbu9WDtj5VhdVuZ7/gBui2 0XpW6vBcNmFA6W8W7ndeFo548f91WjCmhbmseYG98opZKPO+ZjezgbjDUg/3EumNvva7 fcsZIn3RfeeiSylZDozl+PufX2fKTdHAaGURSwTVofJvg2pnAvsZTYRw3UqWjZ3EGH9X F+QQ== X-Gm-Message-State: AOJu0YzBwvYvT1e6rycwA2l9A7kR9a2auBjWl1UdII7D3upN+YZBoYgs 6KzsNQRy/CtsKOyQ27ojMStQNA== X-Google-Smtp-Source: AGHT+IErZ2V7hPh40oPErAA5X3+hHQ78smh5r/x55MP/cqtYmJTk4OSoEm1yH7dAivKNWIIqkVI9Uw== X-Received: by 2002:adf:e68c:0:b0:329:6e92:8d77 with SMTP id r12-20020adfe68c000000b003296e928d77mr7608277wrm.51.1698680787070; Mon, 30 Oct 2023 08:46:27 -0700 (PDT) Received: from localhost.localdomain ([2001:871:260:eb44:666e:9432:b55d:2553]) by smtp.gmail.com with ESMTPSA id q26-20020adfb19a000000b0031f82743e25sm8448912wra.67.2023.10.30.08.46.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 08:46:26 -0700 (PDT) Message-ID: Subject: Re: Help with a good mental model for estimating PostgreSQL throughput From: Laurenz Albe To: David Ventimiglia , pgsql-general@lists.postgresql.org Date: Mon, 30 Oct 2023 16:46:26 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 2023-10-30 at 08:05 -0700, David Ventimiglia wrote: > Can someone help me develop a good mental model for estimating PostgreSQL= throughput? > Here's what I mean.=C2=A0 Suppose I have: > =C2=A0* 1000 connections > =C2=A0* typical query execution time of 1ms > =C2=A0* but additional network latency of 100ms > What if at all would be an estimate of the number of operations that can = be performed > within 1 second?=C2=A0 My initial guess would be ~10000, but then perhaps= I'm overlooking > something.=C2=A0 I expect a more reliable figure would be obtained throug= h testing, but > I'm looking for an a priori back-of-the-envelope estimate.=C2=A0 Thanks! It depends on the number of cores, if the workload is CPU bound. If the workload is disk bound, look for the number of I/O requests a typica= l query needs, and how many of them you can perform per second. The network latency might well be a killer. Use pgBouncer with transaction mode pooling. Yours, Laurenz Albe