Conversation
Contributor
There was a problem hiding this comment.
⚠️ Not ready to approve
It introduces a critical response/serialization correctness issue in KMIP JSON responses and a high-risk cache-staleness/security concern (multi-instance consistency) that should be resolved before approval.
Pull request overview
This PR targets server throughput/latency improvements by reducing hot-path allocations and database round-trips, primarily via a new in-memory retrieve_object cache and several DB/HTTP tuning changes.
Changes:
- Add an in-memory object cache in
server_databaseand integrate it intoDatabase::retrieve_object, with invalidation on mutations. - Optimize KMIP JSON handling/dispatch (reduced allocations, conditional metrics/policy work) and add an
http_workersserver setting. - Improve load-test benchmarking ergonomics (warmup/cooldown) and tune SQLite backend (PRAGMAs, indexes, cached prepared statements).
File summaries
| File | Description |
|---|---|
| documentation/docs/certifications_and_compliance/cryptographic_algorithms/benchmarks/benchmarks_load_tests_5.23.0.md | Reformat benchmark result tables. |
| documentation/docs/certifications_and_compliance/cryptographic_algorithms/benchmarks/benchmarks_load_tests_5.17.0.md | Reformat benchmark result tables. |
| crate/server/src/start_kms_server.rs | Apply optional actix-web worker count from config. |
| crate/server/src/routes/kmip.rs | Reduce JSON allocs/serialization overhead and adjust response construction. |
| crate/server/src/middlewares/otel_http_middleware.rs | Import ordering tweaks only. |
| crate/server/src/main.rs | Update test config struct initialization for new server param. |
| crate/server/src/core/otel_metrics.rs | Import grouping tweaks only. |
| crate/server/src/core/operations/key_ops/crypto_op.rs | Local-key fast paths + owner authorization fast-path + unwrap guard. |
| crate/server/src/core/operations/dispatch.rs | Reduce overhead when metrics/policy are disabled. |
| crate/server/src/core/kms/permissions.rs | Remove debug logging from get_user. |
| crate/server/src/config/wizard/tests.rs | Update wizard round-trip test struct for new HTTP config field. |
| crate/server/src/config/wizard/http_wizard.rs | Initialize new HTTP config field in wizard output. |
| crate/server/src/config/params/server_params.rs | Add http_workers to server params and wire it from config. |
| crate/server/src/config/command_line/http_config.rs | Add --http-workers / KMS_HTTP_WORKERS config plumbing and display. |
| crate/server_database/src/stores/sql/sqlite.rs | SQLite PRAGMAs, connection pool sizing, schema bootstrapping indexes, cached prepared statements. |
| crate/server_database/src/stores/sql/query.sql | Add indexes for owner/state/userid lookups. |
| crate/server_database/src/lib.rs | Re-export the new cache type. |
| crate/server_database/src/core/object_cache.rs | New LRU-ish cache with timestamp-based GC for retrieved objects. |
| crate/server_database/src/core/mod.rs | Add object_cache to Database and move object-count helpers to default-store-only impl. |
| crate/server_database/src/core/database_objects.rs | Integrate object cache, add invalidation on writes, tweak store routing fast-path. |
| crate/kmip/src/ttlv/kmip_ttlv_serializer.rs | Pre-allocate serializer stack capacity (constructor no longer const fn). |
| crate/interfaces/src/stores/objects_store.rs | Whitespace cleanup only. |
| crate/clients/clap/src/actions/bench.rs | Add warmup/cooldown flags and rework load-test execution model. |
Copilot's findings
- Files reviewed: 23/23 changed files
- Comments generated: 13
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
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.
No description provided.