gravitee-io / issues

Gravitee.io - API Platform - Issues
64 stars 26 forks source link

[management] search user may fail with timeout error #7098

Open leleueri opened 2 years ago

leleueri commented 2 years ago
  1. 💥 Describe the bug

With a huge amount of users, search request may end in timeout due to the count request made to know the number of users. In order to avoid this behaviour, we should apply a limit (ex: 1000) to the count request. As a consequence the number of page display into the UI table will not be accurate but we assume that is there are more than 1000 entries, the AM will search using more restrictive values.

Also, take the opportunity of this issue to review default settings about connection timeout for mongo (sockerTimeout, connectionTimeout...)

leleueri commented 2 years ago

Root cause

search time is very long because of the case insensitive search... By default we create indexes to be case sensitive but we search users with the insensitive option so the index isn't used as it should be.

How to create case insensitive indexes

Here is the documentation about how to create a case insensitive index and how to execute a query using this index : https://docs.mongodb.com/manual/core/index-case-insensitive/