MVC网站-ServerGotRequest ServerBeginResponse [英] MVC Website - ServerGotRequest ServerBeginResponse

查看:408
本文介绍了MVC网站-ServerGotRequest ServerBeginResponse的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

曾经在MVC 5,框架4.6.1中建立网站.但是加载速度有问题.

Been building a website in MVC 5, Framework 4.6.1. but I'm having a problem with the loading speeds.

运行提琴手(从未使用过)之后,我发现延迟在ServerGotRequest和ServerBeginResponse之间,并且它在本地主机中运行.

After running fiddler (never used it), i found the delay is between ServerGotRequest and ServerBeginResponse, and this is running in localhost.

请求数:1

Request Count: 1

发送的字节数:545(标头:545;正文:0)

Bytes Sent: 545 (headers:545; body:0)

接收的字节数:6,263(标头:428;正文:5,835)

Bytes Received: 6,263 (headers:428; body:5,835)

实际表现 -------------- ClientConnected:16:24:37.533

ACTUAL PERFORMANCE -------------- ClientConnected: 16:24:37.533

ClientBeginRequest:16:24:37.533

ClientBeginRequest: 16:24:37.533

GotRequestHeaders:16:24:37.533

GotRequestHeaders: 16:24:37.533

ClientDoneRequest:16:24:37.533

ClientDoneRequest: 16:24:37.533

确定网关:0ms

DNS查找:0毫秒

TCP/IP连接:0毫秒

TCP/IP Connect: 0ms

HTTPS握手:0毫秒

HTTPS Handshake: 0ms

ServerConnected:16:24:37.535

ServerConnected: 16:24:37.535

FiddlerBeginRequest:16:24:37.535

FiddlerBeginRequest: 16:24:37.535

ServerGotRequest:16:24:37.535

ServerGotRequest: 16:24:37.535

ServerBeginResponse:16:25:50.469

ServerBeginResponse: 16:25:50.469

GotResponseHeaders:16:25:50.469

GotResponseHeaders: 16:25:50.469

ServerDoneResponse:16:25:50.469

ServerDoneResponse: 16:25:50.469

ClientBeginResponse:16:25:50.469

ClientBeginResponse: 16:25:50.469

ClientDoneResponse:16:25:50.470

ClientDoneResponse: 16:25:50.470

总经过时间:0:01:12.937

Overall Elapsed: 0:01:12.937

响应字节(按内容类型) -------------- text/html:5,835〜headers〜:428

RESPONSE BYTES (by Content-Type) -------------- text/html: 5,835 ~headers~: 428

我不知道为什么会这样:|这是在调试"和发布"模式下发生的.

I'm at a loss as to why this is happening :| this happens in Debug and in Release mode.

关于在哪里寻找原因的任何建议?

Any suggestion on where to look for the cause?

推荐答案

这是一个相当大的性能问题.

This is quite a performance issue.

ServerGotRequest告诉您已收到从客户端到服务器的请求,服务器将开始处理您的请求.

ServerGotRequest is telling you that the request from the client to the server has been received and the server is going to start processing your request.

ServerBeginResponse告诉您服务器已经在处理您的请求,现在已经完成,并开始将响应流发送回客户端.

ServerBeginResponse is telling you that the server has been processing your request and is now finished and is beginning to send the response stream back to the client.

在这之间发生的事情是任何人的猜测,由于您没有包括代码或应用程序试图做的解释,因此您不会从这个小组的工作中得到很好的答案.

What is happening in between is anybody's guess and you won't get a good answer from the group on this one since you haven't included code or even an explanation as what your application is trying to do.

您可以使用一些工具来缩小范围.

There are some tools you can use to try to narrow it down.

您可以启用跟踪: https://msdn.microsoft.com/en -us/library/0x5wc973.aspx 您可以实现瞥见: https://www.nuget.org/packages/glimpse

You can enable tracing: https://msdn.microsoft.com/en-us/library/0x5wc973.aspx You can implement glimpse: https://www.nuget.org/packages/glimpse

或者,如果您使用的是MVC(我想是的),那么只需注释掉操作中的所有内容,看看会对性能产生什么影响,然后一次取消注释一行或两行代码,直到找到违规者为止.

Or if you're using MVC (I assume you are) then simply comment out everything in your action and see what that does to performance then uncomment your code one or two lines at a time until you find the offender.

我猜你会发现一个缓慢的数据库存储过程,一个循环内对数据库的调用,多个嵌套循环或以上三个中的任何一个的组合.

I'm guessing you discover a slow DB stored proc, calls to the database inside of a loop, multiple nested loops, or a combination of any of the three above.

祝你好运!

这篇关于MVC网站-ServerGotRequest ServerBeginResponse的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