File tree Expand file tree Collapse file tree 2 files changed +21
-8
lines changed
services/scheduling/worker Expand file tree Collapse file tree 2 files changed +21
-8
lines changed Original file line number Diff line number Diff line change @@ -217,6 +217,11 @@ def __init__(
217217 oscar_extra_conf = oscar_extra_conf ,
218218 )
219219
220+ # make memory allocation policy more aggressive on local by
221+ # assuming all the memory is available.
222+ if self ._config .get ("scheduling" , {}).get ("mem_hard_limit" , None ) is None :
223+ self ._config ["scheduling" ]["mem_hard_limit" ] = None
224+
220225 self ._bands_to_resource = execution_config .get_deploy_band_resources ()
221226 self ._supervisor_pool = None
222227 self ._worker_pools = []
Original file line number Diff line number Diff line change @@ -415,14 +415,22 @@ async def __post_create__(self):
415415 for band in band_to_resource .keys ():
416416 band_config = self ._band_configs .get (band [1 ], self ._default_config )
417417 hard_limit = band_config .get ("hard_limit" )
418- actor_cls = MemQuotaActor if hard_limit else QuotaActor
419- self ._band_quota_refs [band ] = await mo .create_actor (
420- actor_cls ,
421- band ,
422- ** band_config ,
423- uid = MemQuotaActor .gen_uid (band [1 ]),
424- address = self .address ,
425- )
418+ if hard_limit :
419+ self ._band_quota_refs [band ] = await mo .create_actor (
420+ MemQuotaActor ,
421+ band ,
422+ ** band_config ,
423+ uid = MemQuotaActor .gen_uid (band [1 ]),
424+ address = self .address ,
425+ )
426+ else :
427+ self ._band_quota_refs [band ] = await mo .create_actor (
428+ QuotaActor ,
429+ band ,
430+ quota_size = band_config ["quota_size" ],
431+ uid = QuotaActor .gen_uid (band [1 ]),
432+ address = self .address ,
433+ )
426434
427435 async def __pre_destroy__ (self ):
428436 await asyncio .gather (
You can’t perform that action at this time.
0 commit comments