Udp receives take up a lot of CPU, special card system operation
Time:10-21
Multiple clients on a server receives the public give udp data, about 20 m/s, the development language is c # and a single CPU accounted for 100%, also achieves 10% CPU system interrupt, machine operation special CARDS, but in this machine using multithreading turn udp data to another server network, network receives the server without any problem, CPU consumption up to 2%, almost no system outage, do you have experience this is what problem, thank you very much Both servers are all on the vmware virtual machine virtual, considering the load balancing, udp receives used windows2012 r2 nic, pattern is switches independent + dynamic, but only one network card in the receiving data, another card without data reception, doesn't seem to be any effect Please expert help, really appreciate
CodePudding user response:
See through the network, two machines received packets per second in 4000, about 2 m bytes per second, the only difference is that one receives the public more client data, a receiving another machine in the Intranet multi-threaded data, but udp is a connectionless, and this should never mind Is another possible public network and Intranet mtu, public need to shard on set pieces, but look at the number of bytes, estimates that a package is around 1 k, it should not impact on this
CodePudding user response:
Estimation is program structure or data processing has a problem, should first determine which threads, which part of the code lead to high CPU,
CodePudding user response:
The program itself, this traffic is something for common configuration of the machine
CodePudding user response:
The structure of the program is, a thread, received later in the queue, another starting forward several threads, tried to stop forwarding, receive only on the queue are not Program structure roughly While (listenFlg) { Byte [] buffer=udpReceiveClient. The Receive (ref ipEndPoint); The queue. The Enqueue (buffer); }
CodePudding user response:
The key is the same processing it in the Intranet server: forwarding, after received without any problem
CodePudding user response:
In C/C + + write a similar application test, and see if it is the C # library or call