New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Cabal-2.0 #600

Closed
hvr opened this Issue Jul 16, 2017 · 1 comment

Comments

Projects
None yet
1 participant
@hvr
Member

hvr commented Jul 16, 2017

hackage-server is currently Cabal-1.24 based; but we need to upgrade it to Cabal-2.0 real soon. This is expected to provide substantial heap memory savings.

@hvr hvr self-assigned this Jul 16, 2017

hvr referenced this issue Jul 16, 2017

Avoid orphan TH-derived SafeCopy instances
Using explicitly spelled out instance implementations results in a more
defensive style which gives the compiler a better chance to notify us
when types changes (and thus potentially the binary serialisation).
@hvr

This comment has been minimized.

Show comment
Hide comment
@hvr

hvr Jul 16, 2017

Member

The heap-profiles below show the startup phase of hackage and then idling for a little amount of time.

Cabal 1.24 Heap-profile

Hackage heap profile with Cabal-1.24

Cabal 2.0 Heap-profile

Hackage heap profile with Cabal-2.0


This has been enabled by data-representation optimizations in Cabal (most notably haskell/cabal#3896 and haskell/cabal#3905).

This results in a reduction of about 0.5 GiB worth of (:) heap-objects, which consequently means a reduction of about ~20 million (:) allocated on the heap the GC won't have to traverse anymore! Overall, in terms of actual process-size (i.e. RSS), migrating to Cabal-2.0 translates into saving about 2 GiB of RAM.

TODO: figure out what those (:)-allocation spikes are which are still present late into the startup.

Member

hvr commented Jul 16, 2017

The heap-profiles below show the startup phase of hackage and then idling for a little amount of time.

Cabal 1.24 Heap-profile

Hackage heap profile with Cabal-1.24

Cabal 2.0 Heap-profile

Hackage heap profile with Cabal-2.0


This has been enabled by data-representation optimizations in Cabal (most notably haskell/cabal#3896 and haskell/cabal#3905).

This results in a reduction of about 0.5 GiB worth of (:) heap-objects, which consequently means a reduction of about ~20 million (:) allocated on the heap the GC won't have to traverse anymore! Overall, in terms of actual process-size (i.e. RSS), migrating to Cabal-2.0 translates into saving about 2 GiB of RAM.

TODO: figure out what those (:)-allocation spikes are which are still present late into the startup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment