Solved

Limit the quantity of process created in parallel in the Task Scheduler 2008

Posted on 2010-11-08
11
649 Views
Last Modified: 2013-11-16
Hi all!
Problem: My code create too much process.
Question: How to limit the quantity on process created in parallel.

Background: for backup zip7 and the Task Scheduler of window 2008 is used. A task performs (Action) zip of all the files in a directory. The result is 1 zip for each file (I don't want 1 zip with all the files).

the action (in the Task Scheduler) is: cmd
the arguments are:
/C FOR %i IN (*.nsf)  DO  "C:\Program Files\7-Zip\7z.exe"  -bd u "\\Server_name\Backup\%~ni.zip" "%~fi">>c:\resuZip.log

Don't care too much if you're not familiar with the syntax, it works, this is not the problem.
The problem is that FOR creates for *each* file a process (like a fork in C) and the server nearly collapses.
How could I limit the creation of parallel tasks ?

Thanks in advance.
Emmanuel
0
Comment
Question by:Emmanuel Gleizer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
11 Comments
 
LVL 7

Assisted Solution

by:TechnoChat
TechnoChat earned 250 total points
ID: 34091588
I don't have any Idea about parallel task, but using "start" command from command line you can set the process priority.

Eg.
start /HIGH application.exe

Diff. switch

LOW         Start application in the IDLE priority class
NORMAL      Start application in the NORMAL priority class
HIGH        Start application in the HIGH priority class
REALTIME    Start application in the REALTIME priority class
ABOVENORMAL Start application in the ABOVENORMAL priority class
BELOWNORMAL Start application in the BELOWNORMAL priority class

Thanks
Saugata
0
 
LVL 5

Author Comment

by:Emmanuel Gleizer
ID: 34093979
Well this is an idea but, I'm afraid it will not help in my case. With this option It would still *create* ~ 250 process that do ZIP: which is intensive for my server.
It would help if the process *creation* itself is done when the system is idle (which would occures when the first ZIP has ended) it would be almost sequential.
I could even accept a solution in which only ONE process is created that will care of the file one after the second.
 
0
 
LVL 7

Expert Comment

by:TechnoChat
ID: 34099146
This command line tool might help you out..

http://www.activeplus.com/Products/RunFirst

Thanks
Saugata
0
Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

 
LVL 5

Author Comment

by:Emmanuel Gleizer
ID: 34100966
This solution will put (as I understand it) all the process on ONE core... well if put them in a sequence it could be a solution. But if it put them in parallel on one core well the process will nearly never end...
I'll try
0
 
LVL 7

Expert Comment

by:TechnoChat
ID: 34101500
Just give it a try, Hope for the best..

Thanks
Saugata
0
 
LVL 5

Author Comment

by:Emmanuel Gleizer
ID: 34111283
I found a better solution (I'm testing it) google for "wait for command to complete \before continuing batch file"
start /wait cmd /c .....
would post if it works
0
 
LVL 5

Author Comment

by:Emmanuel Gleizer
ID: 34111323
BTW I tried to use the Runfirst... but didn't find the syntax for "Option starup parameters"  
0
 
LVL 7

Expert Comment

by:TechnoChat
ID: 34118165
This runfirst tool only works with the executable without any Option starup parameters. But if you are on vista/w7/2008, then you can user start command for the same.

EG.
start /AFFINITY 1 notepad.exe

Thanks
Saugata
0
 
LVL 5

Accepted Solution

by:
Emmanuel Gleizer earned 0 total points
ID: 34224483
Well I must admit that I ask a question that doesn't reflect my problem.

First sorry I ran my code and discovered that it DOESN'T create many tasks as I thaught. It's sequential: each loop is one after the second.
The reason why (I think but I'm not sure) it slow down between loops is that the whole process is is low priority (since it's scheduled MS decide that IO has low priority)
Thus I fact I have to change my code to CREATE the tasks without waiting the end of the preceding loop.
BUT doing this is dangerous and I would get too many process.

I don't know what to do with this question!
I didn't get a real solution to my problem (I'm fare responsible for this since I didn't really described it)
please post your suggestions. my default would be to close it by accept my solution (wich is NOT) and reward you 2.
thanks for the help!
0
 
LVL 7

Expert Comment

by:TechnoChat
ID: 34225793
Most important thing is to solve the problem, no mater it solve by your self or by taking help from some one else. We all here to help each other, and share our knowledge to solve the problem faster, caz we can't live with our problems :)
And thanks for your comments..

Thanks
Saugata
0
 
LVL 5

Author Closing Comment

by:Emmanuel Gleizer
ID: 34272715
The main problem is that I didn't identify what the problem was: In fact NO parallel collapsing server resources… Thanks to TechnoChat for his different ideas
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question