Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: High CPU-load while waiting (thread.sleep) for job entry

  1. #1
    Join Date
    Nov 2011
    Posts
    1

    Question High CPU-load while waiting (thread.sleep) for job entry

    Hello,

    I experienced excessive and presumably unnecessary CPU-load when a job was waiting for a file/db/shell-script in PDI 3.2.4 and 4.x.
    I found the cause for this in the "JoBEntryJob" class, having it to poll for its JobEntryJobRunner in very short cycles (1 nano second):

    Code:
    try {
      while (!runner.isFinished() && !parentJob.isStopped())
      {
        try {Thread.sleep(0,1);}
        catch(InterruptedException e) { }
    }
    This get's worse, actually multiplies, with every sub-job you have. The problem came up after switching from a linux system to an AIX-environment where the code produced about 3 thousand system-calls/sec to "clockgettime".

    We changed the sleep-time to about 500 ms and didn't have any problems since then.
    Can anybody confirm that this change is harmless?

    Regards,
    Benjamin

  2. #2
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    Sure it's harmless but it indicates a small problem in the IBM JDK/JRE in the sense that Thread.sleep() ought to push priority of the thread very low and not consume a lot of cycles.
    The 500 number also might increase the latency of the job entries which causes problems in loops.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.