Hello,
I need to limit the number of simultaneous jobs started. Not Tasks, but jobs.
And I don't see any option into afanasy server to limit this number.
I'll explain in detail my user-case:
All my jobs contains multiple tasks and the first one is just for setting some directories, very fast and requires low capacity (10).
And when I submit 1000 jobs in a short period of time, afanasy server start all of them because the first tasks can be done and this is unwanted behaviour for me.
I'd like instead to have afanasy server start only 10 jobs (for example) and not start others until one of them has been fully completed.
Is this possible ?
Thanks,
Gianluca.
Max number of job started
Re: Max number of job started
Hi.
For now there is no such limit.
One way is to write a script that will check running jobs and pause/unpause some.
Or you can simple not to set such low capacity to the first task.
But it can be a feature.
( I moved the topic in a feature requests section. )
For now there is no such limit.
One way is to write a script that will check running jobs and pause/unpause some.
Or you can simple not to set such low capacity to the first task.
But it can be a feature.
( I moved the topic in a feature requests section. )
Timur Hairulin
CGRU 3.3.1, Ubuntu 20.04, 22.04, MS Windows 10 (clients only).
CGRU 3.3.1, Ubuntu 20.04, 22.04, MS Windows 10 (clients only).
Re: Max number of job started
Instead of doing a script, I'd rather prefer to contribute to Afanasy if you think this could be a nice feature to add.
I was looking at the code and I found a way to implement that feature.
I was thinking to add a check inside the "bool JobAf::v_canRun()" method just above the check of max running tasks as by following proposal:
If you think it's a good place where to put such check ... then I'll try to figure out how to implement and pull a merge request.
Thanks,
Gianluca.
I was looking at the code and I found a way to implement that feature.
I was thinking to add a check inside the "bool JobAf::v_canRun()" method just above the check of max running tasks as by following proposal:
Code: Select all
// proposed modification to check maximum
if( number_of_running_jobs >= getMaximumRunningJobs())
{
return false;
}
// check maximum running tasks:
if(( m_max_running_tasks >= 0 ) && ( getRunningTasksNumber() >= m_max_running_tasks ))
{
return false;
}
Thanks,
Gianluca.
Re: Max number of job started
You should implement it in UserAf class.
And add a new max_running_jobs parameter to user.
Also you should add this parameter visualization and manipulation in GUIs.
It not very hard, but not so simple too.
And add a new max_running_jobs parameter to user.
Also you should add this parameter visualization and manipulation in GUIs.
It not very hard, but not so simple too.
Timur Hairulin
CGRU 3.3.1, Ubuntu 20.04, 22.04, MS Windows 10 (clients only).
CGRU 3.3.1, Ubuntu 20.04, 22.04, MS Windows 10 (clients only).
Re: Max number of job started
Thanks for the starting point.
I'll have a look.
Luckily, I'm a C++/Qt/Python programmer and web developer![Smile :-)](./images/smilies/icon_e_smile.gif)
I'll have a look.
Luckily, I'm a C++/Qt/Python programmer and web developer
![Smile :-)](./images/smilies/icon_e_smile.gif)
Re: Max number of job started
Great!
You are welcome!
You are welcome!
Timur Hairulin
CGRU 3.3.1, Ubuntu 20.04, 22.04, MS Windows 10 (clients only).
CGRU 3.3.1, Ubuntu 20.04, 22.04, MS Windows 10 (clients only).