-
-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warning from filesystem driver: mkdir(): File exists in /data/www/wrbm/corporate/prod/vendor/tedivm/stash/src/Stash/Driver/FileSystem.php on line 234 #372
Comments
PS: might relate to #302 |
I have an idea on how to solve this (which will, unfortunately, only work on windows). However, when people start seeing this it's generally a sign that their traffic has increased to the point where they'd benefit from running the sqlite driver instead of the filesystem one. |
I still see this problem at line 221 - https://github.com/tedious/Stash/blob/main/src/Stash/Driver/FileSystem.php#L221C13-L221C76
In our case, we seem to have amassed a ~30GB stash cache over 24 hours using the filesystem driver ( 'find' says this is about 1.8m files ). I'm curious how running the purge/cleanup routine on the cache will work with PHP's stat cache when there are multiple processes involved. I'd normally have littered similar code with @tedivm you mentioned using Sqlite for high traffic instances; I seem to think sqlite often has a single process lock, so calling purge() might cause callers to be blocked? I suspect I'll move back to using a Redis backend anyway. |
If you're at the point where you've got 30gb in 24 hours I would use redis. |
Yes - we are/were using Redis - but we hadn't changed the default eviction policy and a busy period led us to filling up the redis cache ... so as a hot fix I moved one thing to use a filesystem cache (hence seeing the above mkdir thing!) I was just wondering if having a table a bit like this to help people choose cache backends (my pros/cons are likely to be incorrect)
|
This is probably related to a race, where 2 processes might be trying to create the same directory at the same time.
My suggestion: if the mkdir call fails, check again if the dir exists and, if it does, use it
The text was updated successfully, but these errors were encountered: