youtube image
From YouTube: 2020 11 17 Memory Team 2GB Sync

Description

0:30 - Gather baseline performance - https://gitlab.com/gitlab-org/memory-team/team-tasks/-/issues/75
- Initial impressions and swap space needed
- Discussed using Spring with Omnibus
- Application loaded only once
- Loading Puma and Sidekiq on top of preforking fast
- Rails console instantaneous with Spring preloader
- Most of the memory is unique to a forked process
- Only 200-250MB shared - this is known
3:33 Are we loading everything?
- Next steps - print out what code is being loaded within what process
- Determine why we have so many copies in memory
- Running GPT against 2G and 2G with split to compare graphs
5:40 Investigate Memory Content - https://gitlab.com/gitlab-org/memory-team/memory-team-2gb-week/-/issues/4
- Took 3 different snapshots using rbtrace
- Compared scripts and removed common objects
- Goal - get only the long lasting objects
- Repeated steps multiple times and got different results each time
- Also ran same steps for Sidekiq worker - no discernable pattern
11:25 Discussions about heap and malloc
12:00 Topic - Investigate used gems - https://gitlab.com/gitlab-org/memory-team/memory-team-2gb-week/-/issues/5
- List of memory usage per gem
- Maximum is 200MB
- Only includes just Ruby gems
- Re run with cut-off point of zero to see volume of things in memory
- Discussed loading graphql in memory (schema file)
- Discussed not needing to load whole API in sidekiq
- Can we optimize what we load? How much memory does the API package use? We can shave this from the SideKiq process
- Memory profiler - look into retained memory
19:51 Topic - Investigate Ruby 2.7 GC Compaction - https://gitlab.com/gitlab-org/memory-team/memory-team-2gb-week/-/issues/1
- Overview of garbage compaction
- Description of fragmentation - only free when entire page is free
- Discuss HeapFrag tool
- Demo heap on our processes
27:00 Experimenting with timing of compacting
- Not sure about memory impact
36:00 Discussing the time taken for garbage compacting
- Discussed different ways to configure gc
39:40 Suggestions on when to call GC
- GC before forking
- GC when application is fully initialized
○ Perhaps within initializer
41:20 Experiment with Puma in Single Mode https://gitlab.com/gitlab-org/memory-team/memory-team-2gb-week/-/issues/2
- Initial failures on 4GB machine
- Instructions
- Why we can't use it
- Next steps
○ explain difference in PSS
○ Test different request pressure
○ Describe why we don't use a single mode
52:00 What's next