Repository navigation
perf: run the dump and zip in a low-priority child process - #2
Merged
Merged
Conversation
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.
Why
Backups still cause
sync thread hitch warnings on a busy host, even atqbx_db_backup_max_mb_per_second 6. Apart from launchingmariadb-dump, all backup work happens inside the FXServer process:All of these threads run at normal priority. So the backup competes on equal terms with svSync, which ticks at 120 Hz and warns at 100 ms.
What
child_process.forkchild (dist/spool.js) at below-normal priority. FXServer forks itself with--fork-node22, the same path the stockyarnbuilder uses. The server process only receives a progress message once a second and the final size and hash.add_unsafe_child_process_permissionis still the only server.cfg requirement.maxBytes.maxBytesonUploadSink/S3Sinkis now only checked once the zip is written. Nothing sets it today.Measurements
Measured in the real dev FXServer pinned to 2 logical CPUs. Each run dumps 1.75 GB of SQL into a 275 MB zip at level 6. The 120 Hz probe is a normal-priority thread on the same CPUs, standing in for svSync.
Without a pace limit on 2 cores, the child saturates the CPUs. Even at low priority, Windows' anti-starvation boosts then cause short system-wide stalls, so the pace convar still matters. The current code only avoided this at unlimited pace because every zlib chunk waits for svMain's 1 ms loop pump, which capped it at about 24 MB/s.
Testing
bun test, including newforkSpooltests. Typecheck and lint pass..partfile.