Performance and Optimization - VilnaCRM-Org/user-service GitHub Wiki
Welcome to the Performance and Optimization GitHub page, which is dedicated to showcasing our comprehensive approach to enhancing the efficiency and speed of our User Service application. Our goal is to share insights, methodologies, and results from rigorous testing and optimization processes to help developers achieve peak performance in their own applications.
Testing Environment
To ensure our User Service is optimized for high performance, we conducted extensive testing using standardized infrastructure on AWS. This approach allows us to identify bottlenecks, optimize code, and achieve significant performance improvements. By utilizing AWS for our testing environment, we ensure consistency and uniformity across all tests, enabling developers to work with the same setup and achieve comparable results. This unified testing framework provides a reliable foundation for evaluating performance, regardless of geographic location or hardware variations, ensuring all team members can collaborate effectively on optimization efforts. Below are the details of the hardware and software components used in our testing environment:
Server Specifications:
- Instance Type: c6i.4xlarge
- CPU: 16 core
- Memory: 32 GB RAM
- Storage: 30 GB
Software Specifications:
- Operating System: Ubuntu 24.04 LTS
- User Service Version: 2.3.0
- PHP Version: 8.3
- Symfony Version: 7.1/7.2
- Database: MariaDB 11.4
- Load Testing Tools: Grafana K6
Benchmarks
Here you will find the results of load tests for each User Service endpoint, with a graph, that shows how execution parameters were changing over time for different load scenarios. Also, the metric for Spike testing will be provided, alongside a table, that will show the most important of them.
Each endpoint was tested for smoke, average, stress, and spike load scenarios. You can learn more about them here. Also, you can find HTML files with load test reports here
The most important metrics for each test, which you'll find in tables include:
- Target rps: This number specifies the max requests per second rate, that will be reached during the test.
- Real rps: This number specifies the average requests per second rate, that was reached during a testing scenario.
- Virtual users: The number of simulated users accessing the service simultaneously. This helps in understanding how the application performs under different levels of user concurrency.
- Rise duration: The time period over which the load is gradually increased from zero to the desired number of requests per second or virtual users. This helps to observe how the system scales with increasing load.
- Plateau duration: The time period over which the load is holding the peak load. This helps to monitor the system's ability to handle the constant load gracefully.
- Fall duration: The time period over which the load is gradually decreased back to zero from the peak load. This helps to monitor the system's ability to gracefully handle the reduction in load and ensure there are no residual issues.
- P(99): This number specifies the time, which it took for 99% of requests to receive a successful response.
REST API
- Get User
- Get User Collection
- Create User
- Create User Batch
- Confirm User
- Replace User
- Update User
- Delete User
- Resend Confirmation Email To User
- OAuth
- Health
GraphQL
- Get User
- Get User Collection
- Create User
- Confirm User
- Update User
- Delete User
- Resend Confirmation Email To User
Get User Test
Target RPS | Real RPS | Virtual Users | Rise Duration | Fall Duration | P(99) |
---|---|---|---|---|---|
400 | 62 | 400 | 10s | 10s | 6ms |
Get User Collection Test
Target RPS | Real RPS | Virtual Users | Rise Duration | Fall Duration | Users retrieved with each request | P(99) |
---|---|---|---|---|---|---|
400 | 62 | 400 | 10s | 10s | 50 | 13ms |
Create User Test
Target RPS | Real RPS | Virtual Users | Rise Duration | Fall Duration | P(99) |
---|---|---|---|---|---|
200 | 24 | 200 | 10s | 10s | 3s |
Create User Batch Test
Target RPS | BatchSize | Real RPS | Virtual Users | Rise Duration | Fall Duration | P(99) |
---|---|---|---|---|---|---|
200 | 10 | 9 | 200 | 10s | 10s | 8s |
Confirm User Test
Target RPS | Real RPS | Virtual Users | Rise Duration | Fall Duration | P(99) |
---|---|---|---|---|---|
200 | 75 | 200 | 10s | 10s | 10ms |
Replace User Test
Target RPS | Real RPS | Virtual Users | Rise Duration | Fall Duration | P(99) |
---|---|---|---|---|---|
200 | 23 | 200 | 10s | 10s | 3s |
Update User Test
Target RPS | Real RPS | Virtual Users | Rise Duration | Fall Duration | P(99) |
---|---|---|---|---|---|
200 | 23 | 200 | 10s | 10s | 4s |
Delete User Test
Target RPS | Real RPS | Virtual Users | Rise Duration | Fall Duration | P(99) |
---|---|---|---|---|---|
400 | 47 | 400 | 10s | 10s | 10ms |
Resend Confirmation Email To User Test
Target RPS | Real RPS | Virtual Users | Rise Duration | Fall Duration | P(99) |
---|---|---|---|---|---|
200 | 22 | 200 | 10s | 10s | 4s |
OAuth Test
Target RPS | Real RPS | Virtual Users | Rise Duration | Fall Duration | P(99) |
---|---|---|---|---|---|
400 | 48 | 400 | 10s | 10s | 87ms |
Health Test
Target RPS | Real RPS | Virtual Users | Rise Duration | Fall Duration | P(99) |
---|---|---|---|---|---|
200 | 40 | 200 | 10s | 10s | 8ms |
GraphQL Get User Test
Target RPS | Real RPS | Virtual Users | Rise Duration | Fall Duration | P(99) |
---|---|---|---|---|---|
400 | 62 | 400 | 10s | 10s | 25ms |
GraphQL Get User Collection Test
Target RPS | Real RPS | Virtual Users | Rise Duration | Fall Duration | Users retrieved with each request | P(99) |
---|---|---|---|---|---|---|
400 | 62 | 400 | 10s | 10s | 50 | 15ms |
GraphQL Create User Test
Target RPS | Real RPS | Virtual Users | Rise Duration | Fall Duration | P(99) |
---|---|---|---|---|---|
200 | 24 | 200 | 10s | 10s | 3s |
GraphQL Confirm User Test
Target RPS | Real RPS | Virtual Users | Rise Duration | Fall Duration | P(99) |
---|---|---|---|---|---|
200 | 76 | 200 | 10s | 10s | 14ms |
GraphQL Update User Test
Target RPS | Real RPS | Virtual Users | Rise Duration | Fall Duration | P(99) |
---|---|---|---|---|---|
200 | 23 | 200 | 10s | 10s | 3s |
GraphQL Delete User Test
Target RPS | Real RPS | Virtual Users | Rise Duration | Fall Duration | P(99) |
---|---|---|---|---|---|
400 | 47 | 400 | 10s | 10s | 11ms |
GraphQL Resend Confirmation Email To User Test
Target RPS | Real RPS | Virtual Users | Rise Duration | Fall Duration | P(99) |
---|---|---|---|---|---|
200 | 22 | 200 | 10s | 10s | 3s |
Learn more about Performance-and-Optimization-(frankenphp).