Tuesday, July 21, 2009

Can Glassfish (v3) saturate 1 GBit/s?


Server specs
Dual Nehalem 5520 (4x2.26 Ghz. HT makes for a total of 16 virtual cpu's)
12 GB DDR 3 memory.
2x250 GB SATA RAID 1

What was tested
Using siege to randomly request files ranging from 1024 to 1048576 bytes.
The Siege "server" uses the same hardware.

Glassfish startup settings

-XX:+UnlockDiagnosticVMOptions -XX:MaxPermSize=192m -XX:NewRatio=2 -XX:+LogVMOutput -XX:LogFile=/home/glassfish/glassfishv3/glassfish/domains/domain1/logs/jvm.log -Xmx8000m -Djdbc.drivers=org.apache.derby.jdbc.ClientDriver -Djavax.net.ssl.trustStore=/home/glassfish/glassfishv3/glassfish/domains/domain1/config/cacerts.jks -Djavax.net.ssl.keyStore=/home/glassfish/glassfishv3/glassfish/domains/domain1/config/keystore.jks -Djava.security.policy=/home/glassfish/glassfishv3/glassfish/domains/domain1/config/server.policy -Dcom.sun.aas.instanceRoot=/home/glassfish/glassfishv3/glassfish/domains/domain1 -Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory -Djava.security.auth.login.config=/home/glassfish/glassfishv3/glassfish/domains/domain1/config/login.conf -Djava.endorsed.dirs=/home/glassfish/glassfishv3/glassfish/lib/endorsed -Dcom.sun.aas.installRoot=/home/glassfish/glassfishv3/glassfish -Djava.ext.dirs=/usr/java/jdk1.6.0_14/lib/ext:/usr/java/jdk1.6.0_14/jre/lib/ext:/home/glassfish/glassfishv3/glassfish/domains/domain1/lib/ext:/home/glassfish/glassfishv3/javadb/lib


top - 06:40:49 up 30 days, 17:22, 2 users, load average: 1.23, 0.81, 0.53
Tasks: 281 total, 1 running, 280 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.3%us, 0.1%sy, 0.0%ni, 99.5%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 12290980k total, 5732924k used, 6558056k free, 266296k buffers
Swap: 6289436k total, 0k used, 6289436k free, 4548592k cached

10865 root 20 0 8597m 428m 10m S 70.9 3.6 15:14.55 java


** SIEGE 2.66
** Preparing 512 concurrent users for battle.
The server is now under siege...
Lifting the server siege... done.
Transactions: 491907 hits
Availability: 100.00 %
Elapsed time: 1510.97 secs
Data transferred: 168817.77 MB
Response time: 1.57 secs
Transaction rate: 325.56 trans/sec
Throughput: 111.73 MB/sec
Concurrency: 511.71
Successful transactions: 491907
Failed transactions: 0
Longest transaction: 4.57
Shortest transaction: 0.01

Bandwidth proof:


Glassfish was not even stressing a single core on this machine and I'm fairly confident that even a simple dual core is enough to saturate a 1 Gbit port as long as the IO system can keep up. It will be interesting to see if you can approach these speeds when implementing servlets (probably not)
Also interesting to see is how during the benchmark the CPU usage went down from 120% to about 70% showing that the hotspot compiler does indeed optimize at runtime.

When I get some more time I'm going to extend the test by including everything from x=1 to 64 instead of just 32. This should also put more stress on the IO system and provide for a more realistic benchmark.

No comments: