#980 Make the garbage collector run more often when under load

Reporter Link Mauve
Owner Nobody
Stars ★ (1)
  • Type-Enhancement
  • Status-WontFix
  • Priority-Medium
  1. Link Mauve on

    Description of feature: Detect when memory usage is increasing too quickly and trigger a garbage collection at that moment, while decreasing the duration until the next collection. Motivation: (Why?) When Prosody is getting a lot of requests (typically during an attack), Lua’s memory usage is increasing a lot, and this memory is never freed, resulting in a way higher usage than expected until the next restart. This would trade some CPU time during the attack against a much better handling of memory in the long term.

  2. Zash on

    First, try experimenting with the existing tunables that Lua exposes for its garbage collector. See https://www.lua.org/manual/5.1/manual.html#2.10 (for Lua 5.1) or https://www.lua.org/manual/5.2/manual.html#2.5 (for 5.2) This can be done from the config, eg by adding: collectgarbage("setpause", 120) If this isn't enough, then we can start thinking about other options.

    • tags Status-NeedInfo
  3. Zash on

    Did you find any good parameters or are you still having issues?

  4. Zash on

    • tags Status-WontFix

New comment

Not published. Used for spam prevention and optional update notifications.