FamousPhil.com -- Home My Calendar Youtube LinkedIn Facebook MySpace Twitter RSS Blog Feed

Blog Navigation

Blog Home



Partners

Latest Activity

MySQL Singleton Classes in PHP and Python

Phil gives the source code for implementing a MySQL singleton class in both PHP and Python.



Posted on: January 31st, 2009 by Famous Phil

As expected, I completed moving all of the websites hosted on the former mthsweb1 (Matthouse Web Server 1) server over to the new mthsweb4 server.  I haven’t heard any complaints so far about the new server so far and don’t expect to hear of any problems.  Tonight I will be doing some testing on the old matthouse web 1 server before it expires later in February.  I hope to learn some new knowledge from my testing later tonight regarding apache optimization.

Earlier today, I helped a friend in the hosting business move a massive website (http://clevelandleader.com) from his server to a virtual server that will just host that website.  This website is ranked ~76,000 on the alexa scale which means that it gets an insane amount of traffic.  My best guess would be 300 to 1500 loads per second.  The site itself has a huge mysql database that is over 2GB and the sql move alone almost crashed a dedicated server with a quadcore processor (it did have a lot of other websites on it though).  Regardless, after the move, my friend didn’t realize that a default whm (cpanel, inc) installation doesn’t optimize the server nearly enough for a large website like this.  Heck, I don’t even know if whm was made for such a large website.  I did optimize the server and compile apache correctly just to handle the needs of clevelandleader.com.  I also did a lot to prevent apache from crashing with the high load.

Traditionally, with such a large website such as cleveland leader, the web server hosting the site would only run a web server, no overhead like cpanel.  I feel that cpanel has made the hosting process much easier, but I just don’t think it was made to handle such a large website.   Also, the fact that cpanel uses the root password directly means that if there is a security vulnerability and the user obtains that root password through hacking or whatever, the server could be compromised not only from cpanel’s whm but also from the terminal through ssh (or a rare occasion of console access, meaning sitting in front of the server physically).  This could present a major problem.  Most smart hosting companies use cpanel’s wheel group to give su access to certain cpanel uesrs that can then login to the terminal via ssh and then su root with the root password to gain root.  This provides a 2 password layer and adds an additional layer of security to the server.

Another pitfall that large websites face is the need for a dedicated mysql server, that is if mysql can even handle the load.  Mysql was made for small to medium sites and it was made for maybe 100 to 200 queries per second, but much more than that and it undergoes a massive strain.  Many large websites find themselves moving to more powerful database servers such as Microsoft SQL or Oracle which are much more powerful solutions that were made for high loads.

So why am I even talking about this!  I felt that this would be the best way to introduce a new idea that I’m going to begin working on within the next couple of weeks.  I have purchased the domain (http://adminreference.com) and will begin a forum where users can share their administration experience and knowledge to the world.  I am a seasoned Windows administrator and a somewhat experienced Linux admin.  I find myself knowledgable about both server operating systems and I post tutorials on multiple websites that don’t really aim for administration concepts.  I also hope that some day this can help me when I am stuck on a massive problem.

I encourage you to stay informed as I begin this new journey.  I will likely be ready to release the site sometime in the next couple of weeks.  I am not sure how to market such a website, however I’m sure as people begin coming, someone will have knowledge about that as well.

Tags: , , , , , , , , , ,
Posted in Hosting / Server Administration
|| 6 Comments »