RE: [UDT] UDT Resource Usage (again) + Bug in socket creation
Brought to you by:
lilyco
From: Chen X. <xd...@es...> - 2006-03-14 10:30:50
|
Hi Yunhong, Forgot to mention that the high CPU usage problem was observed for rendezvous connection and both sides were on the same machine. I hence created a standalone rendezvous connection test program as attached. I tried it with UDT 3.0 with observations below. Hasn't had time to try with UDT 2.3 yet. Usage: peer self_ip self_port peer_ip peer_port For example: Start peer A as "peer localhost 10000 localhost 20000". Start peer B as "peer localhost 20000 localhost 10000". Type some text at one peer and each line is supposed to appear at the other peer. Type an empty line to exit the program. In peer.cpp two compilation switches are defined: MODE: 0 means using SOCK_DGRAM and message IO (sendmsg/recvmsg); 1 means using SOCK_STREAM and regular IO (send/recv without handle); 2 means using SOCK_STREAM and overlapped IO (send/recv with handle given). MSGSIZE: 0 means using default UDT_MSS. 1 means using customized UDT_MSS as in original appclient test program. Observations: For MODE 0 & 1 (message IO & regular IO): - Sending peer occupies high CPU (more than 90%) for several seconds before the text appears at the other peer, - and it continuously occupies CPU for more seconds. - Sometimes it occupies even longer until the socket is broken. For MODE 2 (overlapped IO): - Sending peer occupies CPU in the same pattern, - but more seriously the text does never appear at the other peer. For all MODE: - Setting UDT_MSS or not leads to the same behavior. - Compiling in Debug or Release leads to the same behavior. Also found another issue: The sendmsg API is defined with "char *" parameter. "const char *" should be more appropriate. Thanks. Regards, Xudong -----Original Message----- From: Yunhong Gu [mailto:yu...@la...] Sent: Tuesday, March 14, 2006 1:45 PM To: Chen Xudong Cc: udt...@li... Subject: Re: [UDT] UDT Resource Usage (again) + Bug in socket creation Hi, Xudong, Thanks for the information, especially the silly bug in 3.0. I have updated the CVS. As to the first problem, I just couldn't reproduce it on my machine (windows XP pro, dual xeon, VS 2003). I attached the source code I am using on my machine in this email, can you give them a try and let me know if the problem is still there. Please use release version when you compile them. Please let me know the throughput, CPU percentage and CPU type. Thanks, Yunhong On Tue, 14 Mar 2006, Chen Xudong wrote: > Hi, > > > > I also observed high CPU usage at the sending side. This occurred for both > UDT 2.3 and UDT 3.0 on Windows and it happened every time. I had tried to > step into UDT 3.0 while it was busy and found out the code was iterating > inside the while loop in CUDT::sndHandler. Following shows the important > lines in core.cpp that execution looped around. > > 0972: while (!self->m_bClosing) > > 1047: if (0 == (payload = > self->m_pSndBuffer->readData(&(datapkt.m_pcData), self->m_iPayloadSize, > datapkt.m_iMsgNo))) > > 1050: if (0 == self->m_pSndBuffer->getCurrBufSize()) > > 1072: self->m_ullTimeDiff = 0; > > 1075: continue; > > I compiled the UDT library using NO_BUSY_WAITING but without CUSTOM_CC. > > > > BTW, there is a bug in your UDT 3.0 code in CUDTUnited::newSocket in > api.cpp. > > 0155: if ((type != SOCK_STREAM) || (type != SOCK_DGRAM)) > > 0156: throw CUDTException(5, 3, 0); > > "||" should be changed to "&&". This bug causes all programs to fail because > a socket can never be created. > > > > Thanks & Regards, > > Xudong > > |