Anyone who keeps up with us socially (here at the blog, on Twitter, Facebook, or our forums) knows that we’ve moved all of our shared and reseller hosting servers over to Cloud Linux. We use those words a lot too, come to think of it. So as I sit here on a peaceful Sunday night at the local coffee shop, it occurred to me that we’ve never really covered what this Cloud Linux thing is. Instead of doing what I came here to do which is mostly browse reddit and look at funny pictures on the internet, I’m going to go over what exactly Cloud Linux is, what it brings to the table, and some of the more technical aspects of it.
So, what exactly is Cloud Linux?
In a typical server environment, there are no hard limits in place for each user. There are of course things you can limit (PHP memory use, cron job execution, disk space, bandwidth, etc), but those aren’t the things users do that will hit you where it hurts. The majority of resource problems stem from CPU use, or disk IO, bad MySQL queries, and other runaway scripts. Before Cloud Linux, it was always a game of cat and mouse. We had to have our sysadmins get notified of the issue, login to the machine, locate the user and suspend whatever activity they were doing which was causing the problems. Pretty lame, right? We thought so too. Cloud Linux changes the game, not only for the end user like yourself but for us.
So enter Cloud Linux. CL creates a virtual environment for each individual account on a shared server and allows us to limit the amount of resources any single account can use. Gone are the days of a single account taking up every single CPU on the machine because it wants to. This brings a lot of benefits to the table for both you end users and us as a host. We deal with less system level resource issues, there are fewer service interruptions, and most importantly the speed of most users sites go up as the machines aren’t using as many resources. As an end user, you also benefit from the lower server load and fewer interruptions of service. You also get a nifty little display in your cPanel (more on this later) which shows useful stats for your account.
Talk nerdy to me
Now you have a basic idea of what this fancy software does. If you’re content with knowing that it just works, carry on to the next section. If you want some more info, stay tuned. Most of what we’re going to cover can be found at http://cloudlinux.com/docs/index.php but we’ll hit on it here.
LVE – LVE, short for Lightweight Virtual Environment, is the driving technology behind the CL methodology. LVE, developed exclusively by the folks over at Cloud Linux, is a kernel level technology which handles the isolation and resource monitoring that CL is able to provide. LVE brings together technology provided by Apache modules and the Linux kernel. More reading available here: http://cloudlinux.com/docs/workingwithlve.php
LVE and cPanel / WHM – CL has developed a plugin specifically for use on cPanel / WHM based systems. Installed through yum (CentOS package manager), the plugin allows you to view resource accurate up to the last second, and also allows you to edit default and individual LVE limits.
Installation – Installation is really quite simple for us at least since we’re using CentOS and cPanel. All you need to do is wget their installation script, run the script and authenticate it against your activation key. Since it is a new kernel, a reboot is required.
Data Reporting – The CL kernel adds a few proc entries for user usage statistics as a small set of command line tools to view & monitor usage. In addition to this the cPanel / WHM integration has user based reporting which will log a history of CPU usage for an account allowing for quick and efficient tracking of resource usage.
By now, I imagine some of you have noticed the new fancy little metrics on the left side of cPanel when you login. These metrics are CPU use and concurrent connections. Here’s a picture of what they look like:
Pretty standard and it looks just like all the other stats. A few key points:
- The CPU use there is for your account only and is shown in real-time. It is not the entire server, so when it says 100%, it means you’re maxing the CPU limit (1 core) which we’ve configured.
- Concurrent connections: Despite the wording implying connections to your site, the idea behind the concurrent connections is actually the amount of active processes on your account. These processes can be cronjobs, PHP processes, Perl processes, etc. A single user should rarely if ever consume all 20 connections, so this metric is mostly informational.
- If you are consistently hitting your limits, it is time to look at optimizing your site(s) or upgrading to a VPS as you’ve most likely outgrown shared hosting.
But wait! There must be some downside to this!
With anything in life, with the good comes the bad. Fortunately for us (and you) though, those negatives only effect a small subset of users. Well, who are these users? They’re the ones who were causing resource issues before. Thanks to CL these users are now limited with the amount of resources they can consume. If they hit their CPU limit the system won’t allow them to use anymore resources and as a result future processes that need CPU time will have to wait until others are finished. As a result some users think CL causes slow machines & websites. The reality of course is that they were gaming the system before and taking advantage of a server with no resource limits.
What comes next?
Quite a few things actually! The team over at CL is working on developing a MySQL governor. Their governor will be a set of utilities provided by a USER_STATISTICS table which is available in the CloudLinux version of MySQL. The USER_STATISTICS table is available because of technology originally developed by Google. The set of utilities includes a daemon which monitors the MySQL use by account, and a top (the Linux command top) like utility called dbtop.
They are also working on technology which will work within LVE to limit disk IO and memory use on a per user basis. As soon as these features are seen as stable and production ready, we’ll definitely be implementing them.
While it is difficult to emphasize how awesome CL is in a 1,000 word blog post, I think this gets the point across. Everybody benefits, everyone is happier, and we are involved first hand in technology that will be considered standard within a few years, if not sooner. We’ve been using Cloud Linux in production now for about 2 months and in that time we’ve seen the load average on all servers reduced by at least 50%. All in all everyone is pleased with the decision, and the few complaints we’ve received have been from those users who are maxing out their CPU quota. The CL staff have been super helpful and we’ve even developed a very strong working relationship with their lead developers and CEO.
Feel free to post any questions or concerns about this technology in the comments, we’d love to get some more user feedback 🙂