History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: CCNET-504
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Craig Sutherland
Reporter: Jeff Bergren
Votes: 3
Watchers: 4
Operations

If you were logged in you would be able to see more operations.
CruiseControl .NET

Process Priority setting for tasks

Created: 10/Aug/05 08:30 AM   Updated: Sunday 12:48 PM
Component/s: Task
Affects Version/s: 0.9.2, 1.0 RC1, 1.0 RC2, 1.0, 1.0.1, 1.1, 1.2, 1.1.1, 1.3, 1.2.1, 1.4, 1.4.1, 1.4.3, 1.4.2, 1.5.0 RC1, 1.4.4 RC1, 1.5.0 CTP, 1.4.4 RC2, 1.4.4, 1.4.4 SP1, 1.4.5
Fix Version/s: 1.5.0 RC1

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
File Attachments: 1. Text File 0001-Implement-process-priority-property-on-exec-tasks.patch (34 kb)
2. Text File 0001-Implement-process-priority-property-on-exec-tasks.patch (108 kb)
3. Text File priority 1.5.patch (32 kb)
4. Text File priority 1.5.patch (28 kb)
5. Text File priority.patch (17 kb)

Environment: Any


 Description  « Hide
It'd be helpful if the task could be set to run at a lower or higher process priority on the system.

We're using the server for more than CruiseControl and some of the builds bring the system to a stand-still, including processes like ASP.net. At times, one build causes other builds to time-out, checking modifications by CruiseControl slows down infinitely, etc.

Not sure if this feature would fix the problem however since NANT fires off it's tasks as separate processes. Haven't been able to try if the priority would carry over to these later spawned processes (which are the culprit in the end).

NANT may also need a priority setting on tasks.



 All   Comments   Work Log   Change History      Sort Order:
Mike Roberts [10/Aug/05 09:18 AM]
Nice idea, though as you say getting this into NAnt would be a higer priority for you.

Alon Albert [19/Nov/06 07:36 AM]
While I agree that NAnt should also have a priority attribute for executed commands, I think CCNet needs this regardless since NAnt is not the only way to execute process tasks. We should be able, for example, to start a Devenv task directly with a specified priority.

Anyway, the fix is rather simple:
1. Added a Priority field to ProcessInfo
2. ProcessExecutor tries to set priority after it starts. I say try because you cannot set the priority before the process starts and I have not found a way to start the process in a suspended state. This leaves the possibility that the process would have ended before we could set the Priority which would draw an exception. The exception is simply ignored.
3. Added a <priority> property to DevenvTask, ExecutableTask, MsBuildTask, NAntTask & NUnitTask.

BTW, I deployed this on my build machine and got ramatic results. I have 2 projects set up for the same product:
1. An incremental build - Should take about 4 minutes if no changes were made
2. A Daily full build - Whould take about 1:15h when running alone.

Before priority was introduced, if both builds were running together competing for resources, the incremental build would take 20 minutes (4X) and the full build would take 2 hours (!!!) for a total of 2:20h.
With priority set to BelowNormal for the incremental build and Idle for the full build, the build times are remarkably almost identical to what they are when running alone. This is because the full build all but pauses when the incremental build is running .
The combined total for both is now down to about 1:20h which is just about a full hour savings in machine time.

Heck of a lot cheaper than buying another build machine...

Unit tests includes
All UT passed

David Schmitt [14/Dec/09 03:05 PM]
Updated priority.patch to 1.5 and added the priority property to all BaseExecutableTask children

David Schmitt [14/Dec/09 04:12 PM]
Update update version of the patch, to actually set the priority on process execution.

Also added the NUnit task, which is not a BaseExecutorTask.

David Schmitt [29/Dec/09 05:17 AM]
Refresh patch against newest HEAD

David Schmitt [29/Dec/09 05:19 AM]
Refresh patch against current HEAD (with fixed whitespace issues)

Craig Sutherland [06/Jan/10 03:21 AM]
Committed in rev. 6610.