Who put that spoke in my server? Or how to bring a server to its knees!

The last few months since getting my own private hosting have been quite challenging in a number of ways as I have had to adapt my handling of my sites to a number of new contingencies: including weird spikes in server activity. It’s been quite a learning experience, but I’m pretty sure I don’t want to go back to regular shared hosting! I love having my own server on Dreamhost…

——-
For more articles on running a business, making money, cutting debt, or creating your blog, subscribe to the RSS feed or email newsletter. There’s a lot more in the Random Walk to Wealth on InvestorBlogger dot com. Subscribe TODAY!
——-

This graph is taken from December 5th and shows four significant spikes in server traffic in the previous 24 hours, with the spike around 00:00 being the largest and also bringing the server down!

4-10am-5th-09h december

Dreamhost helpdesk have VERY helpful to me over the years, and patiently answered almost every query fully and in detail. The last few times though have been frustrating because the amount of activity has been quite high on occasion (without obvious justification either!), and they were suggesting that perhaps I should raise the allocation of resources (and the cost!) to cover the spikes! Now, I’d already tried this once or twice: having raised my basis from $15.00 to $20.00 to $30.00. While this did indeed improve my server responsiveness, I was still getting server outages every day about once or twice a day, and it just didn’t seem that my server traffic justified that!

What is a poor server to do?

Go on a bug hunt! It’s that simple. I decided to find out what was going on, and see if I couldn’t eliminate all the other possibililties before increasing the expense further…!

Step 1. Find the Crap…

I was amazed how much crap had built up on my servers over the three years I’ve been using Dreamhost hosting… It was actually quite shocking. And it took me days to clear. But first I took stock of the files and data that were on my server: html files, jpegs, mp3s (not many), php, applications, data, backups, gzips, etc… Once I determined which domains and subdomains were only serving files, I could eliminate those pretty easily. Then I went on a hunt for old PHP applications, principally old versions of WordPress, Galleries, etc..

Step 2. Three Choices: Choose NOW!

On finding an application, I was faced with three choices: upgrade the software to the current version; remove the software entirely; or password the entire directory. In most cases, I chose the second option to cut down on the security risk. On one or two occasions, I passworded entire subdomains (with .htaccess and .htpasswd files) as well to provide access to these applications only to the person concerned. In the cases of my primary websites, upgrading became mandatory. In rare occasions, I moved applications to the root directory as a stop gap measure.

From now on, though, I’m going to be much stricter on removing old applications because of the potential security problems that can be hidden by forgotten software.

Step 3. Deleting unnecessary plugins and themes

Since most of my blogs run versions of WordPress 2.2+ and I usually auto-install or auto-update the files (courtesy of Dreamhost’s great service), the process is quite quick and painless. Dreamhost have gotten it down to a fine art, such that upgrading involves backing up the Database, Turning off the plugins (one click), click update, and wait for confirmation. But each and every time I update Dreamhost creates a backup of the original files named domain.old, and throws in EVERY theme they can get their hands on with each install). This leads to a lot of stuff each time. So I usually now delete 95% of the themes, and maintain a lean installation with as few plugins as possible (and none spare). This helps make WP as responsive as possible.

But as you can see I was still getting server spikes, and my options were running out. Everything was eliminated in one way or another, and the server was still coming down. So what next?

Step 4. Is it time to ‘log’ out?

