<div dir="ltr">I'll just leave the one I did when I was at CF here then :) <a href="https://cloudflaremirrors.com/archlinux">https://cloudflaremirrors.com/archlinux</a></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 27, 2020 at 8:46 PM Kristian Klausen via arch-mirrors <<a href="mailto:arch-mirrors@archlinux.org">arch-mirrors@archlinux.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 26.01.2020 17.19, Kristian Klausen via arch-mirrors wrote:<br>
> Hi<br>
><br>
> I'm considering setting up a Arch Linux mirror and I'm considering a <br>
> different design.<br>
><br>
<br>
Hi<br>
<br>
I just got time to implement this and the setup looks like this:<br>
Cloudflare -> Cloudflare Workers -> Backblaze B2 bucket <- Tier1 mirror<br>
<br>
The files is synced from <a href="http://mirror.ams1.nl.leaseweb.net" rel="noreferrer" target="_blank">mirror.ams1.nl.leaseweb.net</a> every hour to the <br>
Backblaze B2 bucket and they are fetched from the bucket with the help <br>
of a Cloudflare Workers script.<br>
Cloudflare is configured to cache everything (size <=2GB*), database <br>
files is cached for 5 minute everything else is cached for 24 hours.<br>
* CF is sponsoring a plan with a higher limit than the 512MB default<br>
<br>
I have done some quick testing, and time to first byte isn't impressive <br>
(at least not when downloading from Europe), but the speed is acceptable <br>
(80-100MB/s is achievable if the file is cached, and 8-12MB/s if not <br>
(tested from Europe)).<br>
<br>
To make it easier to implement, I took some shortcuts:<br>
* Directory listing isn't implemented<br>
* "latest" files isn't synced<br>
* Only packages in "pool/" is synced, the package files in the different <br>
repo isn't synced, but if you request a package <br>
(\.pkg\.tar\.(xz|zst)(|.sig)$) it is automatic retrieved from the pool/ <br>
directory. This means that you can download ex Firefox from both:<br>
<a href="https://archlinux.amirror.xyz/extra/os/x86_64/firefox-73.0.1-1-x86_64.pkg.tar.zst" rel="noreferrer" target="_blank">https://archlinux.amirror.xyz/extra/os/x86_64/firefox-73.0.1-1-x86_64.pkg.tar.zst</a><br>
<a href="https://archlinux.amirror.xyz/community/os/x86_64/firefox-73.0.1-1-x86_64.pkg.tar.zst" rel="noreferrer" target="_blank">https://archlinux.amirror.xyz/community/os/x86_64/firefox-73.0.1-1-x86_64.pkg.tar.zst</a><br>
<br>
I'm not sure if the shortcuts is acceptable, but it can be fixed if it <br>
is a issue.<br>
<br>
Also please note that: archive, other and sources isn't synced.<br>
<br>
Feel free to try it out: <a href="https://archlinux.amirror.xyz/" rel="noreferrer" target="_blank">https://archlinux.amirror.xyz/</a><br>
<br>
Best regards<br>
Kristian Klausen<br>
<br>
> So instead of mirroring the whole thing, the idea is to mirror only <br>
> the database files (core.db etc) and download the packages on demand <br>
> from a Tier 1 mirror (and let nginx cache them). By doing it that way, <br>
> I only download requested packages from the Tier 1 mirrors, instead of <br>
> downloading the whole thing (saving Tier 1 bandwidth).<br>
><br>
> To provide even better performance a CDN (ex: Cloudflare) could be <br>
> used to provide more caching. So we end up with a setup like this:<br>
> Cloudflare -> Nginx cache -> Tier1 mirrors (nginx with multiple upstream)<br>
><br>
> Do I miss something? Is this a bad idea?<br>
> If I do setup a mirror like that, is there any chance it could be <br>
> added as a official mirror?<br>
><br>
> Best regards<br>
> Kristian Klausen<br>
</blockquote></div>