Santa

Let’s Talk

We would love to hear from you. Want to know more about
our services or have any questions? Say Hi!

How IQueryable and Take Can Kill Your Sitecore Solution?

October 04, 2023
How IQueryable and Take Can Kill Your Sitecore Solution?
Juanita Xavier
Juanita Xavier
Project Manager
how-iqueryable-and-take-can-kill-your-sitecore-solution

We had a solution that had severe performance issues when it got a lot of visitors. Sitecore was casting the following exception and Solr had similar errors in its logs:

how-iqueryable-and-take-can-kill-your-sitecore-solution-1

“Unable to read data from the transport connection: The connection was closed”

We recognized that the problem was caused by hitting the network bandwidth in the Azure!

Yes, there were a lot of visitors, true but enough were there to hit the bandwidth limit. The customer upgraded the plan to get more network bandwidth, but still the issues continued to arise.

But what is the issue that stops them from getting the result?

Once the review started of the Solr implementation, the issue was found very quickly.

how-iqueryable-and-take-can-kill-your-sitecore-solution-2

The Take() was made after GetResults() was called, so the entire data set was returned to Sitecore from Solr, and then the take was applied to get the top 5 results.

This simple mistake caused all the network and performance issues.

Solution:
how-iqueryable-and-take-can-kill-your-sitecore-solution-3

It was a simple fix to move the Take before GetResults so instead of the entire data set, Solr returned only the top 5 results to Sitecore and the processing time is reduced.

This is why I believe that you should always Introduce a (Solr) Sitecore Search Abstraction.


YOU MAY ALSO LIKE