> For the complete documentation index, see [llms.txt](https://www.socketio4j.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.socketio4j.org/performance/readme.md).

# Performance

Customer feedback in **2012**:\
CentOS, 1 CPU, 4GB RAM runned on VM: CPU 10%, Memory 15%\
6000 xhr-long polling sessions or 15000 websockets sessions\
4000 messages per second

Customer feedback in **2014**:\
"To stress test the solution we run 30 000 simultaneous websocket clients and managed to peak at total of about 140 000 messages per second with less than 1 second average delay." (c) Viktor Endersz - Kambi Sports Solutions

Reference : <https://github.com/mrniko/netty-socketio>

### Performance Characteristics <a href="#performance-characteristics" id="performance-characteristics"></a>

#### Scalability <a href="#scalability" id="scalability"></a>

* Supports thousands of concurrent connections
* Efficient memory usage with connection pooling
* Lock-free and thread-safe implementation

#### Throughput <a href="#throughput" id="throughput"></a>

* High message throughput (140,000+ messages/second)
* Low latency message delivery
* Efficient binary and text message handling

#### Resource Efficiency <a href="#resource-efficiency" id="resource-efficiency"></a>

* Low CPU usage under load
* Efficient memory management
* Minimal garbage collection pressure

#### Running Performance Tests <a href="#running-performance-tests" id="running-performance-tests"></a>

```
cd netty-socketio-smoke-test
mvn test
```

### Optimisation Tips <a href="#optimization-tips" id="optimization-tips"></a>

1. **Use WebSocket Transport**: WebSocket is more efficient than polling
2. **Configure Worker Threads**: Adjust worker thread count based on your CPU cores
3. **Use Distributed Stores**: For multi-node deployments, use Redisson or Hazelcast
4. **Tune Buffer Sizes**: Configure write buffer watermarks appropriately
5. **Monitor Resource Usage**: Keep an eye on CPU and memory usage


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://www.socketio4j.org/performance/readme.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
