Skip to content

Add save/restore state management to fasterdata-tuning.sh#60

Merged
ShawnMcKee merged 2 commits intomasterfrom
feature/save-restore-state
Dec 10, 2025
Merged

Add save/restore state management to fasterdata-tuning.sh#60
ShawnMcKee merged 2 commits intomasterfrom
feature/save-restore-state

Conversation

@ShawnMcKee
Copy link
Contributor

Implements comprehensive save/restore functionality (v1.2.0) to support performance testing workflows with different tuning configurations.

Features:

  • Save current system state with optional labels
  • Restore previously saved configurations
  • List, compare, and delete saved states
  • Auto-save before applying changes
  • JSON-based state files with metadata

Captured state includes:

  • Sysctl parameters (TCP buffers, congestion control, etc.)
  • Per-interface settings (txqueuelen, MTU, ring buffers, offload features, qdisc)
  • Configuration files (/etc/sysctl.d/90-fasterdata.conf, systemd services)
  • CPU governor and SMT state
  • Tuned profile

State files stored in /var/lib/fasterdata-tuning/saved-states/

New command-line options:
--save-state Save current configuration
--label LABEL Add label to saved state
--restore-state FILE Restore saved configuration
--list-states List all saved states
--diff-state FILE Compare current vs saved state
--delete-state FILE Delete saved state
--auto-save-before Auto-save before apply mode

Documentation:

  • Added comprehensive State Management section to fasterdata-tuning.md
  • Included example performance testing workflow
  • Updated README.md with quick reference
  • Added SAVE_RESTORE_DESIGN.md with technical design details

Safety features:

  • Validation and pre-flight checks
  • Backup files before modification
  • Interactive confirmation prompts (bypass with --yes)
  • Warnings for hardware-dependent settings
  • Clear limitation documentation

Use case:
Save baseline -> Run tests -> Apply tuning -> Run tests -> Restore baseline -> Try different tuning -> Compare results

Implements comprehensive save/restore functionality (v1.2.0) to support
performance testing workflows with different tuning configurations.

Features:
- Save current system state with optional labels
- Restore previously saved configurations
- List, compare, and delete saved states
- Auto-save before applying changes
- JSON-based state files with metadata

Captured state includes:
- Sysctl parameters (TCP buffers, congestion control, etc.)
- Per-interface settings (txqueuelen, MTU, ring buffers, offload features, qdisc)
- Configuration files (/etc/sysctl.d/90-fasterdata.conf, systemd services)
- CPU governor and SMT state
- Tuned profile

State files stored in /var/lib/fasterdata-tuning/saved-states/

New command-line options:
--save-state              Save current configuration
--label LABEL             Add label to saved state
--restore-state FILE      Restore saved configuration
--list-states             List all saved states
--diff-state FILE         Compare current vs saved state
--delete-state FILE       Delete saved state
--auto-save-before        Auto-save before apply mode

Documentation:
- Added comprehensive State Management section to fasterdata-tuning.md
- Included example performance testing workflow
- Updated README.md with quick reference
- Added SAVE_RESTORE_DESIGN.md with technical design details

Safety features:
- Validation and pre-flight checks
- Backup files before modification
- Interactive confirmation prompts (bypass with --yes)
- Warnings for hardware-dependent settings
- Clear limitation documentation

Use case:
Save baseline -> Run tests -> Apply tuning -> Run tests ->
Restore baseline -> Try different tuning -> Compare results
- SC2155: Separate declaration and assignment for date command variables
- SC2015: Replace A && B || C pattern with proper if-then-else blocks

All shellcheck warnings now resolved.
@ShawnMcKee ShawnMcKee merged commit a3bf2a8 into master Dec 10, 2025
9 checks passed
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.

1 participant