I’m running a .NET Web API and recently started facing issues where some requests are either timing out or failing intermittently. The issue seems to occur inconsistently, and I’m not sure if it’s related to server load, database queries, or API configurations.
Symptoms: Some API requests take too long to respond and eventually fail. Other requests fail immediately with 500 Internal Server Error. No clear error messages in logs except occasional timeout exceptions. the sql server connection is disconnected Note: after some time it reconnect and works successfully again by itself Note: we are connecting using https
Checked Logs: I enabled logging but didn’t find a clear root cause; sometimes, it just stops responding. Increased Timeout: I tried increasing the request timeout in both the client and server but still face issues. Optimized Queries: Some database queries were slow, so I added indexing and optimized them, but the problem persists. Monitored CPU & RAM: The server shows high memory usage when the issue occurs. Checked Concurrent Requests: The API is handling multiple requests at the same time, but the failure pattern is unclear.