We have just upgraded from 1.7 to 5.4.1 and since the upgrade, we are seeing quite a big performance hit on some pages. I've been trying to diagnose the issue but I am coming up short currently and would like some help to point me in the right direction.
The difference doesn't seem to be in the query execution itself. The "took" field in 5 is showing more or less the same small numbers as it was prior to the upgrade. However, the slowness happens during the call to the client somewhere. This is what I am referring to:
var client = GetClient();
var start = DateTime.Now;
var searchResponse = client.Search<TSearchDto>(c => c.SearchType(SearchType.QueryThenFetch).Size(0).Index(GetIndexName()).Query(q => query));
var timer = (DateTime.Now - start).Milliseconds;
I've even stripped the query back to a really basic term query on an int field:
Query<SearchDto>.Term(t => t.PortalId, 1);
What I see when I inspect that is 1ms on the took field of the search response but about 40ms on the timer. Doing the same thing on the code prior to the upgrade gives me 1ms for the elapsed time on the query and 2ms on the timer. That's a pretty huge difference.
I cannot tell where that extra time is coming from. Both old and new instances are running side by side on my local machine so there should not be any difference in the connection time and is is a count query so I wouldn't have though loading out the data would be an issue here either.
Any help at all would be greatly appreciated, even if it is just to point me in the right direction.