Performance and Optimization (frankenphp) - 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

GraphQL

Get User Test

Target RPS Real RPS Virtual Users Rise Duration Fall Duration P(99)
400 56 400 10s 10s 3ms

image image

Go back to navigation

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 9ms

image image

Go back to navigation

Create User Test

Target RPS Real RPS Virtual Users Rise Duration Fall Duration P(99)
200 32 200 10s 10s 23ms

image image

Go back to navigation

Create User Batch Test

Target RPS BatchSize Real RPS Virtual Users Rise Duration Fall Duration P(99)
200 10 14 200 10s 10s 5s

image image

Go back to navigation

Confirm User Test

Target RPS Real RPS Virtual Users Rise Duration Fall Duration P(99)
200 76 200 10s 10s 3ms

image image

Go back to navigation

Replace User Test

Target RPS Real RPS Virtual Users Rise Duration Fall Duration P(99)
200 35 200 10s 10s 31ms

image image

Go back to navigation

Update User Test

Target RPS Real RPS Virtual Users Rise Duration Fall Duration P(99)
200 35 200 10s 10s 82ms

image image

Go back to navigation

Delete User Test

Target RPS Real RPS Virtual Users Rise Duration Fall Duration P(99)
400 37 400 10s 10s 4ms

image image

Go back to navigation

Resend Confirmation Email To User Test

Target RPS Real RPS Virtual Users Rise Duration Fall Duration P(99)
200 37 200 10s 10s 21ms

image image

Go back to navigation

OAuth Test

Target RPS Real RPS Virtual Users Rise Duration Fall Duration P(99)
400 48 400 10s 10s 8ms

image image

Go back to navigation

Health Test

Target RPS Real RPS Virtual Users Rise Duration Fall Duration P(99)
200 40 200 10s 10s 6ms

image image

Go back to navigation

GraphQL Get User Test

Target RPS Real RPS Virtual Users Rise Duration Fall Duration P(99)
400 62 400 10s 10s 3ms

image image

Go back to navigation

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 8ms

image image

Go back to navigation

GraphQL Create User Test

Target RPS Real RPS Virtual Users Rise Duration Fall Duration P(99)
200 32 200 10s 10s 56ms

image image

Go back to navigation

GraphQL Confirm User Test

Target RPS Real RPS Virtual Users Rise Duration Fall Duration P(99)
200 76 200 10s 10s 7ms

image image

Go back to navigation

GraphQL Update User Test

Target RPS Real RPS Virtual Users Rise Duration Fall Duration P(99)
200 35 200 10s 10s 27ms

image image

Go back to navigation

GraphQL Delete User Test

Target RPS Real RPS Virtual Users Rise Duration Fall Duration P(99)
400 47 400 10s 10s 5ms

image image

Go back to navigation

GraphQL Resend Confirmation Email To User Test

Target RPS Real RPS Virtual Users Rise Duration Fall Duration P(99)
200 37 200 10s 10s 21ms

image image

Go back to navigation

Learn more about Comparing-Load-Test-Results:-PHP‐FPM-vs.-FrankenPHP.