Author Topic: jobtype for mysql tests  (Read 2361 times)

koodles

  • Jr. Member
  • **
  • Posts: 4
jobtype for mysql tests
« on: February 17, 2009, 03:57:55 AM »

I'm testing a new qube server and I'm wondering if anybody has a copy of the jobtype that was mentioned in this pdf where jobs will be submitted up to 2500 jobs per minute?

http://www.pipelinefx.com/downloads/Qube_TuningForHighPerformance.pdf

thanks

siyuan.pipelinefx

  • Sr. Member
  • ****
  • Posts: 32
Re: jobtype for mysql tests
« Reply #1 on: February 18, 2009, 12:44:59 AM »
Hey here's a python script for submitting N job at once. Hope this helps.

--
#!/usr/bin/python

import os, sys, random

if 'QBDIR' in os.environ:
   sys.path.append('%s/api/python' % os.environ['QBDIR']);
elif os.uname()[0] == 'Darwin':
   sys.path.append('/Applications/pfx/qube/api/python');
elif os.uname()[0] == 'Linux':
   sys.path.append('/usr/local/pfx/qube/api/python');
else:
   sys.path.append('c:/program files/pfx/qube/api/python');

import qb

# submit NUM_JOBS jobs
NUM_JOBS = 10
# JOB_TYPE = "cmdline"
JOB_TYPE = "cmdrange"
MIN_PRIORITY=1
MAX_PRIORITY=10

def main():

    listOfJobsToSubmit = []
    for i in range (1, NUM_JOBS):
        job = {}
        job['name'] = 'range'
        job['prototype'] = JOB_TYPE
#         job['reservations'] = 'host.memory=1,global.ray3=1'
#         job['reservations'] = 'host.memory=1,global.xsibatch=1'
        job['priority'] = random.randint(MIN_PRIORITY,MAX_PRIORITY)
   
        if JOB_TYPE == "cmdrange":
            start = random.randint(1,1000)
            end = start + random.randint(1,1000)
            step = random.randint(1,10)
            framerange = "%d-%dx%d" % (start, end, step)
            agenda = qb.genframes(framerange)
            job['agenda'] = agenda
            job['cpus'] = random.randint(1,len(agenda))
        else:
            job['cpus'] = 1

        package = {}
        job['package'] = package
        job['package']['cmdline'] = "sleep %d" % random.randint(1,60)
        listOfJobsToSubmit.append(job)

    print "submitting [%d] jobs" % NUM_JOBS
    listOfSubmittedJobs = qb.submit(listOfJobsToSubmit)

#     print listOfSubmittedJobs
    for job in listOfSubmittedJobs:
        print job['id']


if __name__ == "__main__":
    main()
    sys.exit(0)