Hi people <#C012RBW0F18|hydra>, I'm curious how fa...
# talk-hydra
p
Hi people #hydra, I'm curious how fast should be Refresh Token Rotation(obtaining a token by a refresh token). I'm currently using Hydra with PostgreSQL and my env is: 4 pods of hydra in a cluster that takes less than 30% of CPU usage all the time, DB (General Purpose, D16s_v3, 16 vCores, 64 GiB RAM, 1048576 storage) I did load testing and got the next results. 1) 50 parallel requests - gives me ~75 requests/seconds 1) 100 parallel requests - gives me ~70 requests/seconds 2) 200 parallel requests - gives me ~60 requests/seconds (load to DB is getting higher.. ) In my opinion is too slow but maybe I'm wrong. Any suggestions or ideas are welcome.
h
Tune your BCrypt performance for higher throughput, and also ensure that the database is configured correctly. Ory Hydra can handle thousands of requests per second if configured correctly! https://www.ory.sh/docs/hydra/benchmark
p
Thanks but I already saw it. To me... these synthetic tests say nothing without connecting to real storage... as the performance greatly differs... I would like to hear about more realistic results...
h
Well, that really depends on your set up, database, connectivity. For example, we run much higher throughput than you can achieve on Docker with optimized deployments. Hydra itself is capable of handling tens of thousands of RPS with an optimal data storage. The trick will be on your end to find the right parameters that work for your environment well to achieve optimal performance: 1. Do you co-locate the database 2. What SQL connection properties do you set around connection limits 3. What SQL database type do you use and with what storage engine etc etc
A lot of through put can also be lost on the way, for example you say “cluster” but that could also mean that your ingress is for example limiting connections - what I want to say it very much depends on your environment. It probably makes sense to push Hydra to its limits when you reach them, but rest assured that Hydra has a lot of buffer available to handle tens, if not hundrets of thousands of requests per second if operated correctly
👍 1
h
This is a nice topic. I never do some test with hydra before. May I trying, too.
p
1. Do you co-locate the database 2. What SQL connection properties do you set around connection limits 3. What SQL database type do you use and with what storage engine 1. - yes (single database for all the pods) 2. - my connection string looks like: postgres://myDB:blablabla.postgres.database.azure.com:PORT/myDB?sslmode=require&max_conns=20 I tried to play with max_conns params increased it to 30, 40 but it did not get any result 3. Azure env, PostgreSQL flexible server (D16s_v3, 16 vCores, 64 GiB RAM, 1048576 storage) I believe all configuration for DB is set as default one... what else can be useful that I can provide to understand where to look for the reason for this?
h
You have 20 max conns, but do 200 parallel requests, so every connection to the database is handling 10 clients, which is probably bringing the throughput way down
h
In my case, I try to do a load test on introspecting token API with 50 users. I saw API response slow around 4~5s. @User Do you have any suggestions for me?
h
Probably your issue is with BCrypt
h
OK, thanks. I will check and let you know later
@User OK. it works 🙂 No performance issue. Thank you again.