信号检测与估计-理论与应用_信号R-实时应用

本文介绍了实时(RT)应用程序的概念及其性能指标,重点关注使用SignalR进行实时Web应用开发。SignalR提供了服务器即时向客户端推送内容的能力,支持CORS和多种传输类型。文章还讨论了SignalR的性能监控、扩展性和状态管理,以及针对实时要求的设计参数,如专业化、优化和分布。同时,文章分析了扩展缓存存储、背板服务器的角色和不同背板选项,如Azure ServiceBus、SQL Server和Redis,以及在云环境中如AWS的支持情况。
摘要由CSDN通过智能技术生成

信号检测与估计-理论与应用

实时(RT)应用 (Real Time (RT) Application)

A Real-time application gives information instantly and constantly. The efficiency of the application depends mostly on how it is fault tolerant to missed timing requirements. In real-time application, required response times are achieved with a combination of custom hardware and software, possibly with no

实时应用程序可即时不断地提供信息。 应用程序的效率主要取决于它对错过的时序要求的容错能力。 在实时应用中,所需的响应时间是通过结合定制硬件和软件来实现的,可能没有

- or a very thin-operating-system layer. As they function constantly, they need to be closely analyzed for performance metrics.Some of the real-time applications are listed below

-或非常薄的操作系统层。 由于它们不断运行,因此需要对其性能指标进行仔细分析。下面列出了一些实时应用程序

  • Video conference applications

    视频会议应用
  • VoIP(voice over Internet Protocol)

    VoIP(互联网协议语音)
  • Online gaming

    线上游戏
  • Community storage solutions

    社区存储解决方案
  • Some e-commerce transactions

    一些电子商务交易
  • Chatting

    闲聊
  • IM (instant messaging)

    IM(即时消息)
  • Current active visitors,Currently logged-in users

    当前活跃访客,当前登录用户
  • When friend comes online or goes offline

    当朋友上线或下线时
  • When someone likes or comments on status

    当某人喜欢或评论状态时
  • Send notification on event to subscribed users

    向订阅的用户发送事件通知
  • How many people are actively playing a particular game, watching online webinar/event, etc

    有多少人正在积极玩特定的游戏,观看在线网络研讨会/活动等
  • Total transactions, purchases, impressions, messages, clicks till day and so on

    总交易,购买,印象,消息,直到一天的点击等

软与硬
SvsH-RT.jpg
(Soft vs Hard )

使用Signal R进行实时Web应用程序开发 (Real-time web application development with Signal R)

什么是信号R (What is Signal R)

信号用于通讯(

e.g. analog and digital). R stands for real-time.

例如模拟和数字)。 R代表实时。

Real-time web refers the ability to have server code push content to the connected clients instantly. Signal R in short refers to Real-time application communication

实时Web是指使服务器代码立即将内容推送到连接的客户端的功能。 信号R简而言之是指实时应用程序通信

它能做什么? (What it does?)

  • Over HTTP connection, push content from Server to client RPC.

    通过HTTP连接,将内容从服务器推送到客户端RPC。
  • It is a connection abstraction. Gives impression of working on a permanently open persistent connection. It is NOT reliable messaging. 

    这是一个连接抽象。 给人以处理永久打开的持久连接的印象。 这不是可靠的消息传递。
  • It sends each message through the message-bus.

    它通过消息总线发送每个消息。
  • It supports CORS 

    - Cross-origin-resource-sharing or JSONP- JSON with padding (communication technique used in JavaScript programs running in web browsers to request data from a server in a different domain)

    它支持CORS

    -跨源资源沙 环或JSONP-带填充的JSON(在网络浏览器中运行JavaScript程序中使用的通信技术,用于从其他域中的服务器请求数据)

如何测量和监控 (How it is measured and monitored)

  • Performance counters gives the number of events since the last application pool or server restart.

    性能计数器提供自上次应用程序池或服务器重新启动以来的事件数。
  • Connection metrics, Message metrics, Message bus metrics, Error metrics, Scaleout metrics 

    连接指标,消息指标,消息总线指标,错误指标,横向扩展指标

SignalR Overview

SignalR概述

Pattern Used:  

使用的图案:

SignalR-HubandSpoke.jpgIt is designed in Hub and Spoke pattern. SignalR in Central, with all other browsers being changeable and flexible and contextual to it

Structure:

结构体:

SignalR-CrossStructure.jpgIt is categorized into major four areas as presented below.
  • Hub

    枢纽
  • Persistent Connection

    持续连接
  • Transport types

    运输类型
  • Browser

    浏览器

SingulaR files are listed hereSignalR - A meta package that brings in SignalR.Server and SignalR.Js

SingulaR文件在此处列出 。SignalR-引入SignalR.Server和SignalR.Js的元软件包

SignalR.Server - Server side components needed to build SignalR endpoints

SignalR.Server-构建SignalR端点所需的服务器端组件

SignalR.Js - Javascript client for SignalR

SignalR.Js-SignalR的Javascript客户端

SignalR.Client - .NET client for SignalR

SignalR.Client-SignalR的.NET客户端

SignalR.Ninject - Ninject dependency resolver for SignalR

SignalR.Ninject-SignalR的Ninject依赖解析器

Transport Flow of SignalR

SignalR的传输流程

Transport.jpg

Problem Statement: Design Parameters to meet real-time requirements 

