mirror of
https://github.com/PowerJob/PowerJob.git
synced 2025-07-17 00:00:04 +08:00
feat: optimize instanceMetadataCacheSize
This commit is contained in:
parent
22522c099d
commit
22db37cad9
@ -33,13 +33,14 @@ public class InstanceMetadataService implements InitializingBean {
|
|||||||
|
|
||||||
@Value("${oms.instance.metadata.cache.size}")
|
@Value("${oms.instance.metadata.cache.size}")
|
||||||
private int instanceMetadataCacheSize;
|
private int instanceMetadataCacheSize;
|
||||||
private static final int CACHE_CONCURRENCY_LEVEL = 4;
|
private static final int CACHE_CONCURRENCY_LEVEL = 16;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterPropertiesSet() throws Exception {
|
public void afterPropertiesSet() throws Exception {
|
||||||
instanceId2JobInfoCache = CacheBuilder.newBuilder()
|
instanceId2JobInfoCache = CacheBuilder.newBuilder()
|
||||||
.concurrencyLevel(CACHE_CONCURRENCY_LEVEL)
|
.concurrencyLevel(CACHE_CONCURRENCY_LEVEL)
|
||||||
.maximumSize(instanceMetadataCacheSize)
|
.maximumSize(instanceMetadataCacheSize)
|
||||||
|
.softValues()
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user