# Get all users poor response time

**URL:** <https://forum.keycloak.org/t/get-all-users-poor-response-time/21905>\
**Category:** Getting advice\
**Created:** [May 4, 2023, 1:55pm UTC](https://forum.keycloak.org/t/get-all-users-poor-response-time/21905 "2023-05-04T13:55:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![medamineriahi](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/medamineriahi/32/6785_2.png) [@medamineriahi](https://forum.keycloak.org/u/medamineriahi)\
**Post date:** [May 4, 2023, 1:55pm UTC](https://forum.keycloak.org/t/get-all-users-poor-response-time/21905/1 "2023-05-04T13:55:29Z")

</div>

Dear Keycloak community,

I am writing to seek your help regarding a performance issue I am experiencing when trying to retrieve all users from Keycloak. Currently, I am using Keycloak version 19.0.3 and a PostgreSQL database, but when I try to fetch 100 users, the response time ranges from 22 to 40 seconds, which is significantly slower than what I would expect. I am hoping that someone in the community can help me find a solution to improve the response time.

If anyone has experienced a similar issue or has any ideas on how to optimize the performance, I would greatly appreciate your input. Thank you in advance for your help!

---

<div class="post-metadata">

**Author:** ![weltonrodrigo](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/weltonrodrigo/32/3104_2.png) [@weltonrodrigo](https://forum.keycloak.org/u/weltonrodrigo)\
**Post date:** [May 5, 2023, 7:50pm UTC](https://forum.keycloak.org/t/get-all-users-poor-response-time/21905/2 "2023-05-05T19:50:21Z")

</div>

Hi,

this is very much not expected. I’d check memory limits for the keycloak instance and for the postgres database.

---

<div class="post-metadata">

**Author:** ![dasniko](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/dasniko/32/2969_2.png) [@dasniko](https://forum.keycloak.org/u/dasniko)\
**Post date:** [May 6, 2023, 8:00am UTC](https://forum.keycloak.org/t/get-all-users-poor-response-time/21905/3 "2023-05-06T08:00:20Z")

</div>

Do your users have a large number of roles or groups associated?  
And gets the response time faster, if you do repeated calls?

---

<div class="post-metadata">

**Author:** ![dasniko](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/dasniko/32/2969_2.png) [@dasniko](https://forum.keycloak.org/u/dasniko)\
**Post date:** [May 8, 2023, 4:13pm UTC](https://forum.keycloak.org/t/get-all-users-poor-response-time/21905/5 "2023-05-08T16:13:06Z")

</div>

> [@medamineriahi](#):
>
> Additionally, I would like to inform you that we are retrieving most of our users from an LDAP server ,which may also impact the response time right ?

Most probably, that’s the root cause.

---

<div class="post-metadata">

**Author:** ![medamineriahi](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/medamineriahi/32/6785_2.png) [@medamineriahi](https://forum.keycloak.org/u/medamineriahi)\
**Post date:** [May 11, 2023, 12:15pm UTC](https://forum.keycloak.org/t/get-all-users-poor-response-time/21905/6 "2023-05-11T12:15:26Z")

</div>

i have deleted the ldap provider i’m also getting a a slow response time when getting all users, what do u suggest me to do ?  
to improve the response time any ideas ?
