Select a tab to view language specific information on setting the concurrency.
In code:
var pipeline = new DeviceDetectionPipelineBuilder(loggerFactory)
.UseOnPremise(dataFile, null, false)
.SetPerformanceProfile(PerformanceProfiles.LowMemory)
.SetConcurrency(threadCount)
.Build();
Or in config file:
"PipelineOptions": {
"Elements": [
{
"BuilderName": "DeviceDetectionHashEngineBuilder",
"BuildParameters": {
"DataFile": "51Degrees-LiteV4.1.hash",
"PerformanceProfile": "LowMemory",
"Concurrency": 30
}
}
...
]
}
In code:
DeviceDetectionOnPremisePipelineBuilder builder = new DeviceDetectionPipelineBuilder()
.useOnPremise(dataFileLocation, false)
.setPerformanceProfile(PerformanceProfiles.LowMemory)
.setConcurrency(threadCount)
.build();
Or in config file:
<PipelineOptions>
<Elements>
<Element>
<BuildParameters>
<DataFile>51Degrees-LiteV4.1.hash</DataFile>
<PerformanceProfile>LowMemory</PerformanceProfile>
<Concurrency>30</Concurrency>
</BuildParameters>
<BuilderName>DeviceDetectionHashEngine</BuilderName>
</Element>
...
</Elements>
</PipelineOptions>
In code:
const pipeline = new DeviceDetectionOnPremisePipelineBuilder({
dataFile: datafile,
performanceProfile: 'LowMemory',
concurrency: threadCount
}).build();
Or in config file:
"PipelineOptions": {
"Elements": [
{
"elementName": "deviceDetectionOnPremise",
"elementParameters": {
"performanceProfile": "LowMemmory",
"dataFilePath": "51Degrees-LiteV4.1.hash",
"concurrency": 30
}
}
...
]
}
For PHP, the concurrency options is set in the php.ini file.
extension=/usr/lib/php/20170718/FiftyOneDegreesHashEngine.so
FiftyOneDegreesHashEngine.data_file=/path to your file/51Degrees-LiteV4.1.hash
FiftyOneDegreesHashEngine.performance_profile=LowMemory
FiftyOneDegreesHashEngine.concurrency=30
In code:
pipeline = DeviceDetectionOnPremisePipelineBuilder(
data_file_path = data_file,
performance_profile = 'LowMemory',
concurrency = thread_count).build()
Or in config file:
"PipelineOptions": {
"Elements": [
{
"elementName": "DeviceDetectionOnPremise",
"elementPath": "fiftyone_devicedetection_onpremise.devicedetection_onpremise",
"elementParameters": {
"data_file_path": "51Degrees-LiteV4.1.hash",
"performance_profile": "LowMemory",
"concurrency": 30
}
}
...
]
}
ConfigHash config = HashLowMemoryConfig;
config.strings.concurrency = threadCount;
config.properties.concurrency = threadCount;
config.values.concurrency = threadCount;
config.profiles.concurrency = threadCount;
config.nodes.concurrency = threadCount;
config.profileOffsets.concurrency = threadCount;
config.maps.concurrency = threadCount;
config.components.concurrency = threadCount;
StatusCode status = HashInitManagerFromFile(
&manager,
&dataSetConfig,
&properties,
dataFileLocation,
exception);
ConfigHash* config = new ConfigHash();
config->setLowMemory();
config->setConcurrency(threadCount);
EngineHash *engine =
new DeviceDetection::Hash::EngineHash(
dataFilePath,
config,
properties);