Rinaldo DiGiorgio created MESOS-5541:
----------------------------------------

             Summary: OSX 10.10.5 and mesos 0.28.1  -- 10 to 20 X difference in 
sleep() method compared to non mesos
                 Key: MESOS-5541
                 URL: https://issues.apache.org/jira/browse/MESOS-5541
             Project: Mesos
          Issue Type: Bug
          Components: cgroups
            Reporter: Rinaldo DiGiorgio


        We are running the following Java application and we are getting 
unreasonable deltas in the actual amount time slept. On linux the results are 
as expected 10, 11, 12 but mostly 10ms.  Can you suggest any changes we can 
make or is this a known issue or a new issue to be investigated? When we run 
the same code on the same instance of OSX 10.10.5 without mesos  -- we get the 
expected results. 


public class SleepLatency {
  static final int COUNT = 100;
  static final long DELAY = 10L;

  public static void main(String[] args) throws Exception {
      long tstart = System.currentTimeMillis();
      for (int i = 0; i < COUNT; i++) {
          long t0 = System.currentTimeMillis();
          Thread.sleep(DELAY);
          long t1 = System.currentTimeMillis();
          System.out.printf("loop %3d delay %4d ms%n", i, t1 - t0);
      }
      long tfinish = System.currentTimeMillis();
      System.out.printf("total time = %5d ms%n", tfinish - tstart);
  }
}

====== OSX   RESULTS are 10 to 20 times  larger than LINUX Results below =====

sh -c '/opt/jdk/bin/java -cp ./mach5-mesos-support-1.0-SNAPSHOT.jar 
SleepLatency'
loop   0 delay  141 ms
loop   1 delay  201 ms
loop   2 delay   81 ms
loop   3 delay   14 ms
loop   4 delay  194 ms
loop   5 delay  149 ms
loop   6 delay  172 ms
loop   7 delay  203 ms
loop   8 delay  203 ms
loop   9 delay  204 ms
loop  10 delay  204 ms
....




====== LINUX   RESULTS are as expected ======

sh -c '/opt/jdk/bin/java -cp ./mach5-mesos-support-1.0-SNAPSHOT.jar 
SleepLatency'
Forked command at 6125
loop   0 delay   10 ms
loop   1 delay   11 ms
loop   2 delay   10 ms
loop   3 delay   10 ms
loop   4 delay   10 ms
loop   5 delay   10 ms
loop   6 delay   10 ms
loop   7 delay   10 ms



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to