Articles in the ‘Development’ Category

So long LiteSpeed, hello former Soviet Union - nginx

Thursday, June 5th, 2008

Its official, we’ve defected to the Russians.

I really like litespeed, mostly because it has a simple web interface to manage your virtual hosts, environments and all their settings. I’m seriously over a shell console and typing, programmers really need to get a clue about the power of interface design and a mouse…

Anyway, we did an minor upgrade to rails 2+ and some of our apps just wouldn’t start under litespeed anymore, but the mogrels were fine, so we decided to dump litespeed and run with nginx.

Scared of the install, setup, configs and options at first, I decided to make a night of it, I bought a case of redbull and Heineken and sat down ready be confronted with lots of issues to fix and a massive learning curve to get over.

Turns out I was finished in about 15 minutes – on my development environment, and in 10 minutes more my staging and productions servers we’re also up and running on nginx – with clustered mongrels.

So I put the redbulls back in the fridge and cracked open the Heinekens ;)

Anyway, yeah, nginx is surprisingly simple to setup and use, it apparently can get complicated but I didn’t see any of that. Our local dev server was running in about 15 minutes with a 5 mongrel cluster, nginx is using next to nothing and its all running beautify, don’t know why I never used it in the first place… actually I do, because everywhere said it was a bitch to setup and use… litespeed was harder!

My verdict is to use nginx over just about anything else, I’ve used apache, litespeed, lighthttpd, and some others, nginx kicks all of them in every area.

oDesk is cool and easy to outsource small jobs to

Wednesday, June 4th, 2008

oDesk has been around for a few years now, and I’ve used it a few times, hired a few people, but since moving to Thailand a couple of years ago, my staff costs here are so low I never need to outsource, I was in an outsourced country!

But, today with our current major project we need a pretty good flash developer, and we only need someone for about a week, so there’s no point recruiting someone, or even bothering trying to find someone in Thailand, I’ve just posted a new job on oDesk in about 10 minutes.

So easy to do I love it. And the really good thing about oDesk from a buyers point of view is that we have full insight into what they are doing and if they are really doing work – the oDesk system takes screenshots like every 15 seconds so we know if they are actually there doing work or are slacking off doing other stuff…

All round oDesk is a great place to outsource to, it’s just so easy, fast and worry free.

1 day a week for personal development

Monday, March 31st, 2008

Well it’s the weekend for most 9-5 people, but I try to spend my Saturdays working on personal development.

I try to look away from any client work and do things that benefit my personal business interests and myself, usually more my personal business than myself.

5 days a week like most of us we’re busy with client projects or working a fulltime job, so the only time spare is either after hours or weekends, I work long days as it is so its weekends for me.

Being in Thailand (yes I my office is in Thailand), the work week is a 6 day week, so my office is full of staff who are still doing client work, but I’m in here working on my own personal projects, and today I’m work on my blog, doing some minor updates and writing some articles. Having staff in here is a good motivator, I don’t treat it as the weekend, it’s a working day and I’m putting 100% into what I’m doing just like any other day.

I think it’s important to turn away clients for a day, don’t read your email, don’t answer the phone, just spend a day working on what’s important to you, what makes you feel good and work on your goals.

It’s also important to have personal goals, aside from earning your main revenue from clients, you should have a personal business goal, have a side project to work on and use this day to focus 100% on that project. Plan what you need to do and then every Saturday sit down and tick off items on that list.

That’s one of the ways I approach working on my personal projects, build a list and every Saturday look at the list and attack it like I would any oth
er client project.

Application development team for $40 a week! Believe me?

Wednesday, March 19th, 2008

Have an idea for a web application? Want to invest in a real online venture? Something custom built to actually take on players in the market?

To build something substantial realistically costs thousands every month in development fees.

Let’s break down a professional development team, such as ours.

To develop a business application to the high standards that we have to for our clients, we have the following staff in house:

A Systems Architect, Project Manager, Programmers, Designers and an accounts person to manage the billing.

Of course they all aren’t fulltime on 1 project.

I’ll break down the % of time spent on an average 4 month project by each team member.

1 Systems Architect: 20%
1 Project Manager: 20%
1 Programmer: 100%
1 Designer: 50%
1 Account person: 10%

Our apps are all web based apps, hosted either internally or externally (intranet / internet), so there’s a high level of input from a designer who handles the interface design and xhtml etc.

This should be typical for any midsized development house. Let’s take US rates for staff and break down what a project would cost, and also look at the % per project.

Systems Architect: $100k – 20% = $20k a year, about $7k in wages for 1, 4 month project
Project Manager: $80K – 20% = $16k a year, about $5k in wages for 1, 4 month project
Programmer: $60k – 100% = $100k a year, about $20k in wages for 1, 4 month project
Designer: $50k – 50% = $25k a year, about $8k in wages for 1, 4 month project
Accounts: $45k – 10% = $4.5k a year, about $1.5k in wages for 1, 4 month project

So in total, in wages alone, for 1, 4 month project the cost for a company to develop an application is at least $40,000!

Plus, if this company is a contracted company, than they need to add profit and cover other costs, looking about $100k plus.

If you were to shop the project around and found a lone ranger, a 1 man show that can do it all, to cover his own wages for 4 months is still around $20k, and you would realistically expect less development done in that time since their time will be spent on other things, management, architecture, design, client updates, billing etc. I’d expect 3 days of a 6 day week of actual programming.

So how can I possibly justify my topic of a whole development team for $40 a week? Where is this crazy and bullshit deal?

Well there isn’t one. Not yet. Not that I know of anyway.

I can however divulge that I’m considering it…

I’m a systems architect and project manager for our current projects. We also have another project manager on staff, a designer, some ruby on rails programmers and some other general staff for accounts, and support.

There’s a bunch of projects that I want to build and I’m willing to open my team of developers to outsiders in exchange for their expertise, industry contacts and their own network of resources.

On top of that a requirement would be to share the development costs.

I can afford to reduce development costs to as low at $40 per week, on the proviso that there are 10 people investing in the application development.

So my thinking is that I’d invest in at least 3 shares minimum, and put the other 7 shares up for anyone to buy into at that $40 per week.

Why?

Well, I can afford to develop my own projects, and we do. But that’s what we do, we develop applications, we don’t necessarily have all the greatest industry contacts, networks of websites with thousands of users every day or things like that.

We can build businesses but we don’t have the time to market them, I’ve done marketing before professionally and I understand the resource requirement and time that’s really needed to make a web business work, and that’s not time well spent for a team like ours.

So I’m willing to open my team up to outsiders to own a portion of a business and in exchange for our super low development costs / super cheap investment, I’d only be accepting people who can offer what we don’t have, that marketing and promotion side of things.

Honestly the money for development isn’t an issue, but it covers my team costs and re-assures me that the people involved are dedicated to the cause; they have a financially invested interest in what’s going on, I would want to be partnering with people who have the resources and traffic to promote whatever it is we build successfully.

At the end of the day it’s about making the development successful, I wouldn’t be profiting from the development, so it’s in my best interest to partner with worthwhile people so me, just like you can profit from the business itself.

As for what we would be building, well I’m undecided. I have a lot of ideas, but who says it has to be one of my ideas? If someone comes along and has a good idea and is keen for what I’m proposing, then we might run with that and see if we can round up some other people to invest in it.

Anyway, just been a thought of mine, thought I’d blog about it.

Client work pays the bills and more, but I’m not into doing client work forever, we’re building our own apps and I’m defiantly interested in expanding that scope.

I’d be interested to hear some feedback on what people think about it all.

We’re all having the same problem with rails hosting

Sunday, March 16th, 2008

I think the biggest problem with ruby apps is the hosting.

PHP is so easy to host, you can upload it almost everywhere since mod_php is usually deployed by default with apache and php is deployed with every server now days.

Problem with Ruby is that it *can* be memory hungry and there’s ‘installing’ to do on the server side to get it up and running.

On top of that, web hosts either don’t support it, don’t support it well, or charge a lot to support it.

You can pick up an average ruby hosting plan with a plesk or cpanel control panel etc etc, but it’s going to be slow, not only because you’re on a virtual hosts - shared environment but because it’s not setup right, not load balanced and what not.

Just because it says FastCGI doesn’t mean its fast, Lighttpd isn’t all that light, and using a VPS and still using a control panel like plesk to handle your rails isn’t going to solve any issues.

This is where I think Slicehost is *almost* the perfect host for rails projects.

You can easily setup a couple of different slices (virtual servers) in a few minutes, and install SQL on one, and litespeed on the other.

Only downside is that there’s a lot of manual work to get it all 100%, not only on the server side, but on the client side.

Setting up your Capistrano, and other local tasks take time.

If Slicehost dedicated a side of their business to rails deployments, providing Capistrano recipes, deploying servers with litespeed and rails etc pre-installed, you know, like 5-6 different deployment configurations to choose from to get up and running, that should cover the most of what people are after.

Right now most non linux technical people are stuck either learning how to do all these things in linux which is time consuming, and frustrating at times, or people are stuck paying large sums for overrated hosting.

Mediatemple charge like $20 for 64mb of memory, mosso charge $25 for 128mb of memory and engine yard are off the scale with $990 per month + $690 setup… Not to mention engine yard’s $125 per month for 1gb of backup space!

‘Grid’ hosting, load balancing and what not isn’t all that hard to do, and it’s not terribly expensive, I think engine yard are overcharging a bit, but that’s my opinion.

If I ever got into hosting, I’d do the same as slice host but dedicated to ‘LAMP’ deployments on virtual servers, setup a grid over at cari.net and use 3tera to manage the virtual servers.

4 servers for a rails application?

Saturday, March 15th, 2008

Well 3 + a local dedicated development server.

For some people it may be overkill, but I see it as good planning and future proofing.

I run more than 1 rails application too, actually deploying upwards of 20 total over the next 2 months, so I need a dedicated area to store repositories (SVN), and it’s defiantly good practice to separate out the sql server from the rails server.

And as far as cost goes, it’s not much. Slicehost offer slices from as low as $20. So if you’re only getting started you’re looking at $40 for 2 virtual servers, each dedicated and saleable up when you need it.

I know a lot of people like to run rails apps in a shared environment, but if you do you’re stuck compromising on the speed of your app, stuck using low performance webservers like apache or lightty.

It’s well worth the money to run a couple of slicehost servers, and they are all yours, run as many apps on them as you want.

A few ruby on rails deployments starting this week

Friday, March 14th, 2008

I’m deploying a few new rails projects this week. The biggest issue I have with rails projects is the work that goes into setting up local SVN, Capistrano, an SVN server, application server, web server and a database server.

On top of all that you need to setup Capistrano to deploy to them all, and run some testing etc.

Overall it’s a 2-3 day process. But with the help of litespeed, it’s come down; litespeed has cut a good 6hrs out of it all in my opinion. Realistically it takes a lot of time to do it right, and to test it.

Not to mention the long term advantage of running litespeed, - load balancing, scaling and memory management.

Sure if you really wanted to you can get up and running in under an hour.

But to produce a solid development, staging and production environment with the right setup and infrastructure to last more than a month, it takes time.

I think I’ve put together a nice process to handle it all, I’m going to spend the next few days going through the whole process again from scratch, and I’ll be documenting it, so I’ll probably post it.

The setup I use server wise is:

  • 1x Local development server (Ubuntu 7)
  • 1x hosting account for SVN (I use a media temple grid service account)
  • 1x 512mb slice from slice host (dedicated virtual server, saleable up or down at anytime) for the rails application(s)
  • 1x 256mb slice from slice host (again, dedicated virtual server saleable at any time) for mysql and phpmyadmin.

The slice server virtual servers are also Ubuntu 7.

And as far as software goes, I’m using the normal subversion, ruby 1.8, and what not.

My main difference, and the main difference with everyone when it comes to ruby apps is webservers, I’m using litespeed.

I’m amazed why more people don’t use it.

Go and read about it. I’ll post more about it later. It really kicks the crap out of apache, and nginx.

It runs php 50% faster than apache. And it runs ruby on rails super fast too, and with less memory used. Far less.

WebSites and WebApps – build or buy?

Wednesday, March 5th, 2008

This is a question that doesn’t get asked – or thought about enough when it comes to buying websites and webapps.

There are lots of them for sale every day – sites and apps that are under 6 months old, minimal amount of money spent on advertising, but since the site is making upwards of $500 a month, the sale price is at least $5k or more.

I’ve rarely seen a site or app for sale for under $5k that’s – in my opinion; a ‘good investment’.

There’s no reason why you can’t take your $5k, build something similar, or better, and have change left over to do marketing, at least that way you’re taking away the risk that the seller is lying and you going to throw your cash away.

And not to mention you can have it built the way you want. That’s how I prefer things, mostly because I like things done my way, and I like things built a certain way.

The last 5 sites I’ve bought we’ve totally re-done from scratch because the code that was powering the site was average at best, and the design wasn’t all that fantastic.

Honestly, there’s not much you can’t have built that sells for under that $5k mark for around $3k or less. Shop around; look at places like odesk and elance for developers and designers.

Todays Next Mission: Installing LiteSpeed for Ruby on Rails on SliceHost

Sunday, March 2nd, 2008

Ok so I’ve decided to use LiteSpeed as my web server over apache, lighttpd and nginx.

Why? Even tho most rails developers are moving towards using nginx and a mongrel cluster or something similar, I like what litespeed are doing, and the foundation behind it.

Unlike the other systems, there’s a company behind them that you can call on for support – it’s a commercial product, so bugfixes will be regular and of urgency and things will keep evolving.

Nginx is mostly in Russian still and lighttpd doesn’t have much power.

Early on in my research I cut lighttpd out as an option totally, it’s really slow and just not what I want.

Other considerations were memory usage, not only of the webserver, but of the mongrel processes.

Mongrel can use a fair bit, so for us, hosting 20+ rails dependant sites and having all those extra mongrel processes staying alive without them being used is a big memory load, this is where I start to like litespeed a lot over the rest.

You see with Litespeed, it controls the mongrels direct with an api that’s a ruby gem, it will load the mongrels automatically when they are needed and shut them down when they aren’t, which is also good if your app has issues or memory leaks because it’ll start fresh again soon enough.

Also, having mongrel tied in to litespeed, there’s one less layer to stumble through, with lighttpd, apache or nginx there’s 3 ‘layers’… the web server, the mongrel and then your app. With litespeed, it’s just it and your app.

Next major win is that litespeed has a really good web interface for controlling it all, the virtual host for your site, the integration, the mongrel processes, the whole web server and all. So no more digging through config files on linux and hours of shell usage to get things going, you just use the slick web interface, which also displays real-time stats and logging.

Even though litespeed is commercial, they have a free version available that will handle most people’s needs, if you have a very high bandwidth site then you’re probably making cash so if you need a license to handle more than the free 150 simultaneous connections it’s only about $30 a month to handle 300 or more I think.

Anyway, there’s been a good debate on ruby forum about it all not too long ago…

http://www.ruby-forum.com/topic/137579

Aside from all that, installing litespeed is super easy, slice host have a 3 step manual on their wiki.

http://wiki.slicehost.com/doku.php?id=install_litespeed_on_ubuntu

After those easy steps are done you need to setup your rails app in the webserver – so you’ll need to create a virtual host, similar to apache but also with linking in the mongrel functionality.

Also, don’t forget that you need to setup your dns in the SliceHost control panel too.

To setup your virtual hosts, best bet is to follow this manual

http://www.litespeedtech.com/support/wiki/doku.php?id=litespeed_wiki:ruby_rails

Anyway, I did all this already on our local box, I’m doing it now on slicehost, will post about any differences to the manual if I have problems.

Todays Mission: Installing RoR, MySQL and LiteSpeed on SliceHost

Saturday, March 1st, 2008

Ok so I’ve moved hosts for some of our projects and sites.

This is a pretty big thing, at the moment we have a dedicated server with LayeredTech, a VPS with MediaTemple and 2 GridService accounts with MediaTemple.

It’s getting a little messy, so I’m consolidating everything to a MediaTemple VPS and a Slicehost (my new account) 1024 slice.

Forgetting the rest of the move for a bit, and the reasons behind it, let’s talk about slicehost.

I’m 1 day into my hosting experience with them at the moment, and so far I’m learning a lot, and wondering if this was the right choice.

I’m familiar with Linux to a good extent, I’d rate myself a 6/10, I’m no guru but I can do everything we need without any dramas.

The thing with slicehost is that there’s no web control panel as such, there’s no cpanel, or plesk, no way to add domains to an account, no simple web hosting. You have to know what you’re doing and you really have to have a good grasp of Linux before you even think of hosting with them because most of your time will be spent in shell.

Somewhat like MediaTemple where you have a control panel, you can manage your slices and general bits from a web interface, you also have DNS control, but that’s it. No email or anything. It’s very ‘heavy’ on the manual labour side of things, as far as reading and typing to get things setup, not your typical institutive user interface with 3 clicks to get a site up and working.

So all that scary part aside, there’s lots of documentation around for slicehost, so it’s not too bad.

Also, after purchasing my slice it was operational in less than 2 minutes.

At the moment I’ve just installed Ruby, Rails and MySQL, so far so good.

To get this far I’ve used the slicehost wiki on how to gets started with your new Ubuntu slice…

http://wiki.slicehost.com/doku.php?id=get_started_with_your_new_ubuntu_slice

I picked Ubuntu mostly because we run Ubuntu servers for development internally, but it’s also very well supported by Slicehost.

The Ubuntu wiki is pretty big for slicehost, check it out here http://wiki.slicehost.com/doku.php#ubuntu

Next on my list is to get LiteSpeed installed.