Skip to main content

Spring Boot Prompt for a Performance Tuning Playbook

Systematically optimize a Spring Boot app — JVM tuning, connection pools, query optimization, and caching — with before/after metrics.

Füllen Sie die Platzhalter aus

Edit the values, then copy your finished prompt.

Ihr Prompt
prompt.txt

                                

What this prompt does

This prompt turns the model into a methodical Spring Boot performance engineer. Instead of guessing at JVM flags, it forces a structured audit across ten layers — JVM and garbage collection, the Tomcat/Netty thread pool, the HikariCP connection pool, JPA/Hibernate batching, the Spring Cache abstraction, HTTP compression, async processing, slow-query optimization, profile-based config, and continuous profiling. Crucially, it asks for before/after metrics on every change so you can tell which optimizations actually earned their place.

The variables anchor the work to real numbers. You set [current_rps] and [current_p99] as your baseline and [target_rps] and [target_p99] as the goal, which keeps the model honest about whether a change closes the gap. [spring_version] and [db_type] shape the tuning advice (HikariCP defaults differ by database), [gc_algo] lets you compare collectors like ZGC against G1GC, and [cache_provider] with [cacheable_data] decide what gets cached and where. [async_candidates] and [profiler] round out the throughput and observability story.

When to use it

  • A Spring Boot service is missing its latency SLA and you need a systematic plan rather than ad-hoc tweaks.
  • You are sizing an app for higher traffic and want to know whether the JVM, the pool, or the queries are the bottleneck.
  • A new database ([db_type]) was introduced and connection-pool defaults need re-tuning.
  • You want to evaluate a GC change like [gc_algo] with measured evidence instead of folklore.
  • Onboarding to an unfamiliar codebase and you need a repeatable tuning checklist.
  • Preparing a performance review or capacity-planning document that needs before/after numbers.

Example output

Expect a layered report: one section per optimization area, each describing the current setting, the recommended change, and a before/after metric (throughput, p99, heap, GC pause, or pool wait). Slow queries arrive with EXPLAIN ANALYZE output for the top offenders, and the JVM section lists concrete flags with rationale. It reads like a tuning playbook you can execute and re-measure step by step.

Pro tips

  • Fill [current_rps] and [current_p99] with real measured numbers, not estimates — the whole before/after framing collapses if the baseline is invented.
  • Keep [cacheable_data] to data that is genuinely read-heavy and tolerant of staleness; caching volatile data with [cache_provider] causes correctness bugs, not speed.
  • When comparing [gc_algo] options, run each under representative load; ZGC and G1GC trade differently depending on heap size and pause sensitivity.
  • Be selective with [async_candidates] — only push fire-and-forget work like logging or analytics off the request thread, never anything the response depends on.
  • Match [spring_version] to your actual version, since thread-pool and Hibernate defaults shifted between releases and stale advice can mislead.
  • Treat the profiler step ([profiler]) as ongoing, not one-off; the bottleneck usually moves after the first round of fixes.

Frequently Asked Questions

Does this prompt actually run the optimizations or just recommend them?
It recommends and explains, but it cannot execute changes or run benchmarks for you. You apply each tuning step to your own environment and measure the before/after numbers yourself, then feed real results back to validate which changes helped.
Can I use it for a reactive WebFlux app instead of a servlet stack?
Yes, the prompt covers both Tomcat and Netty thread settings, so it adapts to reactive stacks. Be explicit about WebFlux in your inputs so the advice targets the event-loop model rather than the blocking servlet pool.
Why does it ask for before and after metrics on every change?
Because not every JVM flag or cache layer moves the needle, and some make things worse. Measuring each optimization independently keeps the work honest and tells you which changes are worth keeping in production.
Will the GC recommendations work without testing?
No. The prompt compares collectors like the ones in `[gc_algo]`, but the right choice depends on your heap size, pause tolerance, and load shape. Always benchmark the candidate collectors under representative traffic before committing.
Engr Mejba Ahmed

Need this built for real?

Engr Mejba Ahmed

AI Developer · Software Engineer

I'm Mejba — I design and ship production AI systems, automations, and full-stack apps. If you want this turned into a working solution for your team, let's talk.

Mehr in Java & Spring Boot Prompts

Engr Mejba Ahmed

Engr Mejba Ahmed

Claude Code Expert · Online

👋

Hey there!

Quick Actions

WhatsApp Instant reply

Chat on WhatsApp

+880 1723 741224 · Instant reply

Popular Questions

Engr Mejba Ahmed is connected
Engr Mejba Ahmed is typing...
Engr Mejba Ahmed avatar

✉ Want me to follow up? Drop your email

Engr Mejba Ahmed avatar

📞 Connect Directly

Choose how you'd like to reach me

WhatsApp

+880 1723 741224

Email

[email protected]

✓ Details sent! I'll get back to you shortly.

Powered by OpenAI

335+

Blog Posts

25

AI Courses

63

Projects

Services & Expertise

Pricing & Process

Learning & Resources

Connect & Support