Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Scaling Git

Scaling Git

Atlassian Summit 2014 - Scaling Git

Stefan Saasen

September 15, 2014
Tweet

More Decks by Stefan Saasen

Other Decks in Programming

Transcript

  1. Git is fundamentally a content-addressable filesystem with a VCS user

    interface written on top of it Pro Git Book, Section: Git Inter nals ” “
  2. GIT UNDER THE HOOD $> tree .git/objects .git/objects !"" e4

    $ #"" 3a6ac59164adadac854d591001bbb10086f37d !"" info #"" pack ! 3 directories, 1 file zlib compressed SHA1
  3. GIT UNDER THE HOOD $> tree .git/objects .git/objects !"" 13

    $ #"" 1e360ae1a0c08acd18182c6160af6a83e0d22f !"" 31 $ #"" 995f2d03aa31ee97ee2e814c9f0b0ffd814316 !"" e4 $ #"" 3a6ac59164adadac854d591001bbb10086f37d !"" info #"" pack ! 5 directories, 3 files
  4. GIT UNDER THE HOOD $> tree .git/objects .git/objects !"" 13

    $ #"" 1e360ae1a0c08acd18182c6160af6a83e0d22f !"" 31 $ #"" 995f2d03aa31ee97ee2e814c9f0b0ffd814316 !"" e4 $ #"" 3a6ac59164adadac854d591001bbb10086f37d !"" info #"" pack ! 5 directories, 3 files Blob
  5. GIT UNDER THE HOOD $> tree .git/objects .git/objects !"" 13

    $ #"" 1e360ae1a0c08acd18182c6160af6a83e0d22f !"" 31 $ #"" 995f2d03aa31ee97ee2e814c9f0b0ffd814316 !"" e4 $ #"" 3a6ac59164adadac854d591001bbb10086f37d !"" info #"" pack ! 5 directories, 3 files Blob Tree
  6. GIT UNDER THE HOOD $> tree .git/objects .git/objects !"" 13

    $ #"" 1e360ae1a0c08acd18182c6160af6a83e0d22f !"" 31 $ #"" 995f2d03aa31ee97ee2e814c9f0b0ffd814316 !"" e4 $ #"" 3a6ac59164adadac854d591001bbb10086f37d !"" info #"" pack ! 5 directories, 3 files Blob Tree Commit
  7. GIT UNDER THE HOOD $> tree .git/objects .git/objects !"" 13

    $ #"" 1e360ae1a0c08acd18182c6160af6a83e0d22f !"" 31 $ #"" 995f2d03aa31ee97ee2e814c9f0b0ffd814316 !"" c1 $ #"" 9e6823e34980033917b6427f3e245ce2102e6e !"" e4 $ #"" 3a6ac59164adadac854d591001bbb10086f37d ! 6 directories, 4 files Entirely new BLOB
  8. GIT UNDER THE HOOD $> tree .git/objects .git/objects !"" info

    $ #"" packs #"" pack !"" pack-7475314b451a882d77b1535d215def8bad0f4306.idx #"" pack-7475314b451a882d77b1535d215def8bad0f4306.pack ! 2 directories, 3 files
  9. CPU Replace Graph 0 200000 400000 600000 800000 1407989425 1407989450

    1407989475 1407989500 1407989525 1407989550 1407989575 user syst CPU
  10. Memory 0 100 200 300 400 1407989425 1407989450 1407989475 1407989500

    1407989525 1407989550 1407989575 MiB Memory
  11. IO Replace Graph 0 5 10 15 20 1407989440 1407989460

    1407989480 1407989500 1407989520 1407989 read write Disk I/O
  12. Scaling Git • Git hosting operations are expensive. • Properly

    size the hardware for the workload that you expect.
  13. Scaling Git • Git hosting operations are expensive. • Properly

    size the hardware for the workload that you expect. • Avoid polling when you do a lot of builds, enable caching of ref advertisements when you can't.
  14. Scaling Git • Git hosting operations are expensive. • Properly

    size the hardware for the workload that you expect. • Avoid polling when you do a lot of builds, enable caching of ref advertisements when you can't. • Prefer shallow clones
  15. Scaling Git • Git hosting operations are expensive. • Properly

    size the hardware for the workload that you expect. • Avoid polling when you do a lot of builds, enable caching of ref advertisements when you can't. • Prefer shallow clones • Limits are in place to keep your Stash server running
  16. Scaling Git • Git hosting operations are expensive. • Properly

    size the hardware for the workload that you expect. • Avoid polling when you do a lot of builds, enable caching of ref advertisements when you can't. • Prefer shallow clones • Limits are in place to keep your Stash server running • Stash Data Center allows you to scale out and have high availability