Basic fix of performance tests and added README. Still requires work...

This commit is contained in:
mposolda 2014-05-30 10:57:47 +02:00
parent 9533bbc47d
commit 441c00c06f
3 changed files with 58 additions and 5 deletions

View file

@ -0,0 +1,39 @@
Configuration of performance test
=================================
- At this moment it's src/test/jmeter/keycloak_perf_test.jmx where you can configure among other things:
-- "ThreadGroup.num_threads" -- number of worker threads
-- "LoopController.loops" -- Number of loops per each thread.
- src/test/jmeter/system.properties -- System properties including configuration of providers. Allow to specify:
-- which model to use
-- which test to run
-- configuration of individual tests. Properties for each test documented in the file
Running performance tests
=========================
cd KEYCLOAK_HOME/testsuite
mvn clean install -DskipTests=true -Pperformance-tests
Results:
- Log is in: testsuite/performance/target/jmeter/logs/keycloak_perf_test.jmx.log
- More charts and reports are inside: testsuite/performance/target/jmeter/results/
Example for running test
========================
Run:
mvn clean install -DskipTests=true -Pperformance-tests
with OOTB configuration (Assumption is mongo running on 27017 as it's using mongo by default). This will create 10 new realms.
Then change keycloak_perf_test.jmx to have
"ThreadGroup.num_threads" to 10 and
"LoopController.loops" to 100
And change "keycloak.perf.workerClass" to "org.keycloak.testsuite.performance.CreateUsersWorker" in system.properties
Then run again:
mvn clean install -DskipTests=true -Pperformance-tests
This will create 1000 new users (10 worker threads and each worker doing 100 iterations. Each worker is creating users in separate realm)
TODO: Easier configuration without need to edit config files, more user friendly, easier to configure and run test

View file

@ -35,6 +35,16 @@
<artifactId>keycloak-model-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-model-jpa</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-model-mongo</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
@ -59,6 +69,10 @@
<artifactId>jaxrs-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.iharder</groupId>
<artifactId>base64</artifactId>
</dependency>
<dependency>
<groupId>org.apache.jmeter</groupId>
<artifactId>ApacheJMeter_java</artifactId>
@ -116,7 +130,7 @@
<dependencies>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-testsuite</artifactId>
<artifactId>keycloak-testsuite-performance</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
</dependency>

View file

@ -1,6 +1,6 @@
## Choose implementation of KeycloakSessionFactory
# keycloak.sessionFactory=picketlink
keycloak.sessionFactory=mongo
# keycloak.model.provider=jpa
keycloak.model.provider=mongo
## Configure JPA (just hbm2ddl schema configurable here. Rest of the stuff in META-INF/persistence.xml)
keycloak.jpa.hbm2ddl.auto=create
@ -10,9 +10,9 @@ keycloak.jpa.hbm2ddl.auto=create
## Configure MongoDB (Useful just when keycloak.sessionFactory=mongo)
keycloak.model.mongo.host=localhost
keycloak.model.mongo.port=27017
keycloak.model.mongo.databaseName=keycloakPerfTest
keycloak.model.mongo.db=keycloakPerfTest
# Should be DB dropped at startup of the test?
keycloak.model.mongo.dropDatabaseOnStartup=true
keycloak.model.mongo.clearOnStartup=false
## Specify Keycloak worker class