Solved

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

Posted on 2010-11-08
11
647 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
  • 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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…

809 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