feat: add LOCK_DSN support, rework probes & optimize php settings - #227
Merged
Conversation
Kevin Rudde (kevinrudde)
marked this pull request as ready for review
July 29, 2026 12:53
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances Shopware operator configuration and deployment health behavior by adding Symfony lock-store configuration (via LOCK_DSN), adjusting default PHP/database environment tuning, and changing storefront probes to rely on php-fpm’s ping endpoint for more resilient pod restarts under DB pressure.
Changes:
- Add
spec.lock(LockSpec) and emitLOCK_DSNwhen using the Redis adapter. - Update default envs (opcache sizing; default
DATABASE_PERSISTENT_CONNECTION=0) and override to=1in the worker deployment. - Rework storefront startup/liveness probes to use
/-/fpm/pingon a dedicated admin port (8001), keeping readiness DB-aware.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
internal/deployment/worker.go |
Adds worker-specific env defaults (persistent DB connections) layered over shared env. |
internal/deployment/storefront.go |
Introduces FPM admin port constant and switches startup/liveness probes to /-/fpm/ping on port 8001. |
api/v1/zz_generated.deepcopy.go |
Adds deepcopy support for the new LockSpec and copies it in StoreSpec. |
api/v1/store.go |
Adds LockSpec to StoreSpec and changes ContainerSpec.Merge volume/volumeMount handling to append. |
api/v1/store_env.go |
Emits LOCK_DSN for Redis lock adapter; increases opcache defaults; changes default DB persistent connection behavior. |
Files not reviewed (1)
- api/v1/zz_generated.deepcopy.go: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Kevin Rudde (kevinrudde)
force-pushed
the
performance
branch
2 times, most recently
from
July 29, 2026 13:34
1fdad96 to
8fd4bf5
Compare
Patrick Derks (TrayserCassa)
approved these changes
Jul 29, 2026
Kevin Rudde (kevinrudde)
force-pushed
the
performance
branch
2 times, most recently
from
July 29, 2026 14:24
c5e374b to
a71840c
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
Files not reviewed (1)
- api/v1/zz_generated.deepcopy.go: Generated file
Comments suppressed due to low confidence (2)
api/v1/store_env.go:393
OTEL_PHP_EXCLUDED_URLSis intended to exclude the readiness probe (/api/_info/health-check) and fpm-admin endpoints, but the configured value lacks the leading slashes (current probes use "/api/_info/health-check" and "/-/fpm/ping"). This likely prevents the exclusion from matching the actual request paths.
// Skip tracing probe/monitoring requests entirely (no span, no export).
// The readiness probe (/api/_info/health-check) and the fpm-admin
// endpoints hit workers frequently; tracing them stalls workers on span
// export, inflating php-fpm active_processes and breaking autoscaling.
{
Name: "OTEL_PHP_EXCLUDED_URLS",
Value: "api/_info/health-check,-/fpm/",
},
api/v1/store_env.go:585
SQL_SET_DEFAULT_SESSION_VARIABLESis no longer set inGetEnv()(it appears to have been replaced by the new opcache sizing envs). If the Shopware image default for this setting is not already "0", this changes runtime behavior implicitly. If the intent is to keep the previous behavior, re-add the env var alongside the new opcache settings.
{
Name: "PHP_OPCACHE_MAX_ACCELERATED_FILES",
Value: "20000",
},
fix: merge volumeMounts feat: add LOCK_DSN support and optimized php settings
Kevin Rudde (kevinrudde)
force-pushed
the
performance
branch
from
July 30, 2026 15:29
e3a1801 to
a40cefe
Compare
Patrick Derks (TrayserCassa)
approved these changes
Jul 31, 2026
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.
This pull request introduces several improvements and fixes related to configuration, environment variable management, and deployment health checks for the Shopware operator. The most significant changes include the addition of a configurable lock store, improved handling of environment variables for PHP opcache and database connections, and more robust health probes for the storefront deployment.
Lock Store Configuration:
LockSpectoStoreSpec, allowing configuration of Symfony's lock store with support for bothbuiltin(per-pod flock) andredis(shared across pods) adapters. This ensures safe locking in multi-replica setups and sets theLOCK_DSNenvironment variable when needed. (api/v1/store.go,api/v1/store_env.go,api/v1/zz_generated.deepcopy.go) [1] [2] [3] [4] [5] [6]Environment Variable Improvements:
api/v1/store_env.go)DATABASE_PERSISTENT_CONNECTIONto"0"for storefront/admin deployments to avoid hoarding DB connections, with workers explicitly overriding this to"1"for their long-lived processes. (api/v1/store_env.go,internal/deployment/worker.go) [1] [2]Deployment Probes and Health Checks:
/‐/fpm/pingendpoint on a dedicated admin port (8001) for startup and liveness probes, decoupling pod restarts from database issues and ensuring readiness only after opcache preloading. (internal/deployment/storefront.go) [1] [2]Merging Logic Fixes:
ContainerSpec.Mergeto appendVolumeMountsandVolumesinstead of overwriting, preserving existing configuration when merging. (api/v1/store.go)These changes enhance the robustness, safety, and performance of Shopware deployments, particularly in multi-replica and high-load scenarios.