Most API latency problems = opening too many SQL connections.
๐ Fix
Use a single pooled client:
builder.Services.AddDbContext<AppDb>(options =>
options.UseSqlServer(connString, o => o.EnableRetryOnFailure()));
โจ Benefits
-
โก Fast connection acquisition
-
๐ Lower CPU
-
๐งต Stable high-load behavior
๐ก Bonus
Use Max Pool Size=200 in connection string for heavy systems.
