# Keycloak Performance Tuning - Postgres | Infinispan | Quarkus

**URL:** <https://forum.keycloak.org/t/keycloak-performance-tuning-postgres-infinispan-quarkus/15428>\
**Category:** Miscellanaeous\
**Created:** [May 9, 2022, 7:48am UTC](https://forum.keycloak.org/t/keycloak-performance-tuning-postgres-infinispan-quarkus/15428 "2022-05-09T07:48:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Romil](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/romil/32/5286_2.png) [@Romil](https://forum.keycloak.org/u/Romil)\
**Post date:** [May 9, 2022, 7:48am UTC](https://forum.keycloak.org/t/keycloak-performance-tuning-postgres-infinispan-quarkus/15428/1 "2022-05-09T07:48:28Z")

</div>

Hello,

I am exploring if there are any performance tuning recommendations by Keycloaok regarding Postgres / Infinispan / Quakus or it’s more left up to individual tech stacks to be tuned as per their documentation?

Any view on how to configure Keycloak Quarkus ? I don’t see any configuration file under the KC deployment folder structure.

Thanks,  
Romil Shah

---

<div class="post-metadata">

**Author:** ![Romil](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/romil/32/5286_2.png) [@Romil](https://forum.keycloak.org/u/Romil)\
**Post date:** [May 16, 2022, 2:05pm UTC](https://forum.keycloak.org/t/keycloak-performance-tuning-postgres-infinispan-quarkus/15428/2 "2022-05-16T14:05:56Z")

</div>

Any views? recommendation?

---

<div class="post-metadata">

**Author:** ![xgp](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/xgp/32/2589_2.png) [@xgp](https://forum.keycloak.org/u/xgp)\
**Post date:** [May 16, 2022, 4:21pm UTC](https://forum.keycloak.org/t/keycloak-performance-tuning-postgres-infinispan-quarkus/15428/3 "2022-05-16T16:21:17Z")

</div>

I don’t believe there is documentation on this anywhere. Do you have a specific performance problem with the default setup that you are trying to tune for?

---

<div class="post-metadata">

**Author:** ![Romil](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/romil/32/5286_2.png) [@Romil](https://forum.keycloak.org/u/Romil)\
**Post date:** [May 17, 2022, 6:17am UTC](https://forum.keycloak.org/t/keycloak-performance-tuning-postgres-infinispan-quarkus/15428/4 "2022-05-17T06:17:59Z")

</div>

I was trying to run the client credential flow using Keycloak and observed response time to be on an average 110 ms for a high volume load (200K token request in an hr ~ 600 TPS )  
Currently have 3 instances of Keycloak running and CPU utilization is less than 50%  
Wondering if increasing the Quarkus io thread would be of help? Documentation says

```auto

`quarkus.http.io-threads`

The number if IO threads used to perform IO. This will be automatically set to a reasonable value based on the number of CPU cores if it is not provided. If this is set to a higher value than the number of Vert.x event loops then it will be capped at the number of event loops. In general this should be controlled by setting quarkus.vertx.event-loops-pool-size, this setting should only be used if you want to limit the number of HTTP io threads to a smaller number than the total number of IO threads.

```

Or any other tuning at Quarkus to reduce the overall response time?

Thoughts?

---

<div class="post-metadata">

**Author:** ![xgp](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/xgp/32/2589_2.png) [@xgp](https://forum.keycloak.org/u/xgp)\
**Post date:** [May 17, 2022, 6:59am UTC](https://forum.keycloak.org/t/keycloak-performance-tuning-postgres-infinispan-quarkus/15428/5 "2022-05-17T06:59:54Z")

</div>

Requests like that to the token endpoint do take a bit longer, as they have to verify the credentials, which is processing intensive. I don’t know that adding threads under that load would make as much of a difference as just adding nodes.
