I purged about 150,000 user accounts that had no data associated with them. Botters had created 95% of these accounts and I could tell the number of user accounts was one of the major reasons the server has been having issues the past few months. I also turned on user account creation again, but added a security question which I hope will circumvent the botters from creating more useless accounts. I banned as many ip addresses as I could associate with these botters and will continue to follow up. I added some new firewall rules to better protect the server as well.
I spent some time tweaking the web server and mysql settings. With these tweaks as well as the user account cleanup, the site seems to be running much better overall for now. I have a script to monitor the swap space usage and restart web services when it starts swapping. The hosting company had been recently shutting down this server because it was swapping too much memory to disk. I hope this will stop them from shutting down the site again until I can find some better web server and mysql settings. If you see the bad gateway error, the web services and restarting and should be up within 30 seconds.
I also created some new indexes in the database to speed up some of the queries. It seems noticeably faster now.
There are no plans to shut down the site as of yet, but I did recently have to downgrade the server again because I was paying too much out of my own pocket. 1GB of RAM is all we have now on this virtual slice and it's not really enough to handle the amount of users on this site very well.