限制 ASP.NET 4.5 中 WebSocket 的性能因素? [英] Limiting performance factors of WebSocket in ASP.NET 4.5?

查看:17
本文介绍了限制 ASP.NET 4.5 中 WebSocket 的性能因素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

MSDN 文档似乎没有很好地涵盖 ASP.net 4.5 对 HTML5 的支持WebSockets 协议

这就是我要找的:

  • 一个服务器/应用程序/CPU 可以支持多少个实时连接?
  • 是否有可以设置/获取的最大传入连接数?
  • 无论通过套接字传输的数据如何,每个应用程序的最佳套接字数是多少?

更新:

来自 Flash RTMP 套接字(websocket 的替代方案)的请求可以在 Adobe 媒体服务器上进行良好配置 应用服务器.对于请求数量、理想时间、块大小……对于 ASP.net 内部应用程序或 IIS 8 配置,难道没有任何类型的配置吗?

解决方案

致任何可能感兴趣的人:

  • 可以与单个服务器建立超过 10 万个 WebSocket 连接运行 ASP.NET 4.5
  • WebSocket 连接由 HTTP 发起握手,因此一些 IIS 限制适用于HTTP 请求也适用于 WebSockets.IIS配置中的appConcurrentRequestLimit可用于设置每个应用的最大并发请求数:

    <块引用>

  • 可以使用 ApplicationPool 的 maxConcurrentRequestsPerCPU 属性:

    <块引用>

    <applicationPool maxConcurrentRequestsPerCPU="20000"/></system.web>

  • 当连接总数超过maxConcurrentRequestsPerCPU 设置,ASP.NET 将开始使用队列限制请求.要控制队列的大小,您可以调整 machine.config requestQueueLimit:

    <块引用>

  • 以下性能计数器应考虑进行并发测试并调整最佳设置上面有详细说明:

    • NET CLR Memory #bytes in all Heaps
    • ASP.NETRequests Current - Queued - Rejected
    • 处理器信息处理器时间
    • 已建立 TCP/IP 连接
    • Web 服务当前连接数 - 最大连接数
    • .NET CLR LocksAndThreads 当前逻辑线程数 - 当前物理线程数

MSDN documentation doesn't seem to have good coverage on ASP.net 4.5 support of HTML5 WebSockets protocol!

This is what I'm looking for:

  • How many live connections can a server/application/cpu support?
  • Is there any maximum number of incoming connections that could be set/get?
  • What is the optimum number of sockets per application regardless of data transfer over the socket?

Update:

Requests from flash RTMP sockets (an alternative to websocket) could be well configured on Adobe Media Server application server. Isn't any sort of configurations for number of requests, ideal time, size of chunks, ... for ASP.net inside application or IIS 8 configuration?

解决方案

To whomever may be interested:

  • Over 100k WebSocket connections can be made to a single server running ASP.NET 4.5
  • WebSocket connections are initiated by a HTTP handshake, hence some of the IIS throttles that apply to HTTP requests will also apply to WebSockets. appConcurrentRequestLimit in the IIS Configuration can be used to set the maximum concurrent requests per application:

    <serverRuntime appConcurrentRequestLimit="250000" />
    

  • Maximum concurrent connections to an ASP.net 4 Web Application can be set with ApplicationPool's maxConcurrentRequestsPerCPU property:

    <system.web>
        <applicationPool maxConcurrentRequestsPerCPU="20000" />
    </system.web>
    

  • When the total amount of connections exceed the maxConcurrentRequestsPerCPU setting, ASP.NET will start throttling requests using a queue. To control the size of the queue, you can tweak the machine.config requestQueueLimit:

    <processModel autoConfig="false" requestQueueLimit="250000" />
    

  • The following performance counters should be considered while conducting concurrency testing and adjusting the optimum settings detailed above:

    • NET CLR Memory #bytes in all Heaps
    • ASP.NETRequests Current - Queued - Rejected
    • Processor InformationProcessor Time
    • TCP/IP Connections Established
    • Web ServiceCurrent Connections - Maximum Connections
    • .NET CLR LocksAndThreads # of current logical Threads - # of current physical Threads

这篇关于限制 ASP.NET 4.5 中 WebSocket 的性能因素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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