Tuesday, March 16, 2010

How to optimize GoDaddy Virtual Private Server - Kill Tomcat & Simple Control Panel

While searching for some optimization tips for Virtual Private Servers, I checked out this post which claimed that Godaddy (ahem) VPS sucked BUT offering a solution to those who were on the same boat (in this case, I).  Luckily, I tried out his solution and it has proven to speed up the Godaddy VPS.

To give an overview of our setup, we have a few (like 20 ?) websites hosted on the GoDaddy server and its occasionally bugging down. One optimization I did was to kill some processes that are not needed most of the time which takes up a few MBs of RAM from the server.

So here is the solution that I implemented on the said VPS as suggested by Colin McNamara - basically to stop the Apache Tomcat and Godaddy Simple Control Panel, which are used very rarely. But of course, if you need to use the Simple Control Panel, you can always start it up again then turn it off when you are done.

Here are the steps:

If you are on Windows use the following procedure to get shell access to your GoDaddy VDS -




  • you will want to download a ssh client called putty – Download Here

  • Copy this file to your desktop, double click putty.exe , and you should see something like this -


putty-initial.jpg




  • In the host name field I have www.yourdomain.com . replace yourdomainwith your domain name.

  • Click on the open button on the bottom right, and a shell should pop up, along with a warning that looks like this (you can click OK to the warning)


putty2-security-key.jpg




  • Now skip past the linux section


If you are running Linux or Unix start here -




  • Open up a command line terminal

  • ssh using your godaddy simple control panel username example -


ssh your-godaddy-control-panel-username@www.yourdomain.com




  • If this is your first time connecting to this server, you will be prompted to accept an unkown ssh key into known_hosts, choose yes to accept


Both Windows, Linux and Unix Continue Here –




  • Enter your the password you use to access your GoDaddy Simple Control Panel Interface

  • You will be presented with what looks like a DOS window, this is called a secure shell terminal. Type in the username you use to access your Godaddy Simple Control Panel and then hit enter


godaddy-password.jpg




  • Now type in the password that you use to access your Simple Control Panel Interface and hit enter


godaddy-putty-username-pass.jpg




  • Congratulations, if you see the window below you are now shelled into your virtual dedicated server.


putty-login-success.jpg


Change to the Root user




  • Now that you are shelled into a Linux device you need to escalate your privileges to get administrator level access. In the Unix world this user is known as Root. You can change to this user, and get full system privileges by using the following command.


su – root




  • You will be presented with a password prompt, enter in the same password that you have used to log into your Simple Control Panel Interface

  • You are now root, be careful with what command you enter under this user, as you can do some damage if you are careless


Clean out your servers memory




  • Most recent Redhat direvatives (including Centos) utilize a tool called yum to add and remove packages. This is also true with your linux servers at GoDaddy.

  • you need to install a tool called memhog, it is part of a package called numactl that is normally used to assign specific process’s to specific cpu’s in a multi-core system. We will be using it today to fix GoDaddy’s memory hogging application


yum install numactl




  • choose yes to all the prompts, and numactl will automatically be downloaded and installed on your server


