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 1qihbJ-007YiM-24 for psycopg@arkaria.postgresql.org; Tue, 19 Sep 2023 20:45:41 +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 1qihaI-00C32i-Cd for psycopg@arkaria.postgresql.org; Tue, 19 Sep 2023 20:44:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qihaI-00C32O-4t for psycopg@lists.postgresql.org; Tue, 19 Sep 2023 20:44:38 +0000 Received: from mail-oo1-xc29.google.com ([2607:f8b0:4864:20::c29]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qihaE-006Ahf-77 for psycopg@postgresql.org; Tue, 19 Sep 2023 20:44:37 +0000 Received: by mail-oo1-xc29.google.com with SMTP id 006d021491bc7-57361de8878so3553046eaf.0 for ; Tue, 19 Sep 2023 13:44:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695156272; x=1695761072; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Vy3I6gL7pSHHvCSZwv/MjpQQjKsi5Yx17M9DHVLN+kc=; b=YRzPhpk1qr/rL1sd/kR6sAXbqqIyYZImfdQna+AlhCLEc03fmQoTNttLlftQF3TCpc BCbU5GdEwzqO1PMefvF8fqbjmtsYMlMnB480Kl7u9WVDQ1vgr1jLUfnnQzj9RKbQe5uv gzgptj6BatdlWLAEZfpqnzgQTXKLpy89Qz+EhjpnDzKy0w8ZuqQqxdptM7//Nh9N9USO kE0oEmadtK7exyJ91+16r5KrxVAZyJL4K6gROfb+Lr9W7nBVZg187kW15RynE62qXbyu ng1FPo3EefiJIl/dEa+0USKciVLVJ6u51bvmcGSvttdrIcUSSTR7CKpC0F/9QngMc8wc j3yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695156272; x=1695761072; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Vy3I6gL7pSHHvCSZwv/MjpQQjKsi5Yx17M9DHVLN+kc=; b=L7pmsVL/8GmcIY68zNISVR5TSUU4Oc/e9CNXfyq9xkpquEdBwqtD4mzKWFL1KMzP0/ Zm56EQiQd6L5VkPxGzs8k+bpClw0HiKUZDJLUwkzN2zc9rBN50obqmcfKsPDozltM/tQ L6iYeF2/RblT9X0dldGm17FAmaJ/wKT/3HnmBYi89DvODrqoBx5Fg8lxYq5fZf/KtdpV m4UH8qtokOmYVlcmLqjEGWo+BnKWMaCoC6/ltKWNfABJjtlHfySFilQaWdAAhcJJjU3W xFuNYwj3pGCMX1QONM/JF4qicV+ObhJ3/4Xkn9RCjNY4h4MbJyWawYgv/pmz2ESnrOku vEiQ== X-Gm-Message-State: AOJu0Yy6HwXLphJSqLDB5FmOts5NhxSXDnTrh1X6iU4fb9+rjLsB2xzJ qWO/VcKjQZxX8eMmiZKsZKFbqrOdCXJMMzgq1Wc= X-Google-Smtp-Source: AGHT+IHhGhnA/zy9CuYES4jFsrE3Im0kLuwKXWG+AuJ1ecJDAqST/3sbxZ8PHdSvzggvrqZxq2GXmmHlK7rxJ7KXR7o= X-Received: by 2002:a05:6870:c085:b0:1bb:cb02:7b97 with SMTP id c5-20020a056870c08500b001bbcb027b97mr636358oad.37.1695156272049; Tue, 19 Sep 2023 13:44:32 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Daniele Varrazzo Date: Tue, 19 Sep 2023 22:44:20 +0200 Message-ID: Subject: Re: CPU usage for queries, psycopg 2 vs 3 To: David Raymond Cc: "psycopg@postgresql.org" Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello David, On Thu, 7 Sept 2023 at 14:17, David Raymond wrote: > > > Could you please be so kind as to repeat your tests with psycopg 3.1.4? > Tried with 3.1.4 and it has idle processor usage while waiting for the 8 results, just like psycopg2. > Tried with 3.1.5 and it spikes up to 62% reported CPU usage while waiting for the 8 results, just like the current release. I am not able to quickly investigate this issue, because I don't have a Windows machine handy. However I would like to release 3.1.11 soon, so I would like to merge this changeset, which should revert the wait function to what was in 3.1.4 on Windows: https://github.com/psycopg/psycopg/commit/36f70532c4451d04c0052c6eac4d05380159e809 Are you able to test it to verify that CPU usage is regular with this changeset? Also please note that you sent your last, very informative, message, to me only: maybe you want to send it to the ML? If someone is able to look into this issue better, it would be some welcome help. FYI, I've reported it at https://github.com/psycopg/psycopg/issues/645 Cheers -- Daniele