As mentioned in the previous article, the number of requests processed by a single server is nearly 25 thousand (Microsoft's data is up to/second ]. Performance testing of IIS and ASP. NET with requests per second
Another option is UDP. Although it is not reliable, the speed is definitely good.
1. Standard UDP Performance
Use C/C #/Java on Dell 1950/Windows 2003, with a bandwidth of Mbps.
Performance: 60 bytes of data, 10 thousand/second
Use multipleProgramTo run the same result. Does windows have limits on UDP speed?
2. rawsocket + UDP
C # Write, performance up to 40 thousand/second
3. rawsocket + IP
C write, performance up to 80 thousand/second
5. c ++Code:
Some code on the internet is too poorly written. At least there should be no low-level errors. The size calculation of IP/udp headers is incorrect and harmful.
Http://www.experts-exchange.com/Programming/Languages/CPP/Q_20372735.html
1. struct udpheader * udph = (struct udpheader *) (datasync + (4*4); // 4*4 problematic, it should be 20
2. iph-> ip_len = sizeof (struct ipheader) + sizeof (struct udpheader); // htons should be added
3. checksum can be left empty
5. C # code:
String ipstring = "192.168.1.14 ";
Socket S = new socket (addressfamily. InterNetwork, sockettype. Raw, protocoltype. UDP );
IPaddress remoteip = IPaddress. parse (ipstring );
Int I = 0;
// While (true)
{
String MSG = string. Format (format, I ++, datetime. Now );
Byte [] B = encoding. ASCII. getbytes (MSG );
Byte [] newb = new byte [B. Length + 8];
B. copyto (NEWB, 8 );
Int src_prt = 6000;
Int dest_port = 1112;
Int tot_len = newb. length;
NEWB [0] = (byte) (src_prt/256 );
NEWB [1] = (byte) (src_prt % 256 );
NEWB [2] = (byte) (dest_port/256 );
NEWB [3] = (byte) (dest_port % 256 );
NEWB [4] = (byte) (tot_len/256 );
NEWB [5] = (byte) (Fig % 256 );
NEWB [6] = 0;
NEWB [7] = 0;
S. sendto (NEWB, new ipendpoint (remoteip, dest_port ));
}