-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
Uncached plugin floods sfc_staticfilecache table #233
Comments
Corresponding Core patch: And Review for fixing that: |
Okay - in fact. It is somehow connected to boost mode: StaticFileBackends flushByTags will actually never delete these entries, when in boost mode. Otherwise these would at least not aggregate over time. But this is only a side-note for reproducibility. These duplicated records should never be written imho. |
hey @MK-42 |
Thanks a bunch, enjoy the time! |
Hey Tim, What can we do here? |
Got the same problems here. TYPO3 v9.5.14 Over 100k entries in sfc_staticfilecache, over 250k entries in sfc_staticfilecache_tags and tx_staticfilecache_queue. Running the extension in boost mode. Flushing the whole cache within the deployment every 2 weeks and using the "removeExpiredPages" command every night. How can I keep the tables clean? |
Bug Report
Current Behavior
Today our production system ran into an outOfMemory condition every time an extbase validation error occured on one page (with high traffic and an uncached plugin on it).
Tracing it, the root cause is the
Typo3DatabaseBackend
fetching all identifiers from the sfc_ tables.On our system that table contains nearly 3 million entries for the executed query (which are all redundant - telling us that that page is not cacheable - which we are aware of and totally okay with).
the blobs all contain
Expected behavior/output
SFC should not flood that table with all these entries - one is totally enough.
Environment
Possible Solution
Bandaid:
adding a
->groupBy
clause to the findIdentifiersByTag of typo3DatabaseBackend fixes the symtom, as the duplicate entries will not be fetched into php memory anymore.I will be proposing a core patch for that - It's probably a good thing anyway.
Solution:
https://github.com/lochmueller/staticfilecache/blob/master/Classes/Middleware/GenerateMiddleware.php#L76
is where the entry is set. Note, that the
X-SFC-Explanation
header is set here, so nohasValidCacheEntry
checks are done.The
StaticFileBackend
also calles its parentsset
method unconditionally, which in turn writes the db row unconditionally.I don't have strong feelings where it would be appropriate to catch these duplicates, but the
Middleware
probably is the right place, as the other duplication check is also done there.Additional context
Boost Mode is active. But that shouldn't bother here I think
The text was updated successfully, but these errors were encountered: