You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-signalr/signalr-concept-messages-and-connections.md
+32-33Lines changed: 32 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,12 @@ description: An overview of key concepts about messages and connections in Azure
4
4
author: vicancy
5
5
ms.service: signalr
6
6
ms.topic: conceptual
7
-
ms.date: 08/05/2020
7
+
ms.date: 03/23/2023
8
8
ms.author: lianwei
9
9
---
10
10
# Messages and connections in Azure SignalR Service
11
11
12
-
The billing model for Azure SignalR Service is based on the number of connections and the number of messages. This article explains how messages and connections are defined and counted for billing.
12
+
The billing model for Azure SignalR Service is based on the number of connections and the number of outbound messages from the service. This article explains how messages and connections are defined and counted for billing.
13
13
14
14
15
15
## Message formats
@@ -21,61 +21,60 @@ Azure SignalR Service supports the same formats as ASP.NET Core SignalR: [JSON](
21
21
The following limits apply for Azure SignalR Service messages:
22
22
23
23
* Client messages:
24
-
* For long polling or server side events, the client cannot send messages larger than 1MB.
25
-
* There is no size limit for Websockets for service.
26
-
* App server can set a limit for client message size. Default is 32KB. For more information, see [Security considerations in ASP.NET Core SignalR](/aspnet/core/signalr/security?#buffer-management).
27
-
* For serverless, the message size is limited by upstream implementation, but under 1MB is recommended.
24
+
* For long polling or server side events, the client can't send messages larger than 1 MB.
25
+
* There's no size limit for WebSocket for service.
26
+
* App server can set a limit for client message size. Default is 32 KB. For more information, see [Security considerations in ASP.NET Core SignalR](/aspnet/core/signalr/security?#buffer-management).
27
+
* For serverless, the message size is limited by upstream implementation, but under 1 MB is recommended.
28
28
* Server messages:
29
-
* There is no limit to server message size, but under 16MB is recommended.
30
-
* App server can set a limit for client message size. Default is 32KB. For more information, see [Security considerations in ASP.NET Core SignalR](/aspnet/core/signalr/security?#buffer-management).
29
+
* There's no limit to server message size, but under 16 MB is recommended.
30
+
* App server can set a limit for client message size. Default is 32 KB. For more information, see [Security considerations in ASP.NET Core SignalR](/aspnet/core/signalr/security?#buffer-management).
31
31
* Serverless:
32
-
* Rest API: 1MB for message body, 16KB for headers.
33
-
* There is no limit for Websockets, [management SDK persistent mode](https://github.com/Azure/azure-signalr/blob/dev/docs/management-sdk-guide.md), but under 16MB is recommended.
32
+
* Rest API: 1 MB for message body, 16 KB for headers.
33
+
* There's no limit for WebSocket, [management SDK persistent mode](https://github.com/Azure/azure-signalr/blob/dev/docs/management-sdk-guide.md), but under 16 MB is recommended.
34
34
35
-
For Websockets clients, large messages are split into smaller messages that are no more than 2 KB each and transmitted separately. SDKs handle message splitting and assembling. No developer efforts are needed.
35
+
For WebSocket clients, large messages are split into smaller messages that are no more than 2 KB each and transmitted separately. SDKs handle message splitting and assembling. No developer efforts are needed.
36
36
37
37
Large messages do negatively affect messaging performance. Use smaller messages whenever possible, and test to determine the optimal message size for each use-case scenario.
38
38
39
39
## How messages are counted for billing
40
40
41
-
For billing, only outbound messagesfrom Azure SignalR Service are counted. Ping messages between clients and servers are ignored.
41
+
Messages sent into the service are inbound messages and messages sent out of the service are outbound messages. Only outbound messages from Azure SignalR Service are counted for billing. Ping messages between clients and servers are ignored.
42
42
43
43
Messages larger than 2 KB are counted as multiple messages of 2 KB each. The message count chart in the Azure portal is updated every 100 messages per hub.
44
44
45
45
For example, imagine you have one application server, and three clients:
46
46
47
-
App server broadcasts a 1-KB message to all connected clients, the message from app server to the service is considered free inbound message. Only the three messages sending from service to each of the client are billed as outbound messages.
47
+
* When the application server broadcasts a 1-KB message to all connected clients, the message from the application server to the service is considered a free inbound message.
48
48
49
-
Client A sends a 1-KB message to another client B, without going through app server. The message from client A to service is free inbound message. The message from service to client B is billed as outbound message.
49
+
* When *client A* sends a 1KB inbound message to *client B*, without going through app server, the message is a free inbound message. The message routed from service to *client B* is billed as an outbound message.
50
50
51
-
If you have three clients and one application server. One client sends a 4-KB message to let the server broadcast to all clients. The billed message count is eight: one message from the service to the application server and three messages from the service to the clients. Each message is counted as two 2-KB messages.
51
+
*If you have three clients and one application server, when one client sends a 4-KB message for the server broadcast to all clients, the billed message count is eight:
52
52
53
-
## How connections are counted
53
+
* One message from the service to the application server.
54
+
* Three messages from the service to the clients. Each message is counted as two 2-KB messages.
54
55
55
-
There are server connections and client connections with Azure SignalR Service. By default, each application server starts with five initial connections per hub, and each client has one client connection.
56
+
## How connections are counted
56
57
57
-
For example, assume that you have two application servers and you define five hubs in code. The server connection count will be 50: 2 app servers * 5 hubs * 5 connections per hub.
58
+
The Azure SignalR Service creates application server and client connections. By default, each application server starts with five initial connections per hub, and each client has one client connection.
58
59
59
-
The connection count shown in the Azure portal includes server connections, client connections, diagnostic connections, and live trace connections. The connection types are defined in the following list:
60
+
For example, assume that you have two application servers and you define five hubs in code. The server connection count is 50: (2 app servers * 5 hubs * 5 connections per hub).
60
61
61
-
-**Server connection**: Connects Azure SignalR Service and the app server.
62
-
-**Client connection**: Connects Azure SignalR Service and the client app.
63
-
-**Diagnostic connection**: A special kind of client connection that can produce a more detailed log, which might affect performance. This kind of client is designed for troubleshooting.
64
-
-**Live trace connection**: Connects to the live trace endpoint and receives live traces of Azure SignalR Service.
65
-
66
-
Note that a live trace connection isn't counted as a client connection or as a server connection.
62
+
The connection count shown in the Azure portal includes server, client, diagnostic, and live trace connections. The connection types are defined in the following list:
67
63
68
-
ASP.NET SignalR calculates server connections in a different way. It includes one default hub in addition to hubs that you define. By default, each application server needs five more initial server connections. The initial connection count for the default hub stays consistent with other hubs.
64
+
***Server connection**: Connects Azure SignalR Service and the app server.
65
+
***Client connection**: Connects Azure SignalR Service and the client app.
66
+
***Diagnostic connection**: A special type of client connection that can produce a more detailed log, which might affect performance. This kind of client is designed for troubleshooting.
67
+
***Live trace connection**: Connects to the live trace endpoint and receives live traces of Azure SignalR Service.
69
68
70
-
The service and the application server keep syncing connection status and making adjustment to server connections to get better performance and service stability. So you might see server connection number changes from time to time.
69
+
A live trace connection isn't counted as a client connection or as a server connection.
71
70
72
-
## How inbound/outbound traffic is counted
71
+
ASP.NET SignalR calculates server connections in a different way. It includes one default hub in addition to hubs that you define. By default, each application server needs five more initial server connections. The initial connection count for the default hub stays consistent with other hubs.
73
72
74
-
Message sent into the service is inbound message. Message sent out of the service is outbound message. Traffic is calculated in bytes.
73
+
The service and the application server keep syncing connection status and making adjustments to server connections to get better performance and service stability. So you may see changes in the number of server connections in your running service.
75
74
76
75
## Related resources
77
76
78
-
-[Aggregation types in Azure Monitor](../azure-monitor/essentials/metrics-supported.md#microsoftsignalrservicesignalr)
0 commit comments