Timeout after logging in when loading dashboard

We have a total of 312 sites loaded into Piwik, only 2 or 3 of which get substantial traffic. I had the default set to show the “all sites” dashboard upon login with the admin account. It was loading slowly, but loading, until recently, and now I get the following error:

Fatal error: Maximum execution time of 300 seconds exceeded in C:\inetpub\wwwroot\piwik\libs\Zend\Db\Statement\Pdo.php on line 228
Fatal error: Maximum execution time of 300 seconds exceeded in C:\inetpub\wwwroot\piwik\libs\Zend\Session.php on line 677

How can I address this?

Are you already using the cron archiving script? If not you should, it will make piwik extremely fast by pre-processing reports: How to Set up Auto-Archiving of Your Reports - Analytics Platform - Matomo

The “All websites” page being slow to load is then another problem, which was just fixed in SVN a few days ago.
The page can now load thousands of websites in a few seconds.

if you update to latest beta (which works fine) you can enjoy a very fast “all websites” dashboard (assuming you setup cron script as explained in doc above).
See 301 Moved Permanently