unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Mark H Weaver <mhw@netris.org>
Cc: 26201@debbugs.gnu.org, guix-sysadmin@gnu.org
Subject: bug#26201: Heads-up: hydra.gnu.org uses ‘guix publish --cache’
Date: Wed, 19 Apr 2017 16:24:46 +0200	[thread overview]
Message-ID: <87vaq0o4pd.fsf_-_@gnu.org> (raw)
In-Reply-To: <87o9vts8xb.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Tue, 18 Apr 2017 23:27:44 +0200")

ludo@gnu.org (Ludovic Courtès) skribis:

> ludo@gnu.org (Ludovic Courtès) skribis:
>
>>   2. Produce a narinfo and corresponding nar the first time they are
>>      requested.  So, the first time we receive “GET foo.narinfo”, return
>>      404 and spawn a thread to compute foo.narinfo and foo.nar.  Return
>>      200 only when both are ready.
>>
>>      The precomputed nar{,info}s would be kept in a cache and we could
>>      make sure a narinfo and its nar have the same lifetime, which
>>      addresses one of the problems we have.
>>
>>      pros: better HTTP latency and bandwidth
>>      pros: allows us to add a Content-Length for nars
>>      pros: helps keep narinfo/nar lifetime in sync
>>      cons: doesn’t reduce load on hydra.gnu.org
>>      cons: exposes inconsistency between the store contents and the HTTP
>>            response (you may get 404 even if the thing is actually in
>>            store), but maybe that’s not a problem
>
> Implemented in commit 00753f7038234a0f5a79be3ec9ab949840a18743.
>
> I’ll set up a test instance shortly.

I ended up deploying it on hydra.gnu.org directly.  :-)

Progressively the cached nar/narinfo at {,mirror.}hydra.gnu.org will be
replaced with the new ones.  Now, the /guix/nar URLs have a
‘Content-Length’ header you should see a progress bar when downloading
one of these:

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix build vim
The following file will be downloaded:
   /gnu/store/ax5cm9gr1741pcq17w7bhgss5nvq5470-vim-8.0.0566
@ substituter-started /gnu/store/ax5cm9gr1741pcq17w7bhgss5nvq5470-vim-8.0.0566 /gnu/store/rnpz1svz4aw75kibb5qb02hhccy2m4y0-guix-0.12.0-7.aabe/libexec/guix/substitute
Downloading https://mirror.hydra.gnu.org/guix/nar/gzip/ax5cm9gr1741pcq17w7bhgss5nvq5470-vim-8.0.0566 (23.4MiB installed)...
 vim-8.0.0566  7.8MiB                                      385KiB/s 00:21 [####################] 100.0%

@ substituter-succeeded /gnu/store/ax5cm9gr1741pcq17w7bhgss5nvq5470-vim-8.0.0566
/gnu/store/ax5cm9gr1741pcq17w7bhgss5nvq5470-vim-8.0.0566
--8<---------------cut here---------------end--------------->8---

This new caching scheme should put an end to caching of truncated nars
in nginx, which has been too frequent lately.

It should also mostly avoid the problem where we have a narinfo for
something but not the corresponding nar, which leads to user frustration
(‘guix’ reports that the thing will be downloaded and eventually fails
with 410 “Gone” while trying to download it), because ‘guix publish’
caches narinfo/nar pairs together.  I say “mostly” because nginx caching
in front of ‘guix publish’ makes things more complicated.

The bandwidth issue reported at the beginning of this thread should be
mostly fixed: serving a narinfo or nar URL is now just sendfile(2),
which is the best we can do; 404s on narinfo should be immediate.

Of course, when the machine is overloaded, we’ll still experience
increased latency and lower bandwidth, but that should be less acute
than with the previous setting.

Please report any problems you may have!

Ludo’.

  reply	other threads:[~2017-04-19 14:26 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-21  1:44 bug#26201: No notification of cache misses when downloading substitutes dian_cecht
2017-03-21  2:46 ` Tobias Geerinckx-Rice
2017-03-21  2:52   ` dian_cecht
2017-03-21  3:57     ` Tobias Geerinckx-Rice
2017-03-21  4:48       ` dian_cecht
2017-03-21  6:21         ` Tobias Geerinckx-Rice
2017-03-21  6:49           ` dian_cecht
2017-03-21 14:55             ` Tobias Geerinckx-Rice
2017-03-21 15:32               ` dian_cecht
2017-03-21 16:07                 ` Tobias Geerinckx-Rice
2017-03-24  2:15                   ` Maxim Cournoyer
2017-03-21 12:59         ` Florian Pelz
2017-03-21 15:35           ` dian_cecht
2017-03-21 16:43       ` Ludovic Courtès
2017-03-21 17:08         ` Tobias Geerinckx-Rice
2017-03-22 22:06           ` Ludovic Courtès
2017-03-23 19:25             ` bug#26201: hydra.gnu.org uses ‘guix publish’ for nars and narinfos Tobias Geerinckx-Rice
2017-03-22 22:22           ` Ludovic Courtès
2017-03-23 10:29             ` Ricardo Wurmus
2017-03-23 18:36             ` Mark H Weaver
2017-03-23 18:52               ` Tobias Geerinckx-Rice
2017-03-24  8:12                 ` Mark H Weaver
2017-03-24  9:25                   ` Ludovic Courtès
2017-04-17 21:36                     ` Ludovic Courtès
2017-04-18 21:27                     ` Ludovic Courtès
2017-04-19 14:24                       ` Ludovic Courtès [this message]
2017-03-26 17:35                   ` Tobias Geerinckx-Rice
2017-03-27 18:47                     ` Tobias Geerinckx-Rice
2017-03-28 14:47                       ` Ludovic Courtès
2017-05-03  8:11                     ` Mark H Weaver
2017-05-03  9:25                       ` Ludovic Courtès
2017-03-27 11:20             ` bug#26201: Bandwidth when retrieving substitutes Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vaq0o4pd.fsf_-_@gnu.org \
    --to=ludo@gnu.org \
    --cc=26201@debbugs.gnu.org \
    --cc=guix-sysadmin@gnu.org \
    --cc=mhw@netris.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).