I have a TCP/IP (UDP) app which is expected to be able to scale under heavy load spikes. (normal load is 100-500 tps, but spikes can reach 50-80 ktps or more) Currently I have a master thread which spawns off a thread pool to handle the UDP requests. What I need to be able to do is to monitor the load, so I can determine if more threads are needed in the pool. I was looking for a way to determine how many requests are pending in the UDP socket queue, but all I can find is an ioctl that will tell me how big the next packet is, which is useless to me.
Is there a way to tell how many packets are in the socket queue? Or does someone know of another way to determine if spawning more threads would improve throughput under a load spike?