Search code examples
fiwarefiware-orion

How reduce queryContext times Orion Context broker


I have a service has following query context request:

{
    "entities": [{
        "type": "Call",
        "isPattern": "true",
        "id": ".*"  }],
        "restriction": {
            "scopes": [{
                "type": "FIWARE::StringQuery",
                "value": "status=='open'"
            }]
        }
}

Then It will return about 400 records in about 15 seconds. What is the best way to reduce to queryContext time so that make the service run faster?

The have a look at the following docs, It may be use Database indexes or set log level. https://fiware-orion.readthedocs.io/en/master/admin/perf_tuning/index.html

Please help to correct me?

Many thanks.


Solution

  • I think you are in the good direction... the document you cite about Orion performance (https://fiware-orion.readthedocs.io/en/master/admin/perf_tuning/index.html) is the one you should read and apply, specially the following sections:

    • MongoDB configuration
    • Database indexes
    • Write concern Notification
    • Identifying bottlenecks looking at semWait statistics
    • Log impact on performance
    • Mutex policy impact on performance

    In addition, ensure your MongoDB is not the bottleneck of your system. I mean, it is worth nothing to tune Orion for maximum performance if your MongoDB server is not performing ok, e.g. it is running in a system with very limited CPU and RAM resources. Please, check MongoDB documentation about this matter.

    Another possible bottleneck is the network. Where are your running your queryContext client? Is the result the same if you run queryContext in the same machine Orion runs (i.e. using localhost interface)?