Load Test FusionAuth
On this page
A load test shows whether FusionAuth meets your expected request volume before you go to production. The FusionAuth team tests FusionAuth performance regularly, but your configuration, data, and traffic differ from those tests.
Run the load test in an environment that matches your planned production environment. For example, when you plan to run a high-availability FusionAuth Cloud deployment in production, load test a high-availability deployment.
Choose a Load Testing Tool#
Any tool that makes HTTP requests works, such as Gatling or JMeter.
FusionAuth also publishes load testing scripts in the fusionauth-load-tests project. The FusionAuth team writes the scripts for internal use, so use the scripts at your own risk. The scripts support the following scenarios:
- Creating tenants
- Creating applications
- Registering users for applications
- Logging users in with the Login APIThe FusionAuth API that logs a user in without the hosted login pages.
- Completing the Authorization Code grantAn OAuth 2.0 grant type in which a client exchanges an authorization code for tokens.
Find the Bottleneck#
The bottleneck is usually the database or the FusionAuth nodes' CPU. Which one depends on the size of each component and the operations that you test. For example, logins and user creation use a lot of CPU, because FusionAuth hashes passwords during both operations. Monitor the database and the nodes during the test, and size each one for the load. For more information, see Monitor.
To check whether password hashing limits your logins per second, see Troubleshooting Performance.
Tips#
- Store your FusionAuth configuration as scripts that you can apply to an instance. You can then set up and tear down different deployments to compare the results.
- When you test several nodes behind a load balancer, turn off sticky sessions. FusionAuth doesn't need sticky sessions.
FusionAuth Cloud#
Before you load test a FusionAuth Cloud deployment, open a support ticket with the test dates. The FusionAuth team monitors CPU usage and other metrics, so advance notice of a stress test helps the team. When your plan includes support, you can also ask for help with sizing and testing in the ticket.
Don't load test a Basic Cloud deployment. A Basic Cloud deployment runs FusionAuth, Elasticsearch, and the PostgreSQL database on one compute node. The node has few resources to spare, so the results don't help you plan a production deployment.
Load test a Business Cloud or High-Availability Cloud deployment instead. When a standard deployment can't reach your target requests per second, create a deployment with larger nodes. You can create a deployment, apply your configuration, run the load test, and delete the deployment. FusionAuth Cloud charges only for the time the deployment runs.
Related
Learn how to create a FusionAuth Cloud account.
Learn how to delete your FusionAuth Cloud account.
Learn about the account portal, where you can manage account data, deployments, and licenses.
Learn about the pros and cons of FusionAuth Cloud compared to self-hosted FusionAuth.