Case 1 - Image manager not loading in DNN DNN Version: 07.00.05 - Community Edition Symptoms Image manager, document manager or any other file manager within the HTML Editor were not loading. It kept displaying the loading animation and nothing else would come up. The File Manager under Admin/File Manager would show up, but when you tried to expand the Site Root tree view, it would not expand and the small loading animation wouldn't stop, showing that it was still trying to load the folders. Troubleshooting By utilizing Fiddler, we could see that there was a timeout problem after we waited for the image manager to load for about 3 minutes. Usually a timeout problem means that there was just too much information getting loaded or a slow connection somewhere. We went on to have a look at the database size, which we do by default during our initial task assessment, by using the script below: SELECT (SIZE / CONVERT(REAL, 1048576/(SELECT LOW FROM master.dbo.spt_values WHERE number = 1 AND type = 'E' ))) as SizeInMB, Name, DB_NAME() AS DataBaseName, Filename FROM sysfiles For some reason the database was huge. Just around 8GB. That really became a big red flag. We wanted to find out which table or tables had most data to give such an impact on the database size. So we run the script below to find out: SELECT Coalesce(8 * Sum(CASE WHEN si.indid IN (255) THEN si.reserved END), 0) AS blob_kb , 8 * Sum(CASE WHEN si.indid IN (0, 1) THEN si.reserved END) AS data_kb , Coalesce(8 * Sum(CASE WHEN si.indid NOT IN (0, 1, 255) THEN si.reserved END), 0) AS index_kb , so.name FROM dbo.sysobjects AS so JOIN dbo.sysindexes AS si ON (si.id = so.id) WHERE 'U' = so.type GROUP BY so.name ORDER BY 8 * Sum(CASE WHEN si.indid IN (0, 1) THEN si.reserved END) Desc That has shown us that the Users table was the biggest table on the database. We run the script below to find the number of users on the table: SELECT COUNT(*) FROM Users We found out the table had over 180,000 users. That is a huge number. Unless you have a VERY popular site otherwise that was the problem, at least a problem. We ask the site's admin about that number and he said there should be only super user and admin user. So it became clear this was a case of spam. Now the problem with the image manager made sense. Each user that gets created on the site gets a folder with their userid as the folder name. If the site had over 180K users, it means that there would be this amount of folders under the /portals/0/users folder, and that was most likely the cause for the image manager and file manager to time out. Solution First we always do a site files and database backup. Second we needed to turn off the site's registration as we needed to stop spam. For that we have used the approaches laid out on the post called Spammer Registrations and the video tutorial called 2 Strategies on how to deal with DNN Registration Spam. Third we had to remove all spam users from the database. We did that by following Getting rid of spam users. This not only took care of removing the unwanted spam users, but also showed how to remove the thousands of extra folders that were sitting /portals/0/users folder. Last we had to shrink the database to its regular size. After deleting all those users there was a lot of database log created so all of that had to be reduced. We run the following script for that to get the database file name and database log file name: SELECT Coalesce(8 * Sum(CASE WHEN si.indid IN (255) THEN si.reserved END), 0) AS blob_kb , 8 * Sum(CASE WHEN si.indid IN (0, 1) THEN si.reserved END) AS data_kb , Coalesce(8 * Sum(CASE WHEN si.indid NOT IN (0, 1, 255) THEN si.reserved END), 0) AS index_kb , so.name FROM dbo.sysobjects AS so JOIN dbo.sysindexes AS si ON (si.id = so.id) WHERE 'U' = so.type GROUP BY so.name ORDER BY 8 * Sum(CASE WHEN si.indid IN (0, 1) THEN si.reserved END) Desc Then we run the shrinking script below. I suggest running this from SQL Management Studio as if you run from Host/SQL, it may time out: dbcc shrinkfile([database_file_name],1); dbcc shrinkfile([database_log_file_name],1); That has given us a very reasonable database size of about 100MB and the image manager and file manager had stopped timing out! So the problem has boiled down to spam.