Performance Diagnosis Flowchart
Identify and fix performance issues with your ASP.NET Core application on Plesk Windows hosting.
Step 1: Where is the Slowness?
Initial page load is slow (5+ seconds)
→ Go to Section A: Cold Start Issues
→ Go to Section A: Cold Start Issues
All requests are slow
→ Go to Section B: General Performance
→ Go to Section B: General Performance
Database operations are slow
→ Go to Section C: Database Performance
→ Go to Section C: Database Performance
Occasional slowness/timeouts
→ Go to Section D: Intermittent Issues
→ Go to Section D: Intermittent Issues
Section A: Cold Start / Initial Load Slow
Causes & Solutions:
- Application Pool idle timeout
- Default: 20 minutes idle = app unloads
- Fix: Increase idle timeout in Plesk → Dedicated IIS Application Pool
- Large application / many dependencies
- Fix: Consider ReadyToRun compilation:
<PublishReadyToRun>true</PublishReadyToRun>
- Fix: Consider ReadyToRun compilation:
- JIT compilation on first request
- Fix: Use warmup scripts or Application Initialization
Section B: General Slow Performance
Check These Items:
- Enable compression
builder.Services.AddResponseCompression(); - Enable caching
builder.Services.AddResponseCaching(); builder.Services.AddOutputCache(); - Minify CSS/JS - Use bundling in production
- Optimize images - Use WebP format, lazy loading
- Check for synchronous I/O
- Use async/await for all I/O operations
- Review logging level
- Set to Warning or Error in production
Section C: Database Performance
Diagnostic Steps:
- N+1 Query Problem
- Symptom: Many small queries instead of one
- Fix: Use Include() for eager loading:
_context.Orders.Include(o => o.Items).ToListAsync()
- Missing indexes
- Fix: Add indexes to frequently queried columns
- Large result sets
- Fix: Implement pagination
.Skip(page * size).Take(size)
- Fix: Implement pagination
- Connection pooling issues
- Ensure DbContext is scoped (not singleton)
Section D: Intermittent Slowness
Possible Causes:
- Application Pool recycling
- Check: Plesk → Application Pool settings
- Review Private Memory Limit and recycling schedule
- Memory pressure
- Symptom: Slow after running a while
- Fix: Check for memory leaks, increase memory limit
- Garbage collection
- Large object allocations cause GC pauses
- Fix: Use ArrayPool, reduce allocations
Quick Wins Checklist
- ☐ Enable Response Compression
- ☐ Enable Output Caching
- ☐ Set logging to Warning level
- ☐ Use async/await everywhere
- ☐ Bundle and minify static files
- ☐ Add database indexes
- ☐ Implement pagination
- ☐ Review Application Pool memory limits