FreeBSD vs Windows 2000 "Advanced" Server

FreeBSD vs Windows 2000 "Advanced" Server

Post by sheldon » Fri, 29 Aug 2003 18:09:02



Oops, make that about 8,000 threads. :-)

And I forgot to include the class source.

Ciao,
Sheldon.


public class TestThreads extends Thread
{
private long sleepMillis;

public TestThreads(long sleepMillis)
{

this.sleepMillis = sleepMillis;
}

public void run()
{

try {
Thread.sleep(sleepMillis);
} catch (InterruptedException e) {
}
}

public static void main(String[] args)
{
int threadCount = 0;
long sleepMillis = 0;

try {
threadCount = new Integer(args[0]).intValue();
sleepMillis = new Long(args[1]).longValue();
} catch (Exception e) {
usage();
}

int i = 0;
try {
for (i = 0; i < threadCount; i++) {
TestThreads test = new TestThreads(sleepMillis);
test.start();
}
System.out.println( "TestThreads: successfully fired " +
threadCount + " threads" );
} catch (OutOfMemoryError e) {
System.out.println("TestThreads: after creating " +
i + " threads: " + e.getMessage());
}

try {
Thread.sleep(sleepMillis);
System.out.println("TestThreads: waited " + sleepMillis +
" milliseconds for all threads to complete");
} catch (InterruptedException e) {
}
}

private static void usage()
{

System.err.println("usage: TestThreads threadCount sleepMillis");
System.exit(1);
}
}
_______________________________________________
XXXX@XXXXX.COM mailing list
http://www.yqcomputer.com/
To unsubscribe, send any mail to " XXXX@XXXXX.COM "
 
 
 

FreeBSD vs Windows 2000 "Advanced" Server

Post by past » Fri, 29 Aug 2003 18:28:12


On my WinXP box (Celeron 1,2GHz, 512MB) it manages to create 7237
threads. Hey, we still win :-)
--
Panagiotis Astithas
Electrical & Computer Engineer, PhD
Network Management Center
National Technical University of Athens, Greece

_______________________________________________
XXXX@XXXXX.COM mailing list
http://www.yqcomputer.com/
To unsubscribe, send any mail to " XXXX@XXXXX.COM "

 
 
 

FreeBSD vs Windows 2000 "Advanced" Server

Post by leaf » Fri, 29 Aug 2003 18:49:22


What is your sleep time settings? I can get to
leafy@chihiro:~/tmp$ java TestThreads 50000 10
TestThreads: successfully fired 50000 threads
TestThreads: waited 10 milliseconds for all threads to complete

But my box is a P4-1.8G with 256MB RAM, lengthing the sleeptime to 10,000 ms
also works, but drags my box down to nearly a halt.

--
"Without the userland, the kernel is useless."
--inspired by The Tao of Programming
_______________________________________________
XXXX@XXXXX.COM mailing list
http://www.yqcomputer.com/
To unsubscribe, send any mail to " XXXX@XXXXX.COM "
 
 
 

FreeBSD vs Windows 2000 "Advanced" Server

Post by sheldon » Fri, 29 Aug 2003 19:13:06


That's because memory is allocated for the stack of each thread. You
don't have a lot of memory. Using a low sleep time means that you're
not really keeping the threads alive long enough to have them all alive
at once.

I use 20000 as my sleep time. My box doesn't crawl, but I have 1G of
memory. :-)

Ciao,
Sheldon.
_______________________________________________
XXXX@XXXXX.COM mailing list
http://www.yqcomputer.com/
To unsubscribe, send any mail to " XXXX@XXXXX.COM "
 
 
 

FreeBSD vs Windows 2000 "Advanced" Server

Post by bfg » Fri, 29 Aug 2003 19:13:41

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



| What is your sleep time settings? I can get to
| leafy@chihiro:~/tmp$ java TestThreads 50000 10
| TestThreads: successfully fired 50000 threads
| TestThreads: waited 10 milliseconds for all threads to complete
|
| But my box is a P4-1.8G with 256MB RAM, lengthing the sleeptime to
10,000 ms
| also works, but drags my box down to nearly a halt.
|

$ time java TestThreads 50000 0
TestThreads: successfully fired 50000 threads
TestThreads: waited 0 milliseconds for all threads to complete

real 0m20.173s
user 0m16.739s
sys 0m1.909s

... which 2478,56 threads/second.

$ time java TestThreads 50000 10
TestThreads: successfully fired 50000 threads
TestThreads: waited 10 milliseconds for all threads to complete

real 0m22.295s
user 0m18.258s
sys 0m2.816s

