https://www.ory.sh/ logo
#talk-hydra
Title
# talk-hydra
p

plain-lunch-71625

03/01/2022, 5:51 PM
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

high-optician-2097

03/01/2022, 7:25 PM
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

plain-lunch-71625

03/01/2022, 7:47 PM
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

high-optician-2097

03/02/2022, 7:44 AM
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

hallowed-postman-21092

03/02/2022, 3:42 PM
This is a nice topic. I never do some test with hydra before. May I trying, too.
p

plain-lunch-71625

03/02/2022, 7:31 PM
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

high-optician-2097

03/03/2022, 7:53 AM
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

hallowed-postman-21092

03/03/2022, 6:28 PM
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

high-optician-2097

03/03/2022, 8:45 PM
Probably your issue is with BCrypt
h

hallowed-postman-21092

03/04/2022, 3:37 AM
OK, thanks. I will check and let you know later
@User OK. it works 🙂 No performance issue. Thank you again.
3 Views