Skip to content

chore: memory optimizations#136

Merged
niccoloraspa merged 1 commit intomainfrom
moe/flashbox-l1-memory-headroom
Apr 30, 2026
Merged

chore: memory optimizations#136
niccoloraspa merged 1 commit intomainfrom
moe/flashbox-l1-memory-headroom

Conversation

@MoeMahhouk
Copy link
Copy Markdown
Member

This pull request introduces several configuration changes to improve memory management and performance for the Lighthouse service. The most significant updates include enabling transparent huge pages, adjusting the state cache size, and switching the memory allocator in the build process.

Performance and Memory Management:

  • Enabled transparent huge pages by adding transparent_hugepage=madvise to the kernel command line in shared/mkosi.conf, which can improve memory usage efficiency.
  • Set the Lighthouse state cache size to 32 by adding --state-cache-size 32 to the systemd service configuration in modules/flashbox/flashbox-l1/mkosi.extra/etc/systemd/system/lighthouse.service.

Build Process:

  • Switched the memory allocator feature from sysmalloc to jemalloc-unprefixed in the Lighthouse build command in modules/flashbox/flashbox-l1/mkosi.build, which may enhance performance and reduce memory fragmentation.

Copy link
Copy Markdown
Contributor

@pablin-10 pablin-10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes reduced memory consumption drastically on lighthouse v8.1.3

@pablin-10
Copy link
Copy Markdown
Contributor

before:

samples: 3132  from: 2026-04-28T20:22:11Z  to: 2026-04-29T05:05:00Z

field                 mean(MB)     min(MB)     max(MB)
MemAvailable             11601           -           -
AnonPages                17222           -           -
AnonHugePages            15274           -           -
lighthouse RSS            9772        9095       10756
geth RSS                  7634        7334        8180

lighthouse RSS first 10min mean: 9127 MB
lighthouse RSS last  10min mean: 10158 MB   (delta: +1030 MB)

after:

samples: 2450  from: 2026-04-28T22:15:31Z  to: 2026-04-29T05:04:58Z

field                 mean(MB)     min(MB)     max(MB)
MemAvailable             20407           -           -
AnonPages                 8856           -           -
AnonHugePages                2           -           -
lighthouse RSS            4284        4091        5081
geth RSS                  4689        3788        5199

lighthouse RSS first 10min mean: 4138 MB
lighthouse RSS last  10min mean: 4410 MB   (delta: +272 MB)

@MoeMahhouk MoeMahhouk marked this pull request as ready for review April 29, 2026 06:44
@niccoloraspa niccoloraspa merged commit c5bf67e into main Apr 30, 2026
@niccoloraspa niccoloraspa deleted the moe/flashbox-l1-memory-headroom branch April 30, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants