|
From: <ha...@us...> - 2008-04-24 19:48:34
|
Revision: 1980
http://cogkit.svn.sourceforge.net/cogkit/?rev=1980&view=rev
Author: hategan
Date: 2008-04-24 12:48:05 -0700 (Thu, 24 Apr 2008)
Log Message:
-----------
ability to limit number of simultaneous worker startups
Modified Paths:
--------------
trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/job/manager/WorkerManager.java
Modified: trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/job/manager/WorkerManager.java
===================================================================
--- trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/job/manager/WorkerManager.java 2008-04-24 19:47:19 UTC (rev 1979)
+++ trunk/current/src/cog/modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/job/manager/WorkerManager.java 2008-04-24 19:48:05 UTC (rev 1980)
@@ -57,7 +57,8 @@
public static final int OVERALLOCATION_FACTOR = 10;
- public static final int MAX_WORKERS = 100;
+ public static final int MAX_WORKERS = 256;
+ public static final int MAX_STARTING_WORKERS = 32;
private SortedMap ready;
private Map ids;
@@ -264,9 +265,17 @@
.info("No suitable worker found. Attempting to start a new one.");
}
synchronized (allocationRequests) {
- allocationRequests.add(new AllocationRequest(maxWallTime,
- prototype));
- allocationRequests.notify();
+ if (allocationRequests.size() < MAX_STARTING_WORKERS) {
+ allocationRequests.add(new AllocationRequest(maxWallTime,
+ prototype));
+ allocationRequests.notify();
+ }
+ else {
+ synchronized (this) {
+ this.wait(250);
+ }
+ return null;
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|