I have created a Proxy using Java's Undertow library, which redirects users websocket connections to different ports in the same computer.
The problem is that with only 200 or 300 WebSockets connections the program starts to use a huge amount of CPU.
I've attached JProfiler to the application, and all the threads are either in waiting or network IO state.
The proxy server is started in the following way:
I'm thinking that it may be a problem of configuration, because I don't think such a CPU usage is normal.
The colors in the threads image: yellow is waiting, light blue is net io, green is running