Add systemd timer as alternative auto-save mechanism#157
Open
Marcel-Bich wants to merge 1 commit intotmux-plugins:masterfrom
Open
Add systemd timer as alternative auto-save mechanism#157Marcel-Bich wants to merge 1 commit intotmux-plugins:masterfrom
Marcel-Bich wants to merge 1 commit intotmux-plugins:masterfrom
Conversation
The default status-right based auto-save uses #() command substitution that runs on every status refresh for every attached client. With many concurrent sessions this causes CPU scaling issues. This adds a systemd user timer that calls tmux-resurrect save directly, once per interval, independent of client count. Closes tmux-plugins#99
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a systemd user timer as an alternative to the
status-right#()based auto-save. This addresses the long-standing request in #99 to decouple auto-save from the status bar.Problem
The current auto-save mechanism prepends
#(continuum_save.sh)tostatus-right. tmux evaluates#()commands on every status refresh for every attached client. With N clients and a 5-secondstatus-interval, that means N shell invocations every 5 seconds, each spawning multiple subprocesses for version checks, timestamp comparisons, and tmux queries.This scales poorly:
Each invocation spawns ~10 subprocesses, creating thousands of context switches per second.
Solution
A systemd user timer that calls
tmux-resurrect savedirectly, once every 15 minutes, regardless of client count. This is opt-in and documented insystemd/README.md.Users who prefer the existing mechanism can continue using it unchanged.
Files added
systemd/tmux-resurrect-save.service- oneshot servicesystemd/tmux-resurrect-save.timer- 15-minute timersystemd/README.md- setup instructionsCloses #99