Live data from Hacker News

How we decreased GitLab repo backup times from 48 hours to 41 minutes

about.gitlab.com

21–30 of 273 posts

Re: How we decreased GitLab repo backup times from 48 hours to 41 minutes

#21
post #6

"fixed it with an algorithmic change, reducing backup times exponentially" If the backup times were O(n^2), are they now O(n^2 / 2^n)? I would guess not.

Meaningless and non-constructive pedantry.

I'm not the OP you're responding to, but to be fair, in a sentence about big-O perf characteristics, which includes the word "algorithms", using "exponentially" in a colloquial non-technical sense is an absolutely terrible word choice.

Re: How we decreased GitLab repo backup times from 48 hours to 41 minutes

#22

IME, it has always turned out to be the correct decision to eliminate any n^2 operation in anything I’ve written. I don’t write exotic algorithms, but it’s always astounding how small n needs to be to become observably problematic.

My rule of thumb for 80%-90% of the problems is, if you need complicated algorithm, it means your data model isn't right. Sure, you do need complicated algorithms for compilers, db internals, route planning et all, but all things considered, those are minority of the use cases.

Re: How we decreased GitLab repo backup times from 48 hours to 41 minutes

#23
48 hours is a crazy amount of time to spend just to compress a git folder, it's only a couple GB. 41 minutes still seems like quite a long time.

Why aren't they just snapshotting and archiving the full git repo? Does `git bundle` add something over frequent ZFS backups?

Re: How we decreased GitLab repo backup times from 48 hours to 41 minutes

#24
post #3

Are there any reimplementations of git, by professional programmers using real tools? The source in question — object.c — is "banging rocks together" material.

We use go-git in one of our Go projects that relies on Git for version control of its data.

Re: How we decreased GitLab repo backup times from 48 hours to 41 minutes

#25

Earlier quoted context omitted.

Meaningless and non-constructive pedantry.

I'm not the OP you're responding to, but to be fair, in a sentence about big-O perf characteristics, which includes the word "algorithms", using "exponentially" in a colloquial non-technical sense is an absolutely terrible word choice.

Exponentially bad word choice even... since we're using that word however we want now?

I don't think this is meaningless or non-constructive pedantry - we're a technical community and those are technical words.

Re: How we decreased GitLab repo backup times from 48 hours to 41 minutes

#26
Here comes an unpopular nitpick: "... we traced the issue to a 15-year-old Git function with O(N²) complexity and fixed it with an algorithmic change, reducing backup times exponentially."

Uh no you didn't. Not possible. At most a polynomial reduction is possible else complexity theory needs a re-write.

(OK, yes, k could be doing some heavy lifting here, but I doubt it.)

If you are going to quote a maths formula then please don't use "exponetially" to mean "lots".

I stopped reading there: I don't want to have to read each word and wonder if they actually meant it, or it's just bad hype.

Re: How we decreased GitLab repo backup times from 48 hours to 41 minutes

#27
post #23

48 hours is a crazy amount of time to spend just to compress a git folder, it's only a couple GB. 41 minutes still seems like quite a long time. Why aren't they just snapshotting and archiving the full git repo? Does `git bundle` add something over frequent ZFS backups?

> Be aware that even with these recommendations, syncing in this way has some risk since it bypasses Git’s normal integrity checking for repositories, so having backups is advised. You may also wish to do a git fsck to verify the integrity of your data on the destination system after syncing.

https://git-scm.com/docs/gitfaq#_transfers

It doesn't tell you how to make a backup safely though.

On a personal scale, Syncthing and Btrfs snapshots work plenty good enough. It's as fast as the storage/network too.

Re: How we decreased GitLab repo backup times from 48 hours to 41 minutes

#28
post #6

"fixed it with an algorithmic change, reducing backup times exponentially" If the backup times were O(n^2), are they now O(n^2 / 2^n)? I would guess not.

Meaningless and non-constructive pedantry.

I disagree. Misuse of the word "exponential" is a major pet peeve of mine. It's a particular case of the much more common "use mathematically precise phrasing to sound careful/precise" that you often find in less than honest writing.

Here they are actually using it to refer to growth functions (which is rare for this error) and being honest (which is also rare IMO) but it's still wrong. They should have written about quadratic or quadratic vs linear.

Regardless sloppy language leads to sloppy thought.

Re: How we decreased GitLab repo backup times from 48 hours to 41 minutes

#29
post #26

Here comes an unpopular nitpick: "... we traced the issue to a 15-year-old Git function with O(N²) complexity and fixed it with an algorithmic change, reducing backup times exponentially." Uh no you didn't. Not possible. At most a polynomial reduction is possible else complexity theory needs a re-write. (OK, yes, k could be doing some heavy lifting here, but I doubt it.) If you are going to quote a maths formula then…

OP here. Feedback is always welcome, I did mean exponentially in the colloquial sense. I do see how it is confusing here, will change it.

Re: How we decreased GitLab repo backup times from 48 hours to 41 minutes

#30

How was the flame graph created? (Not very familiar with C and the performance tools around it)

https://github.com/brendangregg/FlameGraph You record performance data with `perf`, then use the scripts there to turn it into a SVG.

OP here. In this particular case, I used https://github.com/flamegraph-rs/flamegraph
Post reply on HN