2242,65 threads/second
This is a celeron 1700, 256 mb of ram, 5.1-p2. System is normaly
respondable during java execution. I have 1.4.1 native jdk.

Brane
-----BEGIN PGP SIGNATURE-----

iD8DBQE/TdIofiC/E+t8hPcRAi4YAJ9EwoX0n8JlFD3obCw/UeyQ750xzQCfVwNj
X6Q7hfOhpeUzD0Wg4sdzueU=
=sVOy
-----END PGP SIGNATURE-----

_______________________________________________
XXXX@XXXXX.COM mailing list
http://www.yqcomputer.com/
To unsubscribe, send any mail to " XXXX@XXXXX.COM "
 
 
 

FreeBSD vs Windows 2000 "Advanced" Server

Post by sheldon » Fri, 29 Aug 2003 19:17:19


These are not meaningful numbers. The program wasn't designed to test
thread instantiation performance, and is pretty much guaranteed to do a
shit job of it. :-)

You need enough sleep time to ensure that all the threads are active at
once.

Ciao,
Sheldon.
_______________________________________________
XXXX@XXXXX.COM mailing list
http://www.yqcomputer.com/
To unsubscribe, send any mail to " XXXX@XXXXX.COM "
 
 
 

FreeBSD vs Windows 2000 "Advanced" Server

Post by bfg » Fri, 29 Aug 2003 20:06:19

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

|
| These are not meaningful numbers. The program wasn't designed to test
| thread instantiation performance, and is pretty much guaranteed to do a
| shit job of it. :-)
|
| You need enough sleep time to ensure that all the threads are active at
| once.

$ time java TestThreads 50000 10000
TestThreads: successfully fired 50000 threads
TestThreads: waited 10000 milliseconds for all threads to complete

real 2m41.536s
user 2m8.008s
sys 0m5.261s


last pid: 14356; load averages: 0.86, 0.28, 0.13
~ up
0+22:54:54 13:01:33
9 processes: 2 running, 7 sleeping
CPU states: 86.8% user, 0.0% nice, 12.5% system, 0.8% interrupt, 0.0%
idle
Mem: 161M Active, 19M Inact, 56M Wired, 8712K Cache, 35M Buf, 656K Free
Swap: 512M Total, 123M Used, 389M Free, 24% Inuse, 328K In, 1764K Out

PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND
14353 branko 126 0 1005M 112M RUN 0:22 82.81% 61.38% java


-----BEGIN PGP SIGNATURE-----

iD8DBQE/TeB+fiC/E+t8hPcRAoZhAJ467CAFW4idtqZP5UWiTboKxCka9ACeNPBF
ZKQlHgT3iD1IumU4vOIpA8E=
=CUvH
-----END PGP SIGNATURE-----

_______________________________________________
XXXX@XXXXX.COM mailing list
http://www.yqcomputer.com/
To unsubscribe, send any mail to " XXXX@XXXXX.COM "
 
 
 

FreeBSD vs Windows 2000 "Advanced" Server

Post by past » Fri, 29 Aug 2003 20:29:06


You specify a sleep time of 10000 msec = 10 sec and your program takes
2min+42sec = 162sec to execute. Therefore one would assume that some of
the threads finished before others started, thus failing to stress the
limits of thread allocation by the system.

Why don't you try an insane timeout, like 900000;

Cheers,
--
Panagiotis Astithas
Electrical & Computer Engineer, PhD
Network Management Center
National Technical University of Athens, Greece

_______________________________________________
XXXX@XXXXX.COM mailing list
http://www.yqcomputer.com/
To unsubscribe, send any mail to " XXXX@XXXXX.COM "
 
 
 

FreeBSD vs Windows 2000 "Advanced" Server

Post by sheldon » Fri, 05 Sep 2003 21:03:07


As it turns out, the evidence that led me to believe that FreeBSD Java
support outscaled Windows 2000's was off.

Windows 2000 comes with terrible out-of-the-box defaults, plus I
made a naive configuration change early on without understanding the
consequences.

In fact, we found that 2,000 siumultaneous Tomcat processors was
impossible to support on FreeBSD 4.8-STABLE, and unworkably slow on
FreeBSD 5.1-CURRENT (native jdk1.4.1p3 in both cases).

What I got wrong with the Windows 2000 installation:

http://www.yqcomputer.com/ #106249959878214319

Why I wouldn't recommend FreeBSD Java for heavily threaded applications
yet:

http://www.yqcomputer.com/ #106267661433883916

Ciao,
Sheldon.
_______________________________________________
XXXX@XXXXX.COM mailing list
http://www.yqcomputer.com/
To unsubscribe, send any mail to " XXXX@XXXXX.COM "