BUG Report: Major Bug – Availability Check for every Request – Kills System
-
Problem:
in class-ep-wp-query-integration.php in the setup() Function Elasticpress checks, to see if the remote Elasticsearch instance is available with the following Code:
if ( ! ep_index_exists() ) {
return;
}This leads to several severe Bugs/Problems:
1.) Every(!!) Request will be delayed by the roundtrip to elasticsearch. In my case this is 80 Milliseconds!
But a normal Usage Cenario is, that the WP_Query Search integration will be only used for search, which might be only 2-5% of the Requests. So more than 95% Percent of the Rquests are slowed down by 80 Milliseconds. In my case this is about 20% of the processing Time of the whole page. And Every User has to wait that 20% longer for every rquest.2.) In case the System is not reachable (ok this might be seldom, but might be possible), then the HTTP Timeout of 5 Seconds will apply. This will stall the whole pageload.
Solution:
1.) This should be documented very prominently. This is something so fundamentally that can kill your whole system and userexperience.2.) Short Workaround: There should be hooks to implement your own Strategy wehen (and how) to check the remote System
3.) Longtermgoal: The Checking should be done in the search() function itself for the first Request (in a pagerequest) and then the status be cached (for the rest of the page processing). So this very costly check will only apply for those requests that actually will use Elasticsearch (not for the 95% that will not use Elasticpress).
Or even much better(!!) Do Not do any Inexchecks. Simply query (in search()) the remote system. If the request Fails, than fallback to the default Qurey. This avaids the check completely!
Thanks
- The topic ‘BUG Report: Major Bug – Availability Check for every Request – Kills System’ is closed to new replies.