?
Solved

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

Posted on 2010-11-08
11
Medium Priority
?
655 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 1000 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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

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…
For anyone that has accidentally used newSID with Server 2008 R2 (like I did) and hasn't been able to get the server running again because you were unlucky (as I was) and had no backups - I was able to get things working by doing a Registry Hive rec…
This tutorial will walk an individual through locating and launching the BEUtility application and how to execute it on the appropriate database. Log onto the server running the Backup Exec database. In a larger environment, this would generally be …
This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
Suggested Courses

764 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