I compared the performance of my main blog with several other blogs by checking the error.logs (I had never checked these before) just to see what was going on. Surprisingly, I found the logs quite detailed (they’re in your FTP folder called ‘logs’… click through to your domain to find the logs and then look for the error logs. They were dated a couple of days back so I had to check through and this is what I saw:

errorlogs

That’s right, line after line of the same error: this read “(12)Cannot allocate memory: couldn’t spawn child process: /dh/cgi-system/php5.cgi” and “(12)Cannot allocate memory: couldn’t create child process: …” To make sure that I wasn’t just reading regular errors, I queried it on Google and got nothing, then I checked the logs of WordPress Sites that I had just started with no themes or plugins. Sure enough, everything looked fine. Then I remember something a Dreamhost engineer had said:

Just the other day, I was dealing with a fellow who had a wordpress blog who was almost instantly crashing his PS with a single hit, because he had some wonky wordpress plugin which was spawning hundreds of php.cgi processes. Jeff

Well, thanks, Jeff. That has proved to be the best advice I’ve received yet… So I’ve been testing different plugins to find out which one or ones have been causing the problems. The best way to do this is to simply turn off all the plugins to restore the neutral state and then turn them on singly and checking the error log to eliminate those that don’t create the problem. I think I have a culprit already, but I’m now double checking them to make sure that I don’t blame the wrong plugin. Think ‘sticky’…

While the testing goes on, please excuse me for having unstable features on my blog as I try to eliminate the problem. But as you know, this problem has been going on for months; and this represents my best hope to get to the root of the problem.

Have you had these problems? What happened? I am not particularly an expert, but I was surprised at how much I could figure out by myself!

DashBoard Editor: Changing your Dashboard in WordPress

Sometimes as a blogger, I get tired of the traditional feel and look of the Administration Panel, and the slow loading of the WordPress feeds drives me nuts. I’ve already tinkered with the Administration page before on more than one occasion, but recently, I’ve been trying two plugins that are pretty neat: DashBoard Editor (this post) and MyDashBoard (Thursday).

DashBoard Editor
The first is Dashboard Editor, which is a simple panel that adds a dashboard configuration switch under the Dashboard editor. Currently, I can’t get the website to load but you can try again later.

dashboard-clean

It’s very simple to operate. And, most importantly, it works in a non-destructive way, so you can simply disable the plugin, and everything’s back to normal.

At the top you will see a text area that you can type in. This text will appear in the dashboard. Formatting is very similar to the bb-code style of posts and pages. If you used to blog in WP1.0+, you will already be familiar with the switches.

Below that area are a number of check boxes, all of which are self explanatory. They will allow you to remove the feeds, incoming links, news and so on. Of course, you can simply clean everything and start from nothing. One of the neatest features is that you can use Plugins, too. If you look at the last switch entitled “Use Sidebar Widgets”, this will create a separate column under your Presentation >>> Widgets menu. Simply create, add or move any widgets you want to show up on the Admin panel.

There are some limitations that you may wish to consider:
1. There’s no obvious way to have a widget in two places, though, ie. in your Admin Sidebar as well as the general sidebar(s). Also, the Admin sidebar is only available to those who login.

2. If your blog has many users who can register and login, you may wish to think carefully about the information you enter. For example, putting passwords for your email account in there may not be the wisest thing to do! Currently, there is no way to change the Admin area for different levels of users.

Overall, it’s easy to implement, easy to use, and easy to remove. We are looking forward to the developer adding features in the future!

New Themes: Revolution and the Morning After

The choice of a theme for a website using WordPress used to be: blog style theme or pay a lot of money to have your website designed professionally. But now, there is a lot of interest from publishers to use WordPress as the website, so it’s getting easier to find themes that can fit that need.

news revolution

Revolution Themes by Brian Gardner is one such set of themes which allow WordPress to appear as a magazine almost. The theme makes good use of a number of factors important to magazine sites including:

  1. front page space allowing main features to be shown,
  2. lots of links to recent articles,
  3. videos and large graphics
  4. mailing list box,
  5. 486×60 box for graphic,
  6. archives,
  7. Section Pages

There is also space for a lot of other things, too, at the bottom and in the middle. Since the quality of the design is excellent, and it would likely appeal to those creating a magazine style website, it’s not free, but at $99 for a single install, it could be a good deal! His other notable themes include the Blue Zinfandel series.

While for those on a budget, there are a couple of ‘free’ themes that work along the same line of thinking, of which the best seemed to be ‘The Morning After’ from Arun Kale.

home preview tma

To get the posts working, you’d need to create two additional categories for the blog. But it looks good and might be a good way to test out a magazine format. Other features include:

  1. A three-column home page
  2. “Featured” post highlighting
  3. Associating images/thumbnails with recent posts
  4. Customisable logo/header image
  5. Easy CSS classes for adding captions and wrapping text around images in posts
  6. Asides

Whether or not your blog is becoming a magazine, the number of links on the front page to your archives in either of these formats would be a good way to drive traffic to your older posts. You could tweak the formats even more to add extra stories, this would help your older stories be found more easily, especially if you have so much of the content that is hidden away (on my primary blog, there are now nearly 800 individual posts!).