You may have noticed that RedYawning has been having availability issues over the last week or so. There have been primarly two reasons the first being simple and the latter a bit tougher. First of all, RY is hosted on a dynamic IP address these days and the automation that I have on the server to update the IP hourly stopped working. I don’t have access to the machine until early Feb so I won’t be able to fix that for a while.
Secondly, the code is experiencing performance issues. They mostly revolve around lock contention on the database while doing writes. It seems like there’s a limited amount of write locks allowed and the Accesses table (the one that keeps track of all the views) gets a large amount of them for all the RSS access that’s happening these days. Thus, whenever a blog entry is read, a write to the DB and in the mornings (PST) when RSS aggregators are reading entries it makes it hard to log in (since login updates another table) since there are no write locks available. At least, so my theory goes. Inserting comments also takes forever, and that’s partly a configuration issue and I think some bad indexs as well.
The problem really revolves around the fact that the data access component of RedYawning is garbage. It’s total spaghetti code and I’m sure there are instances where a DB connection is made but never closed and the like. Once I get access to the server again, I’ll probably move all the logic in to an encapsulated data access layer and hoist the rest of the code on top of that. I’m probably also going to build some level of caching logic to reduce the amount of DB IO as well.
So, basically, stay tuned until next month.