Home > Net >  Webapi request data is a bit slow
Webapi request data is a bit slow

Time:11-13

First of all to explain, I release platform is IIS
1. The client deployment in the place of A
2. The webapi and database deployment in the place of B
3. The client sends a data request httpClient. GetAsync (Ⅰ), then the webapi to query the database to get the data (Ⅱ), return the data to the client (Ⅲ),
4. I tracked down the data and found a few things
4.1. The request to obtain the data about 5000 tones about
4.2. Ⅰ - & gt; Ⅱ probably takes 0.2 s to 0.3 s
4.3. Ⅲ this step to get to the data to the client takes 2.8 s, this may be a long time
4.3 excuse me: why I spend such a long time? Is there any way to shorten the time, otherwise the client waiting time for a little longer,

CodePudding user response:

Bosses can help me to answer? Said the optimization idea is also ok

CodePudding user response:

Too much data, and there is no compression, download more time-consuming,

CodePudding user response:

First look at the database query cost much time

CodePudding user response:

And # 2 building friends almost reaction,
What you said is a single data returned 5000??????? If so, the single return data itself has too much, if you this article 5000 data structure is more complex, and even one-time rendering in the end... You try return only 1000100, look at the whole process of response time,
Didn't optimized for the same process, the query of the premise, if can reduce the amount of data has improved significantly, it is proved from the side may query problem, unless you are article 1000 and article 100 should be for a long time, then you should consider to check your query,

Have time to do taobao third-party service development, officially launched, forget to turn off the comment out the page number and size, the next day to make a goal, there is a seller data is too large, the front basic close to the crash... Behind the query under his baby data, nearly 10000... So, generally webapi single data returned by the list is not too big, after all, transmission is also need time cost
  • Related