KB / Billing / Account Evaluation

From DreamHost

Jump to: navigation, search

If your account has been moved to an evaluation server, here is information to help you understand how we measure resource consumption, how to reduce your useage or decide to go dedicated.

Contents

Parent Article

My account was moved to an evaluation server!

If you have recieved a message stating that your account was moved to an "evaluation server" this means we have moved your account to a special machine in order to quarantine any heavy resource consumption going with your account.

There is no extra cost for this and all of your services will remain active, however, any unique ips on your account have probably changed.

The reason we moved your account is because our system flagged it has using more than a fair share of system resources. Please read "What are CPU minutes" for specifics on how we measure resource usage.

We realize that you may just be experiencing a spike of high traffic or have a very popular site. In other circumstances, you may have processes which are crashing the machine or causing performance problems for other customers. The evaluation server to which we have moved your account serves fewer users than normal shared hosting machines. This means that if your processes are crashing the machine, it won't affect as many customers. On the other hand, if your sites are growing or are already very popular, the evaluation server is more apt to handle high server load since fewer domains are hosted on it.

We would very much like to see you upgrade to a dedicated server if that is feasible, or simply reduce your usage so that we may restore your account to its original shared hosting machine. Please use the next 1 - 2 weeks to weigh your options and execute a plan to either upgrade to dedicated, reduce your resource consumption.

Why do I only see php.cgi in my resource report?

If you run a lot of PHP scripts, then the reports in /home/user/resources/ may show only "php.cgi" instead of the proper script. This is because of the way we run php scripts on the web server.

To fix this, try the following workaround:

All steps below are required for this to work

1) Change the permissions of all your php scripts to be 755. For example:

chmod 755 script.php

You can do all your files at once with the following find command:

<nowrap>find /home/your username/ \( -name "*.php[34]" -or -name "*.php" \) -exec chmod a+x {} \;</nowrap>

Note that this is performed by our system every morning on your machine, so you probably don't have to do this step for existing scripts.


2) For each of your domains, add the following line to your .htaccess:

AddHandler cgi-script .php .php3 .php4 SetEnv REDIRECT_STATUS 200

If you don't already have an .htaccess, just create a file named:

/home/your username/mydomain.com/.htaccess

and put the line above in that file. Make sure the permissions are set to 644 for your .htaccess file.

4) Also, please add in the following line at the top of every php script you have:

<nowrap>#!/usr/local/bin/php </nowrap> This will tell your scripts to use the correct php interpreter.

5) Change your domains to not run PHP as CGI here. From the webpanel, click on: Domains > Web Then next to each of your domains, click on "Edit". Uncheck the box titled "Run PHP as CGI" and click "Save Web Service" at the bottom. NOTE: Some third party software will break during this transition. Because of that, we've made sure that your changes will go live within 2 - 10 minutes after you click "Save Web Service". If things break, you can quickly change it back!

4) If you have any custom .htaccess files, you may have to edit them. You'll have to do this for every domain that you have setup with a custom .htaccess file. You might have something like this: AddHandler application/x-httpd-php If you had the line above, you would need to remove it. In fact, you might have something else in your .htaccess file that causes your PHP scripts to be run as a cgi. If that's the case, you'll need to remove it as well.


If the approach above is not feasible for you, the best work-around for this is to examine your stats page and look for the php scripts with the most requests.


What are CPU minutes?

We measure server resource consumption in CPU minutes. This number indicates how much time a processor spends working for your username. All shared hosting customers should use less than 60 cpu minutes per day for all their users on their account.

It should be noted that bandwidth and cpu usage are very different and do not measure the same resource. Take the example of serving a single image: On one hand you could have a static image that you link to. This would only use the CPU nessecary for the very optimized apache program to load the image and send it in response.

Now imagine you want to return a random image from a list of images, so you invoke php to pick a random image location. You incur the cpu cost of loading php, but the overall cpu usage is still small.

Now imagine that you want to return a random image from your most recent vacation. You have uploaded all your images in their original size but you want to send it to the visitor as only a 640x480 image so you load the original image and resize it in php. Now you have incurred a very high computation cost to recreate the image in a new size.

In each case you are sending the same amount of information and therefore using the same amount of bandwidth. The process of optimizing your software is finding ways to cut down on unneeded computations. So for instance in this example you could resize the images once on your personal computer before uploading them. Then serve the previously resized image.

Another possible reason for high cpu minutes is described by a customer here: "I run a blog as part of my site and using the daily stats provided by DreamHost on my server (http://domain/stats) I realized that two pages have become spam link magnets. I get thousands of hits on these two pages every day (referrer links are all porn or viagra etc). Both of these pages are also PHP pages - one tracks referrer hits to my site, the other has the word "video" in it is why I think the porn spam is linking to it. But I realized that if I just remove those two files, that would take away most of my CPU time that's being "stolen" by the spam pirates."

It should be noted that noone gets their service turned off because they received a heavy usage email. The only reason we would terminate an account is that there was no response to our emails. In a case with no response in over a month for instance we would eventually have to turn the site off. For some there are just warnings that the usage is high, and others with even higher usage are moved to a server with less customers on it to limit the number of cutomers affected by very high cpu usage. If runaway process usage is not limited, the machines the processes are on become unstable and crash. The idea here is to keep machines stable. There is work involved in optimizing your website, but that is an integral part of what it means to be a web designer.

If you see a number referenced as cpu seconds, simply divide by 60 to get cpu minutes.

If you are presently on an evaluation server you can check CPU usage by downloading the file ~/logs/resources/*.sa.analyzed.0 . You should also be receiving daily resource reports to your primary contact email address. You can also view and download these stats files through the stats url of any of your domains (E.G. http://yourdomain.com/stats/resources )

Also, this kbase article is limited to a few comments and just shows the most recent ones, please use the forum or contact support directly for help. This is an informational, not a discussion page, and you will get better help from support directly.

Personal tools