Lesson Learned #511: Timeout Attempting to Open the Connection in High-Thread Applications by info.odysseyx@gmail.com October 30, 2024 written by info.odysseyx@gmail.com October 30, 2024 0 comment 17 views 17 Recently I handled a service call where a customer application reported the following error connecting to the database.A timeout occurred while attempting to open the connection. The time elapsed before attempting to open a connection was exceeded. This may be caused by too many concurrent connection attempts that are not pooled.“. Next, I would like to share the experience I learned here. Through our work with our customers, we have seen that this application has a high workload, with multiple threads performing numerous concurrent database requests at the same time. In this situation, we observed that the application does not use connection pooling. This means that each new request is opening a new connection to the database. The multi-threaded design of the application, combined with the volume of requests, quickly exceeded the capacity of the customer’s system to handle non-pooled connections, resulting in connection attempt timeouts. After the recommendation to use connection pooling, we were able to solve this problem by using connection pooling active database connections instead of establishing a new connection for each request. This can significantly improve performance and reduce latency. Without pooling, every thread must establish a connection individually, which increases overhead and risks timeout errors when requests are frequent. In this particular situation, we suggested enabling connection pooling and then reviewing the database connection settings for multiple applications. Maximum pool size adjustmentproper definition maximum pool size Depending on the load of your application. This parameter sets the maximum number of connections in the pool, which helps control the number of active connections and prevent excessive resource consumption. Monitor and adjust timeout settingsEvaluation and Adjustment Connection timed out Specify values as needed. If you set the timeout too low, minor delays can cause unnecessary errors, and if the timeout is too high, it can mask connectivity issues that you need to fix yourself. Connection Lifecycle AuditEnsure that connections are properly closed or returned to the pool when they are no longer needed. Open connections that are not closed can quickly exhaust the pool, causing similar timeout issues. Source link Share 0 FacebookTwitterPinterestEmail info.odysseyx@gmail.com previous post Know your skills and grow them next post IPv6 updates for Exchange Online You may also like Believe Hyp about Quantum Protection: Report March 11, 2025 Google Jemi is coming to Android Auto but the rollout is hassle March 10, 2025 How the drones are transmitting security on the US southern border March 7, 2025 Remember a uninterrupted tech trailballs: Tom Mitchell March 7, 2025 New HMD X 1 ‘Safe’ Phone: Protection for Parents, Great Factors for Kids March 5, 2025 Opera adds Agent AI to his browser March 4, 2025 Leave a Comment Cancel Reply Save my name, email, and website in this browser for the next time I comment.