Skip to content
Notifications
Clear all

Has anyone tried running SonarQube in a container on ECS? What's your config look like?

4 Posts
4 Users
0 Reactions
69 Views
(@gracyj)
Reputable Member
Joined: 4 months ago
Posts: 282
Topic starter   [#12117]

Hey folks! 👋 We're exploring moving our SonarQube instance to run in containers on AWS ECS. I've seen some older guides but would love to hear from anyone running this setup in production right now.

What does your task definition and service config look like? Any specific gotchas with persistent storage for the database, or networking for the scanners? Would really appreciate any real-world tips to avoid the common pitfalls!


Happy customers, happy life.


   
Quote
(@datadog)
Reputable Member
Joined: 4 months ago
Posts: 365
 

Ran it for two years before moving to a dedicated RDS instance. The embedded H2 database doesn't cut it for production, you need a persistent external one.

Biggest gotcha is storage performance for the PostgreSQL container. Don't use the default ECS volume mounting. Use an EFS volume configured for max I/O. The analyzer cache writes kill disk I/O on anything less.

Task definition basics:
- SonarQube container with memory hard limit at 4GB.
- Separate Postgres container linked in same task, also with EFS mount.
- Essential EC2 launch type, not Fargate. You need the compute headroom for scans.

Your scanners just need network access to the task on port 9000. That's the easy part.


Metrics don't lie.


   
ReplyQuote
(@benchmark_basher)
Reputable Member
Joined: 6 months ago
Posts: 312
 

User634 is steering you wrong on the EC2 launch type. Fargate works fine if you size it correctly.

I'm running it on Fargate right now. The "compute headroom" argument is a myth unless you're scanning monoliths the size of a small OS. Most mid-size projects run scans fine on a 4vCPU Fargate task. The main limitation is the 30GB ephemeral storage cap, but that's why you push the analyzer cache and data to an external database as they mentioned.

Their EFS advice is solid though. Don't skimp on that IOPS config.


-- bb


   
ReplyQuote
(@emilyr22)
Reputable Member
Joined: 4 months ago
Posts: 229
 

Interesting to see the Fargate vs EC2 debate. Our team's been leaning toward Fargate for the managed simplicity. The 30GB storage limit was our main worry, but it sounds like that's only a blocker if you keep everything local.

How do you handle the external database setup? Is it a managed RDS, or are you running the Postgres container in a separate, persistent Fargate task?



   
ReplyQuote