I have a Sitecore instance Version 8.2 Update 3 in my local PC. When the CMS or live is not visited or idle for a while and I browse it again, the page doesn't load and shows this error:

Cannot open database "MySiteSitecore_Web" requested by the login. The login failed. Login failed for user 'sa'.

After refreshing a few times or loading the page in another tab, it then shows this error:

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.

Again after refreshing the page or loading it in another tab will finally load the CMS/live site correctly.

It was working fine but recently started behaving this way and this happens frequently.

What could be the reason and how can I fix this?

  • You can set app pool to never recycle after idle time ( serverfault.com/questions/333907/… ). But it's a workaround, not fix for your problem.
    – Marek Musielak
    Commented Jan 5, 2018 at 13:49
  • Okay. I have never experienced this issue with my other instances
    – sukesh
    Commented Jan 5, 2018 at 13:54
  • 2
    Maybe this instance has a massive amount of records in the EventQueue and History tables - causing a long delay on startup due to SQL being overworked to catch up.
    – Mark Cassidy
    Commented Jan 5, 2018 at 14:00
  • I agree with Mark and Adam. I had an eventqueue that had about 1 million items and the site just kept spinning until i cleared the eventqueue and reset IIS.
    – Gabbar
    Commented Feb 11, 2018 at 1:40

4 Answers 4


As Mark had said this is likely data related and due to too much processing being done to allow SQL to spin up in time. A few things you can try:

1) clear down the even queue and history tables.

2) run the reindex/rebuild commands and set this up as a maintenance plan

3) look at the max connections value in the connections string config and perhaps increase it


Thanks Adam your answer guide me for the solution , for me I did the following steps :

  1. Restart the website on IIS
  2. Clear all browser cache
  3. Go to Sitecore.config find PagePreview.MaxSessionsCount tag and increase value

I got this error while setting up our clients new production environment, where we had 5 publishing targets. It turned out to be an issue was with one of the publishing targets SQL connections. I suggest incrementally removing publishing target connection strings or changing the connection parameter's to point to the publishing target which you believe is the most likely to be configured correctly. Once the error message goes away you can incrementally add them back.


In our case our SQL server was being blocked by a firewall. We were able to troubleshoot this by testing the connection from the app server to the SQL server using a Microsoft Data Link connection.

  • Open a Notepad and save your file as .udl. Double click the file and populate your connection string values. Click "Test Connection"

In our case we had two SQL servers. The one associated with our Sitecore databases failed & the other one connected without issue proving to us that this error message was due to something blocking our connection.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.