mysterious-kitchen-18431
04/09/2025, 12:54 PM401 Unauthorized
— which is expected since clients don't yet have a session token. The mobile apps then detect this and immediately initiate login flows to obtain tokens.
At the moment of this transition, I see a sudden spike of around 40,000 requests to Kratos, which then gradually decreases after the initial login burst.
We’re using bcrypt in Kratos for password hashing, and we’ve already tested it with different costs (12, 8, and even 4), but the results are the same: CPU usage spikes to 100%, and the instances become unresponsive during the login surge.
We initially tried AWS t4g.micro instances with horizontal scaling (30 instances), but they quickly hit 100% CPU and couldn’t keep up. Switching to c7g.2xlarge (15 instances) helped — they still hit 100% CPU but managed to keep processing the requests.
It seems like we might not be using the most suitable instance type for this workload.
What instance types do you recommend for running Ory Kratos in production, especially in cases with high burst login traffic like this?
Would love to hear what has worked for others in similar environments.
Thanks in advance!magnificent-energy-493
steep-lamp-91158