问题陈述:满足实时要求的设计参数

Performance can creep into real-time application as it scales up and also ASP.NET, Signal-R thread and memory limitations have the mutual short-term nature of Web requests

随着规模的扩大,性能可能会渗透到实时应用程序中,而且ASP.NET,Signal-R线程和内存限制具有Web请求的相互短期性质。

Few set of tunable parameters :

少数可调参数集:

SignalR-Features.jpg

Scaling

缩放比例

Three main factors of scaling are specialization, optimization, and distribution

扩展的三个主要因素是专业化,优化和分配

  • Specialization – Compartmentalization of application into smaller pieces in order to isolate the problem. MVC takes care of the same by splitting controller, Model, View and also image servers, streaming server can be split

    专业化–将应用程序划分为多个较小的部分,以隔离问题。 MVC通过拆分控制器,模型,视图以及图像服务器来实现相同的功能,可以拆分流服务器
  • Optimization - Provides components for distribution by reducing the amount of work needed for a given operation. This translates directly into fewer servers needed to scale to the same number of users.

    优化-通过减少给定操作所需的工作量来提供分发组件。 这可以直接转换为更少的服务器以扩展到相同数量的用户。
  • Clustering - Each server in the cluster sends out a information to let the other servers know it is alive. challenge of effective clustering lies in eliminating affinity/ stickiness

    群集-群集中的每台服务器都会发送信息,以使其他服务器知道该服务器处于活动状态。 有效聚类的挑战在于消除亲和力/粘性

State

State property of the hub’s proxy and caller property in hub is used for maintaining the state. State can be maintained through multiple connections and method calls to a database. Sticky Session isn’t supported as it is limitation to distribute.

集线器的代理服务器的State属性和集线器中的调用者属性用于维护状态。 可以通过对数据库的多个连接和方法调用来维护状态。 不支持粘性会话,因为它限制了分发。

Cache 

快取

Persistent memory objects, like in-process session and cache objects, memory usage becomes much more problematic while scaling. Each webserver gets the message from redis and stores it in a local cache. This local cache is where SignalR clients (browsers), are served.

持久内存对象(例如进程内会话和缓存对象)在扩展时内存使用变得更加成问题。 每个Web服务器从Redis获取消息并将其存储在本地缓存中。 该本地缓存是向SignalR客户端(浏览器)提供服务的地方。

  • Scaling Cache Storage :


    • Specialization—Partitionin

      g of the database into logical pieces. Those partitions could be datacentric.
    • Cluster :Have multiple databases, each containing a portion of the whole database.

    扩展缓存存储:


    • 专业化—分区

      将数据库g分成逻辑部分。 这些分区可能以数据为中心。
    • 集群:具有多个数据库,每个数据库都包含整个数据库的一部分。

Performance

性能

Response Time = Payload/Bandwidth + Round Trip Time(RTT) + Appturns/Concurrent Requests+Server Compute Time(Cs)+  Client Compute Time(Cc)

响应时间=有效负载/带宽+往返时间(RTT)+请求/并发请求+服务器计算时间(Cs)+客户端计算时间(Cc)

Scaling Approaches for better performance (Load balancer Vs Backplane)

扩展方法以获得更好的性能(负载均衡器与背板)

LBvsBP.jpg

Backplane Server -Overview

背板服务器-概述

  • A Backplane Server is an independent orchestrator of the message interchange between Backplane Clients and may serve multiple independent Buses.

    背板服务器是背板客户端之间消息交换的独立协调器,并且可以服务于多个独立的总线。
  • Each server instance connects to the backplane through the bus. When a message is sent, it goes to the backplane, and the backplane sends it to every server. When a server gets a message from the backplane, it puts the message in its local cache. The server then delivers messages to clients from its local cache.

    每个服务器实例都通过总线连接到背板。 发送消息后,它会到达背板,然后背板会将其发送到每个服务器。 服务器从背板获取消息时,会将消息放入其本地缓存中。 然后,服务器从其本地缓存向客户端传递消息。
  • Introduce delays in message delivery, which will not work well for low-latency work. With multiple servers to handle clients and mostly latency is minimal this might not work.

    在消息传递中引入延迟,这对于低延迟的工作将不起作用。 由于有多个服务器来处理客户端,并且延迟最小,所以这可能不起作用。
  • Trade-off here is between latency and complexity

    折衷是在延迟和复杂度之间
  • Signal R Supports 3 backplanes  Azure ServiceBus, SQL Server, Redis

    Signal R支持3个背板Azure ServiceBus,SQL Server,Redis
  • Amazon Web Services (AWS)


    • Do not support Azure ServiceBus
    • SQL Server in EC2 needs manual handling ,a counter-intuitive to running on cloud infrastructure
    • Supports Redis

    亚马逊网络服务(AWS)


    • 不支持Azure ServiceBus
    • EC2中SQL Server需要手动处理,这与在云基础架构上运行有悖常理
    • 支持Redis
  • Default MessageBus of signalR gets replaced with a bus designed for that backplane.

    signalR的默认MessageBus被替换为该背板设计的总线。

Conclusion

结论

This article would help in understanding the overview of  SignalR.

本文将有助于理解SignalR的概述。

翻译自: https://www.experts-exchange.com/articles/28730/Signal-R-A-Real-Time-Application.html

信号检测与估计-理论与应用

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值