Stop GoDaddy Simple Control Panel, and Tomcat, and tell them not to start automatically when your server restarts.




  • Tomcat is a special type of webserver for Java based applications. Godaddy uses it to run their control panel interface. 99.99999 percent of users will not need to use Tomcat. If you do need to use Tomcat then you are a technical user and will know what to do.

  • In Linux, server applications are called daemons. The are executed by init scripts. We will use these scripts to turn off these server applications

  • Turn off the TurboPanel daemon ( this is the process that runs your simple control panel web interface


/etc/init.d/turbopanel stop




  • Next we need to turn off Tomcat


/etc/init.d/tomcat55 stop




  • Now that we have these services turned off, we need to make sure that they don’t come back when we reboot the server. We can do this by using the chkconfig command.

  • Stop the Simple Control Panel Interface from starting automatically by executing the following command


chkconfig turbopanel off




  • Stop the Tomcat server from starting automatically by executing the following command


chkconfig tomcat55 off


Clean the mess GoDaddy made of your servers memory




  • A couple steps back we installed numactl. The executable we wanted out of this package is memhog. Issue the following command to take your memory back. This command will overwrite 200 megabytes of your memory, allowing the rest of your applications to get access to that memory.


memhog 200m




  • This will Clear out the memory that GoDaddy’s application took over, and allow the rest of your daemons to run fine.


Great, my server is running better now. But I want to use my Simple Control Panel Interface. How do I do that?




  • Easy, all you need to do is temporarily start the turbopanel daemon. When you are done making changes, you can turn it off again


/etc/init.d/tomcat55 start


/etc/init.d/turbopanel start




  • When you are done, don’t forget to turn it off


/etc/init.d/turbopanel stop


/etc/init.d/tomcat55 stop


********************************


NOTE: if you cannot locate chckconfig, try adding /sbin, like:


/sbin/chkconfig turbopanel off (and)
/sbin/chkconfig tomcat55 off


I hope this solution would work for you too!


Source: Why GoDaddy Linux Virtual Dedicated Hosting Sucks & How to Fix It

15 comments:

  1. Thanks so much for the article. Very easy to understand. Made a noticible difference in my v. server performance. GoDaddy recommend that I upgrade servers to free up more memory but this seems to have done the trick!

    ReplyDelete
  2. no problem Jeff! credit goes to the original author!

    ReplyDelete
  3. I have 100 domains on Godaddy and i can say that this company is very reputable.,;.

    ReplyDelete
  4. i am self-studying web design coz building websites is my passion*-,

    ReplyDelete
  5. web design is also a good hobby and a great job too. web design jobs pays very well,."

    ReplyDelete
  6. Godaddy has great prices on .info domains but their private domain service is so damn expensive,"`

    ReplyDelete
  7. i love web design and i love to build webpages specially with flash animation::.

    ReplyDelete
  8. Simply desire to say your article is as surprising. The clarity in your post is simply nice and i could assume you are an expert on this subject. Fine with your permission let me to grab your RSS feed to keep up to date with forthcoming post. Thanks a million and please continue the gratifying work.

    ReplyDelete
  9. Hey Guru, what entice you to post an article. This text was extremely attention-grabbing, particularly on account that I used to be trying to find ideas in this subject last Thursday.

    ReplyDelete
  10. I image this could be diverse upon the written content? even so I nonetheless imagine that it can be appropriate for nearly any type of matter material, as a result of it might ceaselessly be pleasurable to determine a heat and pleasant face or maybe listen a voice whilst preliminary landing.

    ReplyDelete
  11. Thanks for all of the efforts on this internet site. My daughter requires satisfaction in getting into investigations and it?s simple to understand why. All of us discover all regarding the effective type you provide important strategies by indicates of the weblog and also increase response from some others on that situation while our very own girl is without a doubt starting to understand a fantastic offer. Have enjoyable with the remaining portion of the new 12 months. You are conducting a stunning career.

    ReplyDelete
  12. I needed to draft you a little bit of remark to be able to thank you yet again on your precious tips you've shown in this article. It has been certainly wonderfully open-handed with you to provide unreservedly what many of us would've offered as an electronic book to make some money for their own end, chiefly seeing that you could have done it if you ever considered necessary. Those smart ideas in addition acted to be a good way to be sure that other people have similar eagerness the same as mine to figure out way more with reference to this condition. I believe there are numerous more pleasant occasions in the future for individuals who take a look at your site.

    ReplyDelete
  13. Thanks for all of the efforts on this internet site. My daughter requires enjoyment in getting into investigations and it?s uncomplicated to understand why. All of us find out all regarding the effective kind you provide important strategies by indicates of the weblog and also increase response from some others on that situation while our personal girl is without a doubt starting to understand a fantastic offer. Have enjoyable with the remaining portion of the new yr. You are conducting a stunning work.

    ReplyDelete
  14. It was some sort of excitement finding your site yesterday. I came here now hoping to find out new things. I was not let down. Your ideas in new approaches on this topic were insightful and a wonderful help to my family. Thank you for leaving out time to create these things as well as for sharing your thoughts.

    ReplyDelete