Introduction
Almost 2 years ago, I built a performance test framework that drives the Knox Gateway configured by different use cases. At that time, I implemented one use case that acquires/renews/uses Knox tokens. You can read this article for further details.
In this post, I'll explain how that performance test tool was used to measure some of the key metrics of Knox's token management feature such as response times, memory consumption, etc...
Configuration
The performance test framework's properties were modified as follows:
perf.test.usecase.knoxtoken.numOfThreads=10 perf.test.usecase.knoxtoken.testDurationInSecs=3600 perf.test.usecase.knoxtoken.requestDelayLowerBoundInSecs=3 perf.test.usecase.knoxtoken.requestDelayUpperBoundInSecs=6
Additionally, I wanted to measure the newest token management backend that persists token information in a relational database (PostgreSQL 10, in this test) instead of Zookeeper or local keystores. To be able to do that I'd to add the following configuration in gateway-site.xml
:
<property> <name>gateway.service.tokenstate.impl</name> <value>org.apache.knox.gateway.services.token.impl.JDBCTokenStateService</value> </property> <property> <name>gateway.database.type</name> <value>postgresql</value> </property> <property> <name>gateway.database.connection.url</name> <value>jdbc:postgresql://smolnar.local:5432/postgres?user=postgres</value> </property>
Test results
1.) 1-hour test execution with a medium-size load (tokens were generated between 3-6 seconds):
Number of tokens created | Number of tokens renewed | Average response time (token creation)* | Average response time (token renewal) |
---|---|---|---|
7306 | 346 | 64.77 ms | 15.53 ms |
Memory graph (using JConsole)
JSON/YAML result files: testResults.zip
2.) 2-hour test execution with a medium-size load (tokens were generated between 3-6 seconds):
Number of tokens created | Number of tokens renewed | Average response time (token creation)* | Average response time (token renewal) |
---|---|---|---|
17740 | 845 | 52.47 ms | 12.19 ms |
Memory graph (using JConsole)
JSON/YAML result files: testResult.zip
*: There is a short warmup period at the beginning of each test round (see test results where token creation time takes ~2 seconds a couple of times). We could even see better results if those values were not recorded at the end (the longer the test period the better the average result is).