Skip to content

Commit ef33fac

Browse files
authored
Merge pull request #2078 from shopware/add-session-deadlocks-guide
add session deadlocks workaround guide
2 parents 30ddb56 + f9360a9 commit ef33fac

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

resources/guidelines/troubleshooting/performance.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,24 @@ Also consider changing the `indexing-behavior` to your needs if you need to sync
3838
Another reason for high memory usage might be the logging within the application.
3939
See the logging section in the [performance guide](../../../guides/hosting/performance/performance-tweaks#logging) for more information.
4040
After all, you still can make use of tools like blackfire.io to find the root cause of the memory usage.
41+
42+
### Session Deadlocks with file-based sessions
43+
44+
If you experience request timeouts or hanging requests in environments using file-based sessions (common in shared hosting), you might be encountering a session deadlock. This occurs when two concurrent processes create a circular lock dependency: one process holds the session file lock while trying to acquire the cache lock, another holds the cache lock while trying to acquire the session lock.
45+
46+
Symptoms include:
47+
48+
* Requests randomly timing out under load
49+
* PHP processes stuck in "waiting" state
50+
* Issues appearing only under concurrent requests
51+
52+
The recommended solution is to [use Redis for sessions](../../../guides/hosting/performance/session), which eliminates the file-based locking conflict.
53+
If Redis is not available in your environment, you can work around the issue by disabling cache stampede protection (option available since Shopware 6.7.7.0).
54+
55+
```yaml
56+
shopware:
57+
cache:
58+
disable_stampede_protection: true
59+
```
60+
61+
This option only takes effect when file-based sessions are detected. Be aware that disabling stampede protection may increase backend load when multiple requests simultaneously try to regenerate the same expired cache entry. For most shops, this trade-off is acceptable compared to deadlock issues.

0 commit comments

Comments
 (0)