Searching efficiently, getting occasional 503 timeout


We have an auth0 tenant with less than 10k users, and we have built a user administration page inside our app that paginates this list in chunks of 25 users. This query usually takes less than 600 ms.

Occasionally we get a 503 - which i understand to be a query that takes more than 2 seconds

 [{"status": "503", "detail": "The query exceeded the timeout. Please try refining your search criteria. See", "title": "Service Unavailable"}]

I have read the search best practices guide and think we’re doing everything correctly, but I wanted to see if someone would look at our query and see if we are doing something less efficiently than we should be. Again we’e only fetching 25 records at a time at maximum.


per_page 25
page 0
Included fields (family name, given name, email, last login, security info, user and app metadata, identities, created at)
include totals
sort on email
where connection name = chris

Are we asking for too many fields here? Any other insight into what may cause this query to return a 503? (We saw this yesterday twice btw, at 8:30am EST and at 3pm EST) and a total of 9 times in the last 30 days.

Thank you,

Chris Ward

The user search endpoint is limited to returning 1000 users ( so as mentioned at ( is not recommended to use overly general search criteria that is guaranteed to include a population of users greater than the previous limit.

What’s the use case for wanting to paginate over all the users of a specific connection without any other search criteria?

Thanks for answering - we are aware of the 1000 result maximum and that really isn’t a problem for us - we do have a search / filter functionality in the application - this is just the default view.

My main question is about the performance of the query itself. We receive 503's occasionally and were wondering if we could enhance the request to be more efficient, or if we were asking for too many fields. We are only ever returning 25 users per page, but the 503 would indicate that still is taking more than 2 seconds.

Any other insight on this?