One thread per client seems overkill to me for 250 clients. That's 250 threads which need to be scheduled! They might even get scheduled if they have nothing to do if they're not suspended or waiting for a resource in a way the OS will understand. Remember that your network wires also just transmit one packet at a time, maybe a handful if you have more wires. How many cores do you have?tatanas wrote: Wed Dec 20, 2023 3:48 pmThis is exactly what I do. Each time a client is connecting, I create a thread. This thread will handle all data and disconnection event.
The library -lrt (librt) sounds like real time stuff. What's the nice value of your process? Is your user in the correct group?