From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id UIh3FL4A4F5IKAAA0tVLHw (envelope-from ) for ; Tue, 09 Jun 2020 21:35:58 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id cBtGEL4A4F4kSAAAB5/wlQ (envelope-from ) for ; Tue, 09 Jun 2020 21:35:58 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B7D6C9401D0 for ; Tue, 9 Jun 2020 21:35:57 +0000 (UTC) Received: from localhost ([::1]:38072 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jiluV-00055k-Uk for larch@yhetil.org; Tue, 09 Jun 2020 17:35:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40376) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jiluO-00055Z-8T for bug-guix@gnu.org; Tue, 09 Jun 2020 17:35:48 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49532) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jiluN-0000h7-UA for bug-guix@gnu.org; Tue, 09 Jun 2020 17:35:47 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jilYL-0003zf-TF for bug-guix@gnu.org; Tue, 09 Jun 2020 17:13:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#41708: "guix weather" : 504 error Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 09 Jun 2020 21:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41708 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: zimon.toutoune@gmail.com, 41708@debbugs.gnu.org Received: via spool by 41708-submit@debbugs.gnu.org id=B41708.159173716015321 (code B ref 41708); Tue, 09 Jun 2020 21:13:01 +0000 Received: (at 41708) by debbugs.gnu.org; 9 Jun 2020 21:12:40 +0000 Received: from localhost ([127.0.0.1]:32841 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jilXz-0003z3-Ld for submit@debbugs.gnu.org; Tue, 09 Jun 2020 17:12:39 -0400 Received: from mira.cbaines.net ([212.71.252.8]:34202) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jilXx-0003yw-J3 for 41708@debbugs.gnu.org; Tue, 09 Jun 2020 17:12:38 -0400 Received: from localhost (unknown [46.237.175.96]) by mira.cbaines.net (Postfix) with ESMTPSA id B5A3727BBE1; Tue, 9 Jun 2020 22:12:36 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 90867fac; Tue, 9 Jun 2020 21:12:34 +0000 (UTC) References: User-agent: mu4e 1.2.0; emacs 26.3 From: Christopher Baines In-reply-to: Date: Tue, 09 Jun 2020 22:12:32 +0100 Message-ID: <87wo4g7xkv.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Spam-Score: -3.11 X-TUID: LiJwryJyiQix --=-=-= Content-Type: text/plain zimoun writes: > By default, "guix weather" returns: > > --8<---------------cut here---------------start------------->8--- > 'https://ci.guix.gnu.org/api/queue?nr=1000' returned 504 ("Gateway Time-out") > --8<---------------cut here---------------end--------------->8--- > > which is not fatal but annoying. Especially, it takes time. > > As discussed on IRC [1], it seems that it is a bug server side. > > In addition, something appears similar with Bayfront, well the 4 > substitutes servers that I know returns: > > --8<---------------cut here---------------start------------->8--- > 'https://ci.guix.gnu.org/api/queue?nr=1000' returned 504 ("Gateway Time-out") > 'https://bayfront.guix.gnu.org/api/queue?nr=1000' returned 504 > ("Gateway Time-out") > (continuous integration information unavailable) > 'https://guix.tobias.gr/api/queue?nr=1000' returned 410 ("Gone") > --8<---------------cut here---------------end--------------->8--- Hey, So I think I've got a patch [1] to Cuirass to "fix" this. 1: https://lists.gnu.org/archive/html/guix-devel/2020-06/msg00117.html I expected this was due to the complicated part of the db-get-builds query, but I think it's actually down to the simple part that fetches all the outputs for all the builds. Fetching the outputs for a build is slow, because at the moment, there's no index on the Outputs field, so looking up the outputs requires reading through the whole table, and the Outputs table can be quite large. The performance should improve with the additional query. To see why, you can use EXPLAIN QUERY PLAN to see what SQLite plans to do when processing the query: sqlite> EXPLAIN QUERY PLAN SELECT name, path FROM Outputs WHERE derivation = 'foo'; QUERY PLAN `--SCAN TABLE Outputs sqlite> CREATE INDEX Outputs_derivation_index ON Outputs (derivation); sqlite> EXPLAIN QUERY PLAN SELECT name, path FROM Outputs WHERE derivation = 'foo'; QUERY PLAN `--SEARCH TABLE Outputs USING INDEX Outputs_derivation_index (derivation=?) I believe that searching the table using an index is going to be faster than scanning the table, and testing locally and on bayfront suggests this will resolve the performance issue. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl7f+0BfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9Xd2dQ//YdwAPpTVYDwXD8pXQUOul6q4hYeg7KkPwcmwNZsDb0/XCbVoExBEMTFN t+HlE4QFJL6k26m/v4JpTu/WmI0vwK+NkKR2Uew5chAOYPkNRkrEiqkbdNuCxjET eJAYA9BPcbi2cs6yzc18eOPz1T0K4wv75dIb0nUZB6eaH9RAtPSpC5G3BF/2jb2t eKnYIqQw6m8LgI4/wrqceDDIGTsu405Zmk++XTUDtSC35Y2vnuKOS9N3NuGdIy0v Fcb+71cKuBvSK354mDKzXG8fLMoXyhgomjn65BTwNoi2RJxNMZpZNNhlSW/DDLdI KpMzxRzattgf66Sdhwd6PWpdUNUgTksjnRw5gUz3ID8NyUWk6btUMEZtJYhkttYu COKL2e/iXW+IdNHnKf0rRHJ4Zp2oaz4/CAyGGzdXa3dRX+vczahWB1eps9zjOI0w afNsZ2hLS/RgqcmoP9gILSXwPD6xi4KfjsutTjA2sm0P+gpQB1kJc7tf5DTwZI0r yYQnGm99eEbP0N8nQLleZ01r8UMTJY1D4p2fkRNDKacCsZ/xyani/Q6WihE5NEEd EBZMxR+lEMipZRpCcruKLEvFZl3Fwl8a2lv4hpRLJZvaVrkrNgkDTxGjpLBU28sj IxVzfujmzP5OxIHcjlJdYYh1aNtYoGsFncC5c7cbhVRKSwSS46c= =4XjJ -----END PGP SIGNATURE----- --=-=-=--