Limit/restrict CPU% for a job in AS400

15 pts.
AS/400 jobs
AS/400 performance

I have a job where I want to restrict the maximum CPU% usage.

I tried various ways like setting a low run priority and a low-timeslice. Still they are not meeting my requirement.  With these 2 parameters, when the system is free, it is allocating the full CPU% to my job alone which I don't want.

Briefly my requirement is, I have to run the job with say a maximum of 2% CPU.  It can take any number of days to complete, but the CPU% must be achieved.

Can anybody guide me please.


Murty Varanasi

Software/Hardware used:

Answer Wiki

Thanks. We'll let you know when a new response is added.

When you say you “lowered the prioity” you do know that a priority of (1) is the highest priority and 99 the lowest. If you set your job to a 60 priority, all interactive and batch will get all of the timeslice they can use before your job gets any. If you are doing this and the system uses 100% CPU the in is because the processor is available and it will not effect other jobs. AS400s run at 100% with no problem.

Discuss This Question: 12  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • TomLiotta
    I have to run the job with say a maximum of 2% CPU. What is the time interval for a percentage? That's important because your job will use 100% of the CPU during the times that it is actually running. Control over, say, a 30-minute interval is easier than over a 1-minute interval. Whether some system function manages your CPU usage or some monitor of your own does it, it will take more CPU to execute the controlling process if it must track smaller intervals. For a 2% maximum threshold, you might start spending resources to keep your job under control that start to approach the resources of the job itself. So, how are figuring the 2% value? Tom
    125,585 pointsBadges:
  • mcl
    If the system is not doing anything else, why do you care if your job gets all the CPU? The O/S is doing what it is supposed to be doing. Don't try to fix it! You can throttle a job to use less CPU, but that really only becomes apparent when the system is busy. Regards Mike
    2,740 pointsBadges:
  • Vatchy
    Try using the CL command DlyJob. Process some number of records - experiment with this - and then delay the job for 2-3 seconds. A little testing should give you the results that you need. You can use QCmdExc to execute the DlyJob command from an RPG program.
    1,415 pointsBadges:
    I am in a way not satisfied with any of the responses got so far on this task. My main purpose is; when my job is running, people (the other users on the system) see the CPU% and are scary to submit/release their jobs. Even for a nano second, my job should not show above a certain percentage of CPU usage. I reiterate even if the system or the processor (as the other friends say), is absolutely free, my job should not show more than a 5 or 10% CPU usage. Even if I put a delay job (as suggested by one of the members), I am not getting the required result. My file is an old file of 10 year history data with 80 GB (you are right, it is 80 GB), even if I process 10000 records in it, system takes a lot time to set my pointer to the required records. Can anybody throw some light on this. I belive if there are members from IBM they can resolve this fast.
    15 pointsBadges:
  • TomLiotta
    ...when my job is running, people (the other users on the system) see the CPU% and are scary to submit/release their jobs. IMO, no one who doesn't understand what "CPU %" means should even see the "CPU %" figure for that exact reason. You cannot satisfy people who don't know the meaning of what they're saying. As already asked and not yet answered -- What is the time interval for a percentage? And how are you figuring the 2% value? Until those questions are answered by you, there is no valid answer to your question because there isn't enough information about it yet. Tom
    125,585 pointsBadges:
  • philpl1jb
    As pointed out in all responses. The AS/400 operating system optimizes the active job load, this is generally considered a good thing. Changing the run priority and inserting delays will favor other jobs, but when it's not delayed your job will still get the unused resources. But we could .. help you make a "fake" version of WRKACTJOB that shows 2%. Phil
    54,090 pointsBadges:
  • JamesPeters
    I can sympathize with Tom.  I sometimes run my  jobs at priority 90 or 99 and I still get  blamed for hogging the system or causing applications to run slow.

    It's hard to fight ignorance. Especially when you are a low-level employee.
    20 pointsBadges:
  • pdraebel
    Isn't it great that you paid for 100% of the machine and it actually tries to give you 100% use?

    7,545 pointsBadges:
  • ToddN2000
    How are the other seeing the CPU %? If they have access to the WRKSYSSTS command, I'd be wore worried about that. Can they cancel jobs, put hem on hold so they get better performance, change run priorities? This should be an operator or other authorized user screen only.
    135,525 pointsBadges:
  • leonelbethel
    Have you tried to create and index in order to reduce the process time?
    10 pointsBadges:
  • TheRealRaven
    Create an index over what? Actually, creating an index could easily increase CPU%. By reducing I/O wait times, the process might be able to request the CPU more often thereby occupying an activity slot more often.

    Total CPU might go down over the life of the job, but "CPU%" isn't a big consideration for jobs unless significant large temporary indexes are being created. And that doesn't seem likely in the case of the OP.
    36,430 pointsBadges:
  • ToddN2000
    I agree it's a strange case. If this job can run for days, and there is CPU not being used, why restrict it? As long as you prioritize your jobs, nobody should know the difference. Not knowing the specifics of the job, they may be using the same files and causing other issues not related to the CPU that are causing the slowdown. Things like record locks for example.
    135,525 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: