This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Long duration of close(socket) and signal problem


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.

Attachment: fakeweb.c
Description: Binary data

Attachment: pctimer.h
Description: Binary data

--
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/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]