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 11 views 11 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 Lenovo’s ThinkPad X 1 Carbon has rewrite my MacBook Pro February 5, 2025 Bots now dominate the web and this is a copy of a problem February 5, 2025 Bots now dominate the web and this is a copy of a problem February 5, 2025 Bots now dominate the web, and this is a problem February 4, 2025 DIPSEC and HI-STECS GLOBAL AI Race February 4, 2025 DEPSEC SUCCESS TICTOKE CAN RUNNING TO PUPPENSE TO RESTITE January 29, 2025 Leave a Comment Cancel Reply Save my name, email, and website in this browser for the next time I comment.