Up to 10 M LOC
This page describes the architecture of a SonarQube Server instance that will support up to 10 million lines of code under normal usage patterns in a non-high availability setup.
Overview
This reference architecture covers the following components:
A virtual machine host with SonarQube Server (Developer or Enterprise Edition) installed and an nginx HTTPS proxy.
PostgreSQL database on a dedicated host.
Analysis integrated with GitHub Actions.
Authentication through GitHub.com.
Monitoring with Prometheus.
Outbound email notifications using an SMTP relay.

This architecture favors the use of open-source components when available. These may be substituted with other similarly capable components, and it is recommended that organizations use components that they are comfortable supporting.
SonarQube Server Host
The SonarQube Server Host will have the SonarQube Server software installed as well as nginx acting as an HTTPS proxy.
Database
This architecture utilizes a dedicated PostgreSQL database installed on a separate host.
Database requirements can vary widely based on the usage patterns of each SonarQube Server installation. Therefore, it is important to monitor and adjust database resources as needed.
PostgreSQL may be substituted with other supported database platforms.
DevOps/CI platform
Automated analysis of source code is enabled through the installation of the various SonarScanners into continuous integration pipelines. When using GitHub Actions, scanners are initiated through the repository’s workflow YAML file(s).
Upon analysis completion, SonarQube Server submits reports back to pull requests to integrate with code review processes. This functionality is enabled in GitHub.com using a GitHub App.
GitHub.com may be substituted with other supported DevOps and/or CI platforms without changes to other components in this architecture.
Authentication
It is recommended that authentication and authorization be handled through an external identity provider. The architecture utilizes the GitHub App to authorize users and synchronize access to SonarQube Server projects.
Other external identity providers such as SAML may be substituted. Features such as group and permission synchronization are not available for all authentication methods.
Monitoring
SonarQube Server exposes endpoints that are easy to monitor using Prometheus or other monitoring solutions. In addition to the overall system health of both the SonarQube Server host and database, it is recommended to monitor SonarQube Server’s Compute Engine performance statistics to ensure incoming analyses are being promptly processed.
Email notifications
Users can be notified of new issues and events via email. SonarQube Server will deliver these notifications through an SMTP mail relay. The volume of emails is low, dependent on the number of users subscribed, and a dedicated SMTP server is typically not required.
Resiliency
As a single-host installation, this architecture relies on robust monitoring, automated backups of the database, and a rapid recovery process to maximize resiliency. If high availability is critical, SonarQube Server Data Center Edition is recommended.
Scalability
This architecture is designed to support typical production usage for up to 10 million lines of code. Beyond this, it is recommended that organizations use SonarQube Server Enterprise Edition or Data Center Edition to support high-volume workloads.
The following use cases are considered outside of "normal usage" and may require additional capacity:
Related pages
Setting up monitoring(on Kubernetes)
Last updated
Was this helpful?