Let's make reposync faster

Every day,

Multiple times a day,

Every SUSE Manager customer,

Every Red Hat Satellite customer,

Every Spacewalk user,

And every Uyuni user...

...spends a lot of CPU and wall clock time in reposyncing.


A lot of that time is wasted by an old, overcomplicated and most of all inefficient algorithm that contributes heavily on heat dissipation and user patience depletion!

HackWeek hackers, we can change that!

Past attempts only partially succeeded: https://trello.com/c/inl9Wu0p/40-reduce-global-warming, https://trello.com/c/dYAR0J8K/13-reduce-global-warming-take-2

But we have better tools now!


py-spy to the rescue: introduction

Install with: curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py python get-pip.py pip install py-spy

Trace a running spacewalk-repo-sync with: py-spy --nonblocking --pid `ps aux | grep spacewalk-repo-sync | grep -v grep | awk '{print $2}'` --flame output.svg --duration 10

Look at the results with:

python -m SimpleHTTPServer 8666

And point your browser to http://<NAME_HERE>:8666/output.html. Here is one such example:

Flame Graph

Current remarks:

  • we currently spend a lot of time in lookup functions
  • lookup functions SELECT rows at every INSERT
  • this is especially bad for checksums, capabilities and some other cases
  • design comes from Oracle and can probably be changed!

Looking for mad skills in:

python performance databases postgresql

This project is part of:

Hack Week 18


  • 7 months ago: joachimwerner liked Uyuni: improve spacewalk-repo-sync performance
  • 8 months ago: mkoutny liked Uyuni: improve spacewalk-repo-sync performance
  • 8 months ago: Pharaoh_Atem liked Uyuni: improve spacewalk-repo-sync performance
  • 9 months ago: PSuarezHernandez liked Uyuni: improve spacewalk-repo-sync performance
  • 9 months ago: ebischoff liked Uyuni: improve spacewalk-repo-sync performance
  • Show History


    • ebischoff
      9 months ago by ebischoff | Reply

      See also this fate request "Have a synchronization that does not take hours (or days)"

    • joachimwerner
      7 months ago by joachimwerner | Reply

      Related, but probably out of scope for your hack week project: Once we've optimized the syncing code, I think we could also reduce the scope of what needs to be synced for many customers: Especially for pilots, but also in real life, many of the older updates (e.g. several complete kernels, several Java updates) are never going to be needed, but still synced. We should investigate how we can offer something like a "JeR" ("Just enough Repo") to speed things up even more. This could be done server-side (provide alternative repo metadata for a "current stuff only" repo or client-side (but then some dependency resolution magic is probably needed).

    • chasecrum
      7 months ago by chasecrum | Reply

      Any update on how this turned out?

    Similar Projects

    Kanidm: A safe and modern IDM system by firstyear

    This hackweek I'll be working on Kanidm, an IDM...