Conversation
Add documentation to clarify that total_cpu parameter should represent logical CPU cores (including hyperthreading), not just physical cores. This resolves confusion about whether an 8-core CPU with hyperthreading should report 8 or 16 cores. The API is designed to work with logical cores (16 in this example) as PostgreSQL benefits from hyperthreading with 15-40% performance improvement. Added documentation in: - Input struct with inline comments and examples - CLI help text for --cpus flag - README with explanation and rationale Closes #34 Signed-off-by: Sebastian Webber <sebastian@swebber.me>
Change Mixed and Desktop profile constants from mixed case to uppercase to match Set() method behavior which converts input to uppercase. Before this fix, pgconfigctl tune rejected --profile=Mixed and --profile=Desktop even though they appeared in valid options list. Changes: - Update Mixed from "Mixed" to "MIXED" constant - Update Desktop from "Desktop" to "DESKTOP" constant - Add comprehensive unit tests for profile.Set() method - Add CLI integration tests validating all profile parsing scenarios - Export RootCmd in root.go to enable testing Closes #22 Signed-off-by: Sebastian Webber <sebastian@swebber.me>
Windows PostgreSQL ≤ 17 cannot exceed 2097151 kB (~2GB) for work_mem and maintenance_work_mem due to Windows LLP64 model where sizeof(long) remains 4 even on 64-bit systems. PostgreSQL used MAX_KILOBYTES = INT_MAX/1024 when SIZEOF_LONG <= 4, resulting in the 2GB limit. This was fixed in PostgreSQL 18 by removing the SIZEOF_LONG check, increasing the limit to 2TB. Changes: - Add WindowsMaxWorkMem constant (2097151 KB) - Apply limit in computeOS() for Windows + PostgreSQL < 18.0 - Add comprehensive tests including PostgreSQL 18+ cases - Update rules.yml with version-specific limitation and fix reference Tests verify: - work_mem/maintenance_work_mem capped at ~2GB on Windows PG ≤ 17 - No limitations on Windows PG 18+ - No limitations on Linux/Unix platforms - Correct behavior with high RAM (256GB, 1TB) scenarios References: - PostgreSQL 18 fix: https://www.postgresql.org/message-id/flat/1a01f0-66ec2d80-3b-68487680@27595217 - pgvector issue: pgvector/pgvector#667 - CommitFest patch: https://commitfest.postgresql.org/patch/5343/ Closes #5 Signed-off-by: Sebastian Webber <sebastian@swebber.me>
Improve readability and highlight critical information using GitHub-style alert blocks (NOTE, TIP, WARNING, IMPORTANT). Convert formulas to code blocks, add backticks to parameters/commands, and reorganize recommendations for better discoverability. Makes warnings about OOM risks, Windows limits, and security practices more prominent and scannable. Signed-off-by: Sebastian Webber <sebastian@swebber.me>
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.
fixes #34
fixes #22
fixes #5
fixes #12