java performance on two different servers -


not sure if question should here or in serverfault, it's java-related here is:

i have 2 servers, similar technology:

  • server1 oracle/sun x86 dual x5670 cpu (2.93 ghz) (4 cores each), 12gb ram.
  • server2 dell r610 dual x5680 cpu (3.3 ghz) (6 cores each), 16gb ram.

both running solaris x86, exact same configuration.

both have turbo-boost enabled, , no hyper-threading.

server2 should therefore faster server1.

i'm running following short test program on 2 platforms.

import java.io.*;  public class testprogram {  public static void main(string[] args) {     new testprogram (); }  public testprogram () {     try {         printwriter writer  = new printwriter(new fileoutputstream("perfs.txt", true), true);          (int = 0; < 10000; i++) {             long t1 = system.nanotime();             system.out.println("0123456789qwertyuiop0123456789qwertyuiop0123456789qwertyuiop0123456789qwertyuiop");             long t2 = system.nanotime();              writer.println((t2-t1));              //try {             //  thread.sleep(1);             //}             //catch(exception e) {             //  system.out.println("thread sleep exception");             //}         }     }     catch(exception e) {         e.printstacktrace(system.out);     } } } 

i'm opening perfs.txt , averaging results, get:

  • server1: average = 1664 , trim 10% = 1615
  • server2: average = 1510 , trim 10% = 1429

which expected result (server2 perfs > server1 perfs).

now, uncomment "thread.sleep(1)" part , test again, results now:

  • server1: average = 27598 , trim 10% = 26583
  • server2: average = 52320 , trim 10% = 39359

this time server2 perfs < server1 perfs

that doesn't make sense me...

obviously i'm looking @ way improve server2 perfs in second case. there must kind of configuration different, , don't know one. os identical, java version identical.

could linked number of cores ? maybe it's bios setting ? although bios different (ami vs dell), settings seem pretty similar.

i'll update dell's bios , retest, appreciate insight...

thanks

i try different test program, try running somthing this.

public class timer implements runnable {     public void starttimer()     {         time = 0;         running = true;         thread = new thread(this);         thread.start();     }      public int stoptimer()     {         running = false;         return time;     }      public void run()     {         try         {             while(running)             {                  thread.sleep(1);                 time++;             }         }catch(exception e){e.printstacktrace();}     }      private int time;     private thread thread;     private boolean running; } 

thats timer heres main:

public class main {     public static void main(string args[])     {         timer timer = new timer();         timer.starttimer();         for(int x=0;x<1000;x++)             system.out.println("testing!!");         system.out.println("\n\ntime taken: "+timer.stoptimer());      } } 

i think way test wich system truely running faster. try , let me know how goes.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -