Updates to CodeBetter.Com’s Cloud Setup

A few weeks ago I mentioned that we were now hosting CodeBetter.Com in the Rackspace cloud.   Overall I was happy with the setup, but one thing kept bugging me. Apache was using a LOT of RAM, and I had to end up scaling the middle tier to two 500M cloud slices  in order to keep the site running smoothly.  I got one comment that made me cringe since I knew I was having to throw too much hardware at this problem:

Err.. why do you need this much hardware? Surely a blog with 32k subscribers doesn’t need 4 machines, or even decoupled web and database stacks!

I responded that these cloud slices are cheap (and they are @$15/month) and I DO stand behind the decision of having a tiered deployment should we have to scale, but at the same time he was right.  A site as small as ours shouldn’t need that much of a footprint.  Don’t get me wrong – it’s nice to know that we can scale out should we need to, but I was determined to downsize our current deployment.

I had heard that it was possible to run WordPress under NGINX (the highly performant web server alternative to Apache) but to do it right, you have to jump through some hoops to get it up and running, like building PHP and configuring it to run within the PHP FastCGI Process Manager. After a couple of days of tweaking, we’re happily up and running on ONE NGINX/PHP-FPM middle tier server with 256M ram (behind one NGINX reverse proxy and in front of our MySql server)!  It’s probably still overkill, but I like it :)

I found a few resources which helped me get NGINX/PHP/Wordpress Multisite working, one WordPress support topic and this excellent series of posts by Pranav Rastogi with step by step instructions.  If you’re going to do this I suggest checking these out.  Also,  should you be interested in the gory details of getting this setup,  I’ve modified these steps and created a Fabric configuration script to automate this process, which you can find up at my github account.

-Brendan

Posted in Uncategorized | 1 Comment

Ubuntu Server Setup with Python Fabric

On my journey to figure out how to host CodeBetter.Com under Ubuntu Linux/Wordpress, I stumbled (via Dru’s excellent sage advice) upon the Python library Fabric to automate setup of the servers.  From the Fabric docs :

Fabric is a Python library and command-line tool for streamlining the use of SSH for application deployment or systems administration tasks.

It provides a basic suite of operations for executing local or remote shell commands (normally or via sudo) and uploading/downloading files, as well as auxiliary functionality such as prompting the running user for input, or aborting execution.

I spent about two weeks tweaking my fabric scripts to setup each of the servers in CodeBetter’s cloud setup.   If you’ve not tried cloud hosting you should.   It’s stupidly simple to stand up a new server (just a click of a button), pay for only what you need, scale servers up and down, and cancel at any moment.   But cloud hosting and automated configuration management go hand in hand.   What good is it being able to spin up a new instance at a moments notice if you have to spend hours configging it?

The process was really fun, and opened my eyes as to what’s possible with automated configuration management.  Everything, from OS updating to user account creation to deployment of content is done via Fabric.  For example, here’s a gist of the method used to create a new user :

You can get the Fabric project to setup our servers here.  Here’s a short screencast showing the Fabric deployment of our frontend NGINX reverse proxy server:

Having our setup in Fabric scripts is also a great comfort. Since it’s automated, it’s also documented and repeatable.  Should we find ourselves being slashdotted someday, we can simply spin up a new app tier host, run it’s related fabric configuration script and then tear it down when we’re back to normal traffic.

-Brendan

Posted in Uncategorized | Leave a comment

Cloud Hosting CodeBetter.Com

It’s been over a year in the making, but CodeBetter.Com has finally settled into its new home.  It’s been a journey from Community Server, hosted on two large Windows 2008 servers (SQL Box - Core2Quad 2.4 Ghz Q6600 4G 2x500G SATA RAID, Web Server - Intel Core2Duo E6850 DC 2G 2x250G SATA RAID) to WordPress, running on 4 small cloud hosted Ubuntu 10.04 small Linux servers.  Our current architecture looks sorta like this:

Community Server running on Windows Server/ASP.Net has treated us well over the years, providing a solid platform on which we could grow to our current size.  Increasingly however, server cost, Software/OS/SQL Server licensing (while currently deferred via BizSpark and free licenses from Telligent) was threatening our future ability to provide the kind of community support we’ve been able to do since 2005.

We had a lot of internal discussions about what platform we should use, and talked about rolling our own platform from which to blog but decided against it.  I think Derik Whittakersaid it the best:

The fact is ‘blog engines’ are a dime a dozen.  This is  a boring problem which has been solved many times over… I say pick an engine that we can live with and move on.

There were lots of factors that pushed us in the direction of hosting with an open source blogging platform like WordPress, but some of the biggest were WordPress’ strengths : an outstanding blogging platform with massive community support and extensibility via plugins.

I’m going to be doing a series of posts on the more interesting things I’ve stumbled across in this journey, like using Python Fabric for automating the configuration of new server instances. I’m also making all of the tools that I’ve used and source code for the site itselfavailable up on GitHub, so if you’re interested in how anything around here was done, you should be able to glean the information there.

-Brendan

Posted in Uncategorized | 7 Comments

The CodeBetter.Com/Devlicio.Us Endowed Scholarship in Computer Science

I’m happy to announce a new initiative here at CodeBetter and Devlicio.us, the The CodeBetter.Com/Devlicio.Us Endowed Scholarship in Computer Science.  This endowment will provide yearly scholarships to students that meet the following criteria:

  • Female undergraduate student majoring in Computer Science or Computer Engineering
  • Demonstrated financial need
  • Full-time enrollment
  • The scholarship may be renewed for the same student for up to four years as long as a financial need is maintained.

Why are we doing this?

For one thing, it helps us achieve our mission:

CodeBetter.Com exists
in order to help foster awareness of better practices, superior tools,
proven methodologies and techniques within the software development
community.  We do this by providing developers of all
levels a place to teach and learn about these topics through blog and
forum posts, articles, software reviews, tools and examples.

But also, we feel that there is a genuine need for female graduates
and participants in our field, especially at the upper levels of our
profession. 

But wait, there’s more :)

This scholarship will also be an adoption of sorts into the
CodeBetter/Devlicio.us family.  All of us here will be involved in
choosing the candidates each quarter, and we can provide guidance and
learning opportunities through featured blog posts.  We’re also going
to provide a package of software and books chosen by our bloggers to
each candidate.

Miscellany

I’ve chosen the local university
here in Norfolk, VA to establish this scholarship, mainly for ease of
management on my part. This will provide scholarships for as long as
the University exists.  To me that’s the coolest part, can you imagine
in 100 years someone getting a .com endowment?  I’ve attached the MOU
document for anyone interested in the specifics.

Look for more on this as we choose a recipient for the spring semester!

-Brendan

Posted in Uncategorized | 8 Comments

Dave Laribee Video Coverage of Mix08

Just a quick administrative note, as this information is timely and not to be missed.

Dave Laribee is our man at Mix08 and is doing some great Qik.com videos with the CodeBetter Video Phone (Nokia N82)… Be sure to check it out, and if you’d like to get in front of the camera to say hi, try to hook up with Dave.

  • Rob Connery, Steve Harman @ MIX08

    Rob Connery, Steve H…

    about 15 hours ago

  • Miguel de Icaza @ MIX08

    Miguel de Icaza @ MI…

    about 15 hours ago

  • Pablo Castro @ MIX08

    Pablo Castro @ MIX08

    about 17 hours ago

  • John Lam @ MIX08

    John Lam @ MIX08

    about 17 hours ago

  • Microsoft Surface @ MIX08

    Microsoft Surface @ …

    about 18 hours ago

  • Josh Holmes @ MIX08

    Josh Holmes @ MIX08

    about 18 hours ago

  • MIX08 - Keynote

    MIX08 – Keynote

    about 21 hours ago

…Now back to our regularly scheduled program.

Posted in Featured, Mix08, Video | 1 Comment