MovableType 4.01 and Bluehost CPU Exceeded Error

To run MovableType with a lot of entries (2000+) on Bluehost is painful, since Bluehost has CPU limitation. It checked the CPU a user account is using in 5 minutes. If it was more than certain amount (40 seconds or so), it pops up the CPU Exceeded Error. Recently, they even moved the interval to 60 seconds! That makes a rebuild in possible. It will throw away this error before rebuild complete – in my case, just after I rebuild several pages.

I believe many people experience the same problem: CPU Exceeded Error before MovableType rebuild complete. This is true in 4.0, and 4.01 is not better.

After seeking for the answer for a long time, I finally had an easy solution – to modify the JavaScript code a little bit, and ask MovableType to rest for longer time before each step of the rebuild. Here is what I did.

Propose:

Workaround the Bluehost CPU limit by setting the interval of the build long enough.

File changed:

/public_html/home/cgi-bin/mt/tmpl/cms/rebulding.tmpl

Line Number of the Line Changed:

20

Original:

setTimeout(‘doRedirect()’, 200);

Change to:

setTimeout(‘doRedirect()’, 20000);

That’s it.

You can even try smaller number than 20000 to build faster and then test. Maybe 10000, or several thousands are OK for your server, or your number of archives.

Update May 4, 2008

Changed the line from 60000 back to 20000.

How Often Do you See “CPU Exceeded” Error?

Recently, it seems to me that there are more chances for my visitors to see this “Exceeded CPU Quota” error:

screen-cpu.exceeded.PNG

This is because there are too much traffic on this site, and the bluehost are constraining the CPU usage. I am not sure how many of you have ever seen this error? Let me know if you also see it so I have a brief idea about how bad the situation is, and decide whether I should do something for it, or not.

Thanks.

May be Inaccessible for Several Hours

Bluehost notified me that

Your servers’ IP address has changed from:

70.103.140.102

to:

69.89.22.102

Since I host DNS and website on different provider, I have to change it manually, and they may not sync with each other perfectly. So you may expect short pause (from several hours to 24 hours). If you cannot access this blog in the next 48 hours, don’t worry. It will be back shortly after network IP address change and my DNS change both take effect.

Thank you for your patience.

Update May 18, 2007

The change has been completed, and there was no report of inaccessibility.

I Have a BIG Hosting Account

Look at this:

public_html/home 6142.90 Meg

public_html/translate 861.92 Meg

public_html/user 126.04 Meg

tmp/webalizer 83.62 Meg

tmp/awstats 77.74 Meg

tmp/cpu_exceeded_logs 12.39 Meg

tmp/mysql_slow_queries 2.64 Meg

It seems I need to spend some time to kill some of these files to make sure the system is not over-sized. Although I have 200G of disk space, but that does not mean I always have 200G disk space on local computer to keep the backup, and not to mention the bandwidth and time to wait to download.

Then by a closer look, I found this:

public_html/user/mt-user/error_log 126.01 Meg

Well. It is a single file, and it is 126M in size. Not good.

Then I found out this:

public_html/home/axs/log-backup.txt 398.03 Meg

public_html/home/axs/log.txt 307.42 Meg

There are two log files, and their sizes are 398M, and 307M. Not good. I will kill them.

After killing these three files, I already saved almost 1G of data. So, how important to periodically check the sites, and make sure there is no hidden problems.

It is the same for a business or personal life.

Translate folder is also a big folder, but I only need to backup one file in it. The other 750M is useless.

The whole BBS is nothing. It is just some program files. There is only one folder that need to be really taken careful. That is my_templates

Cookbook is nothing. I shouldn’t start some test project on this important server. Since it is there, let it be..

There is another domain called new.wangjianshuo.com. I don’t know when I created, but I don’t think there is nothing in it. It caused backup problem. So delete it.

After checking the top level domain, the only folder that really matters is public_html. So in the future, I will only focus on back up this folder.