Search code examples
fiware-orion

Entity insertions at Orion increasingly slower


When I have a lot of information in Context Orion Broker (in MongoDB) and when I try to insert more information increasingly your insertion is slower. E.g.: at this moment basically I have in Orion 3GB of information and when I try to send more information to Orion, I'm waiting more or less 15 minutes to send 50MB, however, if I send the same information when the Orion was empty this process finish in 1 minute.

admin   0.000GB    
config  0.000GB    
local   0.000GB
orion   2.932GB

Is normally this process? I mean, increasingly your insertion to be slower.

Extra info: VPS Linux with 2 cores and 8GB ram.

Indexes information:

> use orion
switched to db orion
> show collections
entities
> db.entities.getIndexes()
[
        {
                "v" : 2,
                "key" : {
                        "_id" : 1
                },
                "name" : "_id_",
                "ns" : "orion.entities"
        },
        {
                "v" : 2,
                "key" : {
                        "location.coords" : "2dsphere"
                },
                "name" : "location.coords_2dsphere",
                "ns" : "orion.entities",
                "2dsphereIndexVersion" : 3
        },
        {
                "v" : 2,
                "key" : {
                        "expDate" : 1
                },
                "name" : "expDate_1",
                "ns" : "orion.entities",
                "expireAfterSeconds" : 0
        }
]

Solution

  • Now is fast... i use this(as you said): db.entities.createIndex({"_id.id": 1, "_id.type": 1, "_id.servicePath": 1}) Thank you !