Hilton Chain <hako@ultrarare.space> writes:

> Hilton Chain <hako@ultrarare.space> writes:
>
>> Hilton Chain <hako@ultrarare.space> writes:
>> [...]
>>> So for best querying performance:
>>>
>>>     a suitable mirror > Cloudflare (cached) > Cloudflare (uncached)
>>>
>>> Although Cloudflare might be better for downloading speed.
>>>
>>> Then the goal will be: deploy more mirrors for better coverage and use
>>> Cloudflare as the default mirror for stable experience.
>>>
>>> To achieve the latter, performance of uncached requests should be improved, 
>>> then
>>> there're two approaches:
>>>
>>>     1. Sync narinfo files to Cloudflare as well, making it similiar to a 
>>> full
>>> mirror.  There're low-latency storage choices but adding more expenses.
>>
>> Since it's included in the plan, I tried to move narinfo files into 
>> Cloudflare's
>> key-value storage, making cache-cdn a full mirror.
>>
>> Performance on uncached lookups should be improved for all regions now, 
>> though
>> at best a cached lookup takes 0.02s per request, while a suitable mirrors may
>> take only 0.005s.
>
>
> Found the issue, thanks to iyzsong!  The reason of the low performance is that
> Cloudflare Workers doesn't support the Keep-Alive header.  So to improve the
> performance, there're two approaches:
>
> 1. Support HTTP/2 in Guix side.
> 2. Stop using Cloudflare Workers + KV, and use Cloudflare as a cache for the
> head node.
>
> The fastest approach we can have is (2.).  Since I have already set up a full
> mirror on Cloudflare, it can be replicated again in the future when we have
> HTTP/2 support.
>
>
>>>     2. The worker is deployed near the user, so narinfo files should be 
>>> accessed
>>> from a mirror in nearest region, sounds more reasonable given the former 
>>> goal,
>>> I'll have a try.
>>
>> For anyone who reads the thread and interested in them, please let me know if
>> the mirrors are slow, so I can know whether they are working well and which
>> regions needs mirrors more.
>>
>> Also there's an option (the second mirroring approach in my blog post) to
>> selfhost a narinfo mirror and reverse proxy substitutes requests to 
>> Cloudflare
>> R2.  This can be done locally as well, with the lowest latency.
>
>
> I'll update the setup and add a new performance comparison soon.


With Keep-Alive header support, now there's improved performance on cached
requests.

It's still slower than fast mirrors, but should be better than slow ones.  And
the best narinfo lookup performance is offered by a mirror in the local network.

I'll write a guide on setting up a local mirror and simplify the steps.  To
support such use case, there need to be a better way distributing narinfo files.
I'm thinking of opening rsync access on existing mirrors.  Also maybe I can try
to use some P2P approach? :)


cache-cdn (Cloudflare, uncached)
--8<---------------cut here---------------start------------->8---
https://cache-cdn.guix.moe ⛈
  6.3% substitutes available (2,046 out of 32,728)
  13,395.3 MiB of nars (compressed)
  28,202.9 MiB on disk (uncompressed)
  0.040 seconds per request (1,317.8 seconds in total)
  24.8 requests per second
  (continuous integration information unavailable)
--8<---------------cut here---------------end--------------->8---

cache-cdn (Cloudflare, cached)
--8<---------------cut here---------------start------------->8---
https://cache-cdn.guix.moe ⛈
  6.3% substitutes available (2,046 out of 32,728)
  13,395.3 MiB of nars (compressed)
  28,202.9 MiB on disk (uncompressed)
  0.009 seconds per request (285.6 seconds in total)
  114.6 requests per second
  (continuous integration information unavailable)
--8<---------------cut here---------------end--------------->8---

cache-de (Germany, currently the head node)
--8<---------------cut here---------------start------------->8---
https://cache-de.guix.moe ⛈
  6.3% substitutes available (2,046 out of 32,728)
  13,395.3 MiB of nars (compressed)
  28,202.9 MiB on disk (uncompressed)
  0.002 seconds per request (66.8 seconds in total)
  489.6 requests per second
  (continuous integration information unavailable)
--8<---------------cut here---------------end--------------->8---

cache-us-lax (United States)
--8<---------------cut here---------------start------------->8---
https://cache-us-lax.guix.moe ⛈
  6.3% substitutes available (2,046 out of 32,728)
  13,395.3 MiB of nars (compressed)
  28,202.9 MiB on disk (uncompressed)
  0.001 seconds per request (38.0 seconds in total)
  860.2 requests per second
  (continuous integration information unavailable)
--8<---------------cut here---------------end--------------->8---

narinfo mirror in LAN
--8<---------------cut here---------------start------------->8---
http://crustum:9018 ⛈
  6.3% substitutes available (2,046 out of 32,728)
  13,395.3 MiB of nars (compressed)
  28,202.9 MiB on disk (uncompressed)
  0.000 seconds per request (14.0 seconds in total)
  2,186.7 requests per second
  (continuous integration information unavailable)
--8<---------------cut here---------------end--------------->8---

Reply via email to