question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Performance issue with large request

See original GitHub issue

NEST/Elasticsearch.Net version: 7.1.0. i also try 7.10.1 Elasticsearch version: 7.1.1 Description of the problem including expected versus actual behavior: A clear and concise description of what the bug is. We have built one API with .net and NEST. We had some issues with performance. So I have added timers that I log to check what is taking most of the time when we do a search Steps to reproduce:

private readonly ElasticClient elasticSearchClient;
        public ElasticSearchService(IHttpClientFactory httpClientFactory)
        {
            var settings = new ConnectionSettings(new Uri(appSettings.ElasticSearch.Host)).DefaultIndex(appSettings.ElasticSearch.PlaceIndexName);
            elasticSearchClient = new ElasticClient(settings);
        }
        private async Task<IList<Place>> SearchTextSuggestElasticAsync()
        {
            var time1 = DateTime.Now;
            ISearchResponse<Place> searchResponse = // some query;
            var requestTime = (DateTime.Now - time1).TotalMilliseconds;
            if ((requestTime - searchResponse.Took) > 300)
            {
                log.Warn($"the difference : {(requestTime - searchResponse.Took)} End request in {requestTime} took: {searchResponse.Took}");

            }
            var data = searchResponse.Documents.ToList();
            return data;
        }

It’s fine with a single request, but when I make about 100 request/s, requestTime with much larger than took from ElasticSearch I try to use HttpClient factory to do same number of request, it does not happen. So it does not network issue In above code, a lot of log was written the difference : 364.1491 End request in 529.1491 took :165 the difference : 351.0123 End request in 531.0123 took :180 the difference : 605.7492 End request in 747.7492 took :142 the difference : 587.7566 End request in 776.7566 took :189 the difference : 389.3551 End request in 492.3551 took :103 Expected behavior

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:37 (20 by maintainers)

github_iconTop GitHub Comments

1reaction
trongvodangcommented, Jan 25, 2021

Thanks, i will give it a try when i comeback to company

Vào Th 2, 25 thg 1, 2021 lúc 19:50 Steve Gordon notifications@github.com đã viết:

@trongvodang https://github.com/trongvodang It’s linked in my previous comment - https://github.com/stevejgordon/ElasticsearchClientPerfTesting

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/elastic/elasticsearch-net/issues/5283#issuecomment-766793721, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIN2CVCRC4LEMNWIYQL3JVDS3VSITANCNFSM4WMTB36Q .

0reactions
stevejgordoncommented, Feb 5, 2021

@trongvodang Those counters look as I’d expect, no unusually high volume of connections. Thanks for running that. Please kill that cloud instance as I wouldn’t want those credentials to be misused. As part of our ongoing work for the next major release we will be focusing on performance and doing lots of profiling.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTTP Request performance for large volumes of requests
I suspect it's not a case of making the connection, but making the request - in other words, the time is spent in...
Read more >
Performance issues with large requests - DigDes/SoapCore
When request sizes increase to 1.5MB or more performance decreases dramatically. A 1.5MB request is taking around 700ms to respond and during ...
Read more >
Improve performance for HTTP Request with huge body
So, I should perform all the requests and update in the DB as a transaction, but.. We have 100 different request. The problem...
Read more >
Analysis of HTTP Performance Problems
This paper is the first in a series on performance issues in the World Wide Web. ... Latency problems are caused by opening...
Read more >
Performance issues when you call web services - ASP.NET
This article provides help to solve the performance issues that occur when you make calls to web services from an ASP.NET application.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found