Sami Farin wrote:
> hmm... little thinko slipped into the code ;)
> fix attached. ...
> Poller_sigio.cc:
> // Set this fd to emit signals.
> - if (fcntl(fd, F_GETFL, &flags) < 0) {
> + if ((flags = fcntl(fd, F_GETFL)) < 0) {
Sigh. I've been warned about that before. Very sloppy of me, thanks.
(I'm reattaching your two patches to this email for the benefit of
the list.)
> then another bug. I got this: ...
> Test over. 2499 users left standing.
>
> in reality every user was dead.
> I _think_ the patch attached fixes this, let me know if I got it all wrong.
> it can probably be written in smaller amount of code lines...
> bench.cc:
> - printf("Test over. %d users left standing.\n", nalive);
> - return 0;
> + thePlatoon.getStatus(&nconnecting, &nalive, &ndead);
> + if ((nalive == 0) && (nconnecting == 0)) {
> + printf("All users dead. Test failed.\n");
> + exit(1);
> + } else {
> + printf("Test over. %d users left standing.\n", nalive);
> + exit(0);
> + }
Hmm. I should look at that a bit more. That main loop logic
was rather hastily written. Thanks for the failure log and patch!
> BTW, I get the same performance with poll and rtsig.
> is it normal? with both poll and rtsig CPU usage is ~100%
> (checked with cyclesoak).
>
> Celeron-A 366 MHz, 256 MiB RAM, linux-2.4.20aa1, ftp server TUX.
>
> $ ./dkftpbench -h127.0.0.1 -c2450 -n2450 -t60 -uftp -fls-Rl.txt \
> -b1000000000 -B6000 -sr -v0 -m4096
> ...
> Using Linux rtsignals / F_SETSIG / O_ASYNC
> 2450 users alive, 0 users dead; at least 60 seconds to end of test
> Test over. 2450 users left standing.
> $
>
> ls-Rl.txt is 5 MB.
>
> I have done these tunings:
> net.ipv4.tcp_rmem = 16384 16384 16384
> net.ipv4.tcp_max_orphans = 4096
>
> with the default values I get at max 310 connections/sec because
> kswapd starts behaving badly or omething. ;)
>
> kernel: __alloc_pages: 1-order allocation failed (gfp=0x20/0)
> last message repeated 841 times
> kernel: __alloc_pages: 1-order allocation failed (gfp=0x20/1)
> kernel: TCP: too many of orphaned sockets
> last message repeated 3 times
> kernel: NET: 1371 messages suppressed.
>
> disabling window_scaling, timestamps etc do not make any diff on speed.
>
> it would be interesting to test client+server on different machines
> but I have only one machine and 10 Mbit/s network.
Interesting results. I don't think I ever pushed dkftpbench that
hard. How long did the run last? You might need more than 60
seconds to make sure each connection grabbed at least 10 "packets",
which is when the bandwidth check kicks in. (Come to think of it,
the status function ought to tell you how many connections have
passed that point, shouldn't it?)
I haven't played with dkftpbench for a while, but in some
other experiments I have observed that sigio has trouble
beating select + fork at least in some scenarios (namely
"all connections hot"), whereas /dev/epoll is always a win.
It's about durn time I added sys_epoll support to dkftpbench...
Nakamiin (as my grandma always used to say!)
- Dan
--
Dan Kegel
Linux User #78045
http://www.kegel.com
----------
--- dkftpbench-0.45/bench.cc.bak 2002-02-13 07:06:01.000000000 +0200
+++ dkftpbench-0.45/bench.cc 2003-01-06 05:03:21.000000000 +0200
@@ -353,6 +353,12 @@ int main(int argc, char **argv)
}
}
poller->shutdown();
- printf("Test over. %d users left standing.\n", nalive);
- return 0;
+ thePlatoon.getStatus(&nconnecting, &nalive, &ndead);
+ if ((nalive == 0) && (nconnecting == 0)) {
+ printf("All users dead. Test failed.\n");
+ exit(1);
+ } else {
+ printf("Test over. %d users left standing.\n", nalive);
+ exit(0);
+ }
}
----------
--- dkftpbench-0.45/Poller_sigio.cc.bak 2002-07-31 04:26:05.000000000 +0300
+++ dkftpbench-0.45/Poller_sigio.cc 2003-01-06 05:07:32.000000000 +0200
@@ -190,7 +190,7 @@ int Poller_sigio::add(int fd, Client *cl
int err;
int flags;
// Set this fd to emit signals.
- if (fcntl(fd, F_GETFL, &flags) < 0) {
+ if ((flags = fcntl(fd, F_GETFL)) < 0) {
err = errno;
LOG_ERROR(("add: fcntl(fd %d, F_GETFL) returns err %d\n", fd, err));
return err;
@@ -257,7 +257,7 @@ int Poller_sigio::del(int fd)
// Set this fd to no longer emit signals.
int flags;
- if (fcntl(fd, F_GETFL, &flags) < 0) {
+ if ((flags = fcntl(fd, F_GETFL)) < 0) {
err = errno;
LOG_ERROR(("del: fcntl(fd %d, F_GETFL) returns err %d\n", fd, err));
return err;
[Non-text portions of this message have been removed]