-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CRUD operations eat all the working memory #1628
Comments
We have found the issue 1459. We are still confused by this effect and would like an explanation or maybe solutlion. |
So, you were sending the @context ion the payload body? Over and over again ... The broker stores all contexts in a RAM cache (in a hash table for fast lookups) and each and every request with an "inline" @contest ... well, it's a new context => more RAM usage. However, I understand you still have a problem with memory. |
We are using subscriptions but the problem started long before that and we did not notice any change of the behavior. We are sending the @context via header like: headers = {
'Link': '<https://raw.githubusercontent.com/smart-data-models/dataModel.Energy/master/context.jsonld>; rel="http://www.w3.org/ns/json-ld#context"; type="application/ld+json"',
'Connection':'Close'
} And the payload body from our initial post looks like: {
"id": "urn:ngsi_ld:entity:test",
"type": "ThreePhaseAcMeasurement",
"refDevice": {
"type": "Property",
"value": "urn:ngsi_ld:entity:test_device"
},
"totalActivePower": {
"type": "Property",
"value": null,
"observedAt": "",
"unitCode": "kW",
"measurementType": {
"type": "Property",
"value": "online"
}
},
"totalReactivePower": {
"type": "Property",
"value": null,
"observedAt": "",
"unitCode": "kvar",
"measurementType": {
"type": "Property",
"value": "online"
}
},
"totalApparentPower": {
"type": "Property",
"value": null,
"observedAt": "",
"unitCode": "kVA",
"measurementType": {
"type": "Property",
"value": "online"
}
}
}
And the payload body from our following patch looks like: {
'refDevice': {
'type': 'Property',
'value': 'urn:ngsi_ld:entity:test'
},
'totalActivePower': {
'type': 'Property',
'value': 3600.0,
'observedAt': '2024-02-06T12:47:39+00:00',
'unitCode': 'kW',
'measurementType': {
'type': 'Property',
'value': 'online'
}
},
'totalReactivePower': {
'type': 'Property',
'value': 49.25265884399414,
'observedAt': '2024-02-06T12:47:39+00:00',
'unitCode': 'kvar',
'measurementType': {
'type': 'Property',
'value': 'online'
}
},
'totalApparentPower': {
'type': 'Property',
'value': 3600.336904291486,
'observedAt': '2024-02-06T12:47:39+00:00',
'unitCode': 'kVA',
'measurementType': {
'type': 'Property',
'value': 'online'
}
}
} But we still see the same behavior as before. |
UseCase and effect
We are trying to send data to FIWARE via CRUD(Post/Patch) operations. We have tried it via the requests package from python and via a curl executions in bash script. The scripts patch about 10 data files every 10 seconds. The effect we see is linear increase of active memory usage over time.
Script Example
FIWARE Details
Our troubleshooting so far
We have tried so far to excplicitly kill the connections with "Connection" : "Close" as well as response.close(). We also sed log=NONE and disabled the logging from the docker container as well. We also know created the bash script just to check if our python script is the problem. But we can see the same effect.
The onyl thing which seems so far to prevent Orion from crashing is to open up a session over the requests package in combination with a with statement:
But also using sessions is eating our active memory it just doesn't die at the end.
Is this a known problem? What are we missing? We are aware of IoT-Agents but we are not sure if this is complient with our security concept and also we try to keep it as simple as possible.
The text was updated successfully, but these errors were encountered: