Skip to content

Performance Benchmarking and Profiling

indrajra-ilimi edited this page Jan 8, 2019 · 3 revisions

Factors affecting performance

  1. Number of in-place references (a.k.a., child entities) A parent entity can encompass (has a composite relationship) to a child in two ways - a) referring to the child URI b) holding the child data in itself. In case (b), the child is created only for logical separation. A good example is a house and address. The case (a) has no impact on the performance, whereas case (b) negatively affects it.

  2. The database chosen Neo4J (graph) database is generally slower in our benchmark tests when compared to SQLG (relational) databases.

  3. Number of entities More the number of entities, direct reads from the database can be affected. Configure OpenSABER to use Elastic Search in such cases.

Factors that do not affect performance

  1. Number of properties Properties here mean simple valued properties. Complex attributes has some impact.

General recommendations

  1. Configure databases for high performance _Each database comes with its own set of instructions and recommendations for high performance. Read and choose each setting carefully as advised. For example, you may like to look at Neo4j recommendation and Postgres recommendations. _

  2. Estimate record counts and configure shards _As the records grow in quantity, individual table holding them become the contention for indexing and regular CRUD operations. You can choose to do application level sharding to distribute these records across N databases. This way the number of records to deal with can be reduced leading to performance benefits. _

  3. Indexing Ensure higher level applications that talk to OpenSABER instance are aware of the indexed fields and only use them to search. In coming versions (post 2.0.0), OpenSABER will also enable capability to specify the indexed fields.

STEPS

  1. Install API Bench.
  2. Set the property perf.monitoring.enabled to true. This is to enable profiling.
  3. Build and start the registry application.
  4. Run the below commands in the base directory of this installation.

Commands

1. Add API

./apib -f input-file -c 5 -d 40 -H 'x-authenticated-user-token: authentication-token' URL

2. Read API

./apib -c 30 -d 40 -H 'x-authenticated-user-token: authentication-token' URL

Parameters Used

  1. -f - argument to pass the file name which contains the request body.
  2. -c - argument to indicate number of concurrent requests.
  3. -d - argument to indicate total duration of the test.
  4. -H - argument to provide headers in key:value format.
  5. input-file - This is the name of the file which contains the request body for this API call.
  6. authentication-token - This is the token used for authorising the request.
  7. URL - The URL of the API.