Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk5 min

High Latency in SignalR with MessagePack During k6 Load Testing: How to Diagnose a 1,000-User Workload

MessagePack can shrink SignalR payloads, but it does not guarantee lower latency. Learn how to validate a k6 SignalR test and diagnose a 1,000-user workload.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

MessagePack can reduce SignalR message size, but it does not guarantee lower end-to-end latency or make a 1,000-user workload fast by itself. First confirm that the test really uses SignalR with MessagePack over the same transport in each run; then separate connection setup from invocation latency and check whether the load generator, server, network, or scale-out setup is the bottleneck.

Why MessagePack may not reduce the latency you see

ASP.NET Core SignalR supports JSON, its default hub protocol, and MessagePack. Microsoft says MessagePack generally produces smaller messages, which can reduce bytes sent over the network. That fact alone does not establish a particular improvement in invocation latency: serialization is only one part of the path between a client sending a hub call and receiving a reply.

As an Amazon Associate I earn from qualifying purchases.

The result also depends on the operation being measured, message size and rate, fan-out, connection transport, server and client resource use, network conditions, and downstream work. Treat JSON-versus-MessagePack as a controlled comparison, not as an assumed optimization. See Microsoft’s SignalR MessagePack protocol documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Confirm the test is comparing the same SignalR setup

Verify the hub protocol

The server can register MessagePack support while retaining JSON support; clients select the protocol they use. Check the client configuration and server-side behavior to verify that the test actually negotiates the intended protocol. Merely enabling MessagePack on the server does not prove that a client is sending MessagePack hub messages.

Verify the transport

SignalR can use WebSockets, Server-Sent Events, or Long Polling. Microsoft describes WebSockets as the preferred transport because it generally offers the best performance, but a connection can use another compatible transport. Record the transport used by the tested connections. If it differs between JSON and MessagePack runs, the comparison does not isolate serialization. The SignalR overview explains the protocols and transports.

Validate SignalR behavior in the k6 client

k6 documents generic WebSocket support and recommends its newer k6/websockets API for new tests. A raw WebSocket connection or echo loop is not automatically a SignalR client: it does not establish that the test performs SignalR’s handshake, hub-protocol framing, or MessagePack encoding correctly. Implement and validate that behavior in the test client, or use a client or extension that does so. Before collecting performance results, verify that the client can make the intended hub invocation and receive the expected reply.

See the k6 WebSockets guide and k6 WebSocket API documentation.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Measure invocation latency, not just WebSocket activity

k6 provides WebSocket metrics such as connection duration, sent and received message counts, ping duration, and session duration. Those describe useful parts of a WebSocket session, but they do not by themselves measure application-level SignalR invocation round-trip time.

For the latency users experience, timestamp a meaningful hub request and its corresponding reply, calculate the elapsed time, and record it as a custom k6 Trend. Report percentiles such as p50, p90, p95, and p99, along with errors and reconnects. Keep connection establishment separate from steady-state invocation measurements: a slow initial connection and a slow hub operation point to different parts of the system. See the k6 metrics reference.

Define what “1,000 users” means

A user count is not a complete workload description. One thousand simultaneously open connections, one thousand clients actively sending messages, and a larger audience with only a fraction connected at once create different resource and traffic demands. Specify which case the test models, and include message frequency and fan-out: one call to one recipient is not equivalent to one call broadcast to a large group.

Build JSON and MessagePack runs with the same application build and .NET runtime, client behavior, transport, concurrent-connection target, connection ramp, session duration, message-size distribution, message rate, group fan-out, deployment topology, and generator resources. Record message bytes, successful connections, errors and reconnects, invocation-latency percentiles, server CPU and memory, and load-generator CPU, memory, and network use. Repeat runs and report variation instead of relying on a single result.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Diagnose high latency in a useful order

  1. Confirm protocol and transport. Verify that the client is using the intended hub protocol and record whether connections use WebSockets, Server-Sent Events, or Long Polling.
  2. Prove the workload is real SignalR traffic. Validate the handshake, framing, MessagePack behavior where applicable, invocation, and reply before treating the script as a SignalR load test.
  3. Separate connection setup from steady-state work. Measure connection establishment independently from timestamped invocation-and-reply round trips.
  4. Check the generator. Monitor CPU, memory, network, open file descriptors, and dropped iterations. A saturated load generator can produce misleading latency or fail to sustain the intended connections.
  5. Inspect the server and dependencies. Check server CPU and memory, runtime and thread-pool behavior, network, and any downstream services used by the hub operation. High latency can arise after deserialization, outside the hub protocol itself.
  6. Vary message size and fan-out deliberately. Compare realistic payloads and recipient counts to find whether traffic volume or broadcast work changes the result.
  7. Review deployment and connection distribution. Check how connections are spread across servers, whether the topology requires session affinity, and whether socket capacity or memory is limiting stability.
  8. Only then compare serialization. With the preceding conditions controlled, compare JSON and MessagePack across repeated runs and inspect both the latency distribution and bytes transmitted.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Check generator and server capacity before tuning timers

Load-generator limits

Grafana notes that operating-system file-descriptor limits can prevent tests with hundreds or thousands of concurrent virtual users from opening the connections they need. Monitor the generator as carefully as the SignalR server; consider distributed generation if one machine cannot sustain the planned workload. The k6 operating-system tuning guide covers generator-side considerations.

Persistent connections and scale-out

SignalR connections persist and consume TCP connection capacity and memory. For multi-server deployments, Microsoft’s scaling guidance generally calls for session affinity, with exceptions including Azure SignalR Service and WebSockets-only clients configured to skip negotiation. Check connection distribution, affinity, any backplane or managed-service topology, socket capacity, and server memory when connection counts or stability degrade. The linked guidance is indexed for ASP.NET Core 6.0, so verify its details against the runtime and hosting platform in use: Microsoft’s hosting and scaling guidance.

Connection timeouts and keep-alives

For ASP.NET Core 10, the configuration documentation lists defaults of 15 seconds for HandshakeTimeout, 15 seconds for KeepAliveInterval, and 30 seconds for ClientTimeoutInterval. The handshake timeout concerns a client that does not send its initial handshake within the interval; it is not a general remedy for slow application messages. Microsoft recommends coordinating client and server timeout settings with keep-alive settings. Change these only to address a relevant connection-management problem, not as a substitute for measuring invocation latency. See SignalR configuration.

Ramp the load and set thresholds from your service objective

Use staged connection ramps, a steady-state period long enough to observe normal operation, realistic think time and message rates, and a controlled cool-down. This helps distinguish ramp-up effects from sustained-load behavior. Set pass/fail thresholds from the product’s service-level objective and report errors alongside latency percentiles. Threshold examples in k6 performance guidance are illustrative HTTP examples, not prescribed SignalR targets. See k6’s performance-testing guide.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What a 1,000-user result can and cannot tell you

There is no universal latency improvement, safe concurrent-connection limit, or expected capacity for 1,000 SignalR users established by the documentation cited here. A result belongs to its tested workload and environment: connection definition, message behavior, client and generator capacity, server resources, transport, and deployment topology all matter. Publish those conditions with the result so another team can judge whether it applies to its own workload.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.