Long duration of close(socket) and signal problem

Wu Yongwei adah@netstd.com
Mon Mar 4 22:33:00 GMT 2002


To compare the network performance of Cygwin and native WinSock, I wrote the
attached code.

Under the three compiler (MinGW 1.1 GCC 2.95, Cygwin GCC 2.95, GCC 2.96 of
Red Hat 7.1) I used, I typed only "gcc -Wall fakeweb.c -o fakeweb" to build.
Then I used a Web stress tool to send HTTP GET requests repeatedly (like
ApacheBench, try "ab -n 100 -c 1 x.x.x.x/" on a Linux box).

To my great surprise, the close(socket) operation took EXTREMELY long. It
took 0.11 second (CPU usage was low), while this operation under MinGW 1.1
on the same machine took only 0.00019 second. On another Linux machine,
close took 0.000043 second.

Another problem concerns signal handling. This program could be stopped by
CTRL-C under MinGW and Linux, but it hung and used 100% of CPU under Cygwin
when CTRL-C was hit.

Any help?

Best regards,

Wu Yongwei

P.S. On a last test, one strange thing happened. If I reload 127.0.0.1 in a
local browser quickly while running fakeweb, the displayed close time is
much smaller. It does not work on a remote browser. Just wrote it here and
does not expect an explanation for this point.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fakeweb.c
Type: application/octet-stream
Size: 4689 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20020304/a9991bcd/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pctimer.h
Type: application/octet-stream
Size: 978 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20020304/a9991bcd/attachment-0001.obj>
-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list