All pooled connections were in use

8 месяцев назад
Hi.

We are running the latest nopCommerce version 4.60.4.

Windows Server 2022
Intel Xeon Gold 6326 CPU @ 2.90 GHZ 2.89 GHz
32 GB ram

SQL Server hosted on same machine, limited to 16 GB of ram.

50~ sites running on the same nopCommerce instance.

We have set Max Pool Size to 200 and we have MultipleActiveResultSets set to true.

Often we are experiencing slowdowns on the sites multiple times a day, with the following error showing in the Event Viewer:
"System.InvalidOperationException: Timeout expired.  The timeout period elapsed prior to obtaining a connection from the pool.  This may have occurred because all pooled connections were in use and max pool size was reached."

I have seen this mentioned in the nop forums before, but none of the solutions provided work for me. I have tried experiencing with increasing the Max Pool size, but that just seems to make it worse.
8 месяцев назад
In general, it's not usually a good idea to have "SQL Server hosted on same machine". Especially if you are running "50~ sites".  In any case, I think you may need troubleshoot this as a database problem:

Database Performance: If your database server is under heavy load, it might not be able to provide connections in a timely manner. Monitor the performance of your database server to see if it's experiencing high CPU, memory, or disk usage.

Do you have custom code? ...
Connection Leaks:   Make sure that you are properly disposing of database connections after using them. Not releasing connections can lead to connection leaks and eventually exhaust the connection pool.

Long-Running Queries: If your application is executing long-running database queries, it can tie up connections in the pool.  You may need to create additional database indexes to improve query performance.