Menu

Suggestion for priority of job

Zeph
2012-11-15
2012-12-11
  • Zeph

    Zeph - 2012-11-15

    Hi, I am trying to set priority of a job (I don't mean job priority attribute) and found that it may not work well when multiple projects are running simultaneously on the farm.

    Here's a scenario:
    I have 2 projects on the farm at the moment and I have people working on both projects. ProjectA is more important than projectB. So if both projects have jobs on the farm, I would see that ProjectA is using more resources than ProjectB. And userA submitted 3 jobs of projectA  and 1 job of projectB while userB submitted 1 job of projectB on the farm.

    In the current version of afanasy, as a result of user priority, I would see that both users will share the farm resources 50% equally which will means project A and projectB using 50% of the farm resources as well. Which is not what we expect. Of course in this situation, we can adjust the user priority of UserA but it is not feasible to adjust user priority every hour or everyday.

    My suggestion would be there is a new project priority which will work like the current user priority and should be considered first. And the next consideration will be job priority. So for a same project, if there are 2 jobs with different priorities, the one with higher priority will get more resources. And finally user priority which will ensure that at least we will not have a situation where a person does not get any resources.

    What is your opinion?

     
  • Timur Hairulin

    Timur Hairulin - 2012-11-15

    Hi. I am thinking about such ability too. But as for now i can't imagine a simple and clean formula.
    The simplest way is to switch afserver is some state, where all jobs will be solved in one same space* with some "effective priority = job priority * user priority" (or "job priority + user priority")
    What do you think if it will be enough?

    *Now at first users are solved according to user priority. And than user jobs are solved.

     
  • Zeph

    Zeph - 2012-11-16

    Hi. I don't think an equation is enough to solve the problem as we still want job with lower priority to run as well. Just less resources. An equation would cause them to be stuck in the queue forever. Unless you introduce "time" into the equation where effective priority = (job priority + user priority) * time, where time is a variable that will increase the longer the job has been in the queue.

    Based on my work experience, I would prefer what I suggested in my earlier post. But I know it will not be easy. First you would need to introduce a new variable into each job, eg. project. So jobs will be categorized based on project. Then there will be a new project priority settings where I can configure what percentage of the farm resources that each project can utilize. So in earlier example, projectA 70%, project B 30%. So whenever a resource is free, I would check which project is not fully utilizing all its resources and allocate that resource to that project.

    So if project A is not fully utilizing its resources and projectA still has jobs that can use that resource, that will be given to jobs in projectA. In the world of projectA, we will check which jobs can use that resources. This is when job priority and user priority come in. We can just use job priority or we can do
    effective priority = job priority + user priority /(num of running task of user + 1)
    The +1 is just to avoid divide by zero error.

    The only problem with this approach is when project B has a really urgent job that needs to be finished asap. In this case, that job will not be able to go past the limitation of 30% unless project A does not have enough jobs to use up the 70%. But if project A are using all the resources, then human intervention will be required to stop jobs in Project A so that that job from project B will be able to steal those resources.

    What do you think of this?

     
  • Timur Hairulin

    Timur Hairulin - 2012-11-19

    Hi.
    So it is a more complex task, than just to plus priorities.
    We need to solve some other entity.
    Now only users and jobs can be solved - its all are "afnodes" which exists in afserver containers.
    It should be some other special container which will collect any solvable entities, it can be users, jobs, projects or some other (department, for example).
    So it is not so easy. But it is needed.

     

Log in to post a comment.