Speeding-up Yum for CentOS EC2 instances

Wednesday , 5, February 2020 1 Comment

Tomorrow, I intend to push a change to mirrorlist.centos.org nodes that will have a (good) impact to CentOS EC2 instances running from AWS network.

Thanks to AWS, sponsoring the required backend infra for this to happen, our mirrorlist nodes will redirect yum/dnf operations internally in the EC2/AWS network.

What does that mean for you ?

  • faster updates (due to Cloudfront caching, and so most of the recent packages/rpms being kept in cache in each region)
  • less data transfer costs (due to such updates being served from inside EC2 network[s] and so not leaving EC2 infrastructure)

How does it work ?

  • When your CentOS EC2 instance hits mirrorlist.centos.org, it's identified as coming from EC2 network, thanks to https://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html, loaded into our mirrorlist code
  • You'll be redirected to CloudFront, itself using a dedicated origin to which we automatically push all updates directly
  • if you're the first one asking for that update/rpm, Edge (cache server in that region) will retrieve it and will cache it while also serving it to you
  • if someone requested same rpm that you're asking for, it will be directly served from cache, so at "local" speed (we saw some rpm being downloaded on second attempt at ~80MB/s)

We already tested with several volunteers in our staging environment that it was working fine, and so far so good.

We have no real estimate about the number of CentOS EC2 instances in all regions, so we plan on doing a canary-style deployment, so Ansible switching our mirrorlist code/role one-by-one and observe the cloudfront statistics.

Should you encounter any issue, feel free to reply to this thread and/or #centos-devel on irc.freenode.net

One thought on “ : Speeding-up Yum for CentOS EC2 instances”
  • Eduard says:

    Hi

    I'm currently having issue with installing python on centos:8

    `yum -y install python2` fails with

    python2-2.7.16-12.module_el8.1.0+219+cf9e6ac9.x86_64.rpm: Status code: 404 for http://d36uatko69830t.cloudfront.net/centos/8/AppStream/x86_64/os/Packages/python2-2.7.16-12.module_el8.1.0+219+cf9e6ac9.x86_64.rpm
    ...
    Cannot download Packages/python2-2.7.16-12.module_el8.1.0+219+cf9e6ac9.x86_64.rpm: All mirrors were tried

    Same operation outside of AWS network works fine

    Thanks!

  • Please give us your valuable comment

    Your email address will not be published. Required fields are marked *