-
-
Notifications
You must be signed in to change notification settings - Fork 249
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
[BUG] very slow response when allowedSites = __all #3292
Comments
@netcoop Thanks for reporting and nice explanation. Targets:
|
I'll prepare a pull request |
I tried to fix the tests, but 1 of the integration tests actually showed that my fix produces a slightly different result than the original code: mine returns all domains, the original code only those with solr enabled. Or are there even more constraints that I'm not aware of? Anyway, a solution could be one of 3 options:
Suggestions for a preferred solution or other ideas that can help solve this? |
Describe the bug
Using the setting
search.query.allowedSites = __all
in a multi-site setup with many sites makes the search response and the auto-suggest very, very slow. I have 1 TYPO3 with 33 sites, and response times are between 5 and 15 seconds when using '__all'. If I set the value to all 33 domains, the response time < 1s.I have debugged the issue and found that generating the list of domains is what takes up way too much time, I measured 5 to 12 seconds for these 33 sites. Additional problem is that this is done for every request, including every AJAX request for the auto-suggest feature.
Looking into the code (SiteHashService, SiteRepository), I found that an enormous amount of work is done of which in the end only the list of domains is used. What is even worse is that the result gets cached, but in a runtime cache which is empty at the next request, and because this method is only called once for each request, this caching only generates more overhead.
The core SiteFinder class can produce the same list of domains in less than 1 ms. Unless I missed something crucial that's being done in the complex current process I would propose to replace the method in SiteHashService (and further clean up that class):
To Reproduce
Steps to reproduce the behavior:
plugin.tx_solr.search.query.allowedSites = __all
You'll find a remarkable speed improvement with step 4.
Expected behavior
Using '__all' should not slow down the search or auto-suggest.
Used versions (please complete the following information):
Possibly related to:
#2655
The text was updated successfully, but these errors were encountered: