Sunday, April 27, 2008

thin, mongrel, evented mongrel and...Rodan?

I doubt I'll single-handedly spread the word about the caveats of using event-driven web servers (thin, evented mongrel), but I can at least give people Googling something that they may stumble upon while doing research. I want to keep it short and sweet.

If you're going to run an event-driven web server like thin or evented mongrel you have got to be careful about any requests that could run "long". File uploads, reports, and long atomic updates could leave your event chains blocked until they complete.

What this post is not...
1. It's not about Rodan, I'm just crazy and felt like putting that in the title; get over it.
2. It's not about why thin is better than mongrel or why mongrel is better than thin.

What this post is about weighing the options between these two great web servers so that you can make the right decision.

So, a couple things...
1. I use thin. And it is awesome. And I am lucky that I can use it on a site that has little "blips" for requests. So it hauls complete and utter ass.
2. I also use mongrel. And it too is awesome. And in this particular case, I DO have some long-running requests.

So what does it come down to - just educate yourself on the right tool for the right job. Don't jump ship on something just because it's the new, hip thing. I did just that when thin first started making ripples and then once site volume picked up, *poof* my requests sat in la-la land just waiting to be picked up. Anyone having flashbacks to when they were 13 waiting for their Mother to come pick them up from the mall?

I hate to jump around, but it's just how I write...I'm getting better[?]. Thin has support (oh and merb does too) to defer any long-running requests. So, as long as you're willing to configure thin and tell it which controler:action to defer to a threaded model you'll keep on servin' up those hoe-cakes just as fast as the surfer requests'em. WTF?

I should give the love here as to what triggered this post - the fine folks over at softies on rails had a quickie about thin and mongrel.
So please, weigh the differences - neither of these fantastic ruby-based servers should get any flame for under-achieving if you misuse them.

Related links...
Strengthening the Ruby Ecosystem II: Merb

Saturday, April 26, 2008

osCommerce and PHP5

The splendid little e-commerce application that could[n't]: osCommerce is a bit quirky running on the "bleeding edge" of PHP[5]. Just as a quick heads up to you AND any would-be script-kiddies it requires that both of the following are enabled - just as a caution, anyone concerned about their sites well-being and knows anything about PHP configs should get a bucket:

register_globals = On
register_long_arrays = On

Everyone done dry-heaving? Good! I was absolutely beside myself when I saw what was required to run this application. It's been around for a few years now and it is shocking that they still operate with such disregard for online purchasing security AND performance.

So anyway, if you're seeing issues in your admin area to the tune of tep_href_link NONSSL or really anything related to tep_href_link and then some path (check your query string) it's likely you need to enable those bountiful long arrays.

*Insert drawn out sigh here*

Can't we all just shopify?!?!

Tuesday, April 22, 2008

Earth Day

Not a whole lot to blog about this morning, I did notice one thing. My commute to work today was noticeably shorter than normal, it appeared people actually car-pooled or found another means of transportation to get to work. I left significantly later in the morning rush traffic and just found it odd that parts of i40 were completely empty.

Or, it could just be a coincidence. Nothing more, nothing less...

That's all for now.

Sunday, April 20, 2008

So far so good; no, GREAT!

The other day I wrote about a hosting company that blew me away and I wasn't even a client of theirs. Well, I can now say that I'm the proud owner of two 256MB slices from SliceHost:

1. Gentoo running nginx and a soon-to-be-named rails application.
2. CentOS running a LAMP setup for a soon-to-be-name PHP application (actually, several).

First impressions were everything I had hoped they could have been. I'm about 3-4 years removed from any hardcore system administration. And the background I did have was with RedHat and FreeBSD. Thankfully the Linux community has gotten it right with package installers, making the halcyon days of system administration now uber!

Things learned...
I thought I'd run Feisty on the secondary slice...but, funk dat. I had always wanted to run Cent and heard great things about it and I can say, I really wish that I had installed it on my first slice. Gentoo on the other hand is fabulous for the lean and mean setup that I'm a fan of with web and database servers. Keep all the crap out (who really needs vi anyway?) and bring only what you need to survive.

Finally, I really need to emphasize just how deceptively fast a 256Mb slice is when you begin compiling and installing things like mysql, apache, ruby and imagemagick. What seems to have taken forever (even on my MacBook Pro) in the past, now, literally seemed to have taken a fraction of the time. I can't explain why exactly (grid computing for the win?) but quite frankly, I don't care (I really do - and if anyone can explain it via comments, go for it.) it's fast and I'm as happy as I thought I would be using these guys and their incredible service.

The two times I got stuck (on packages that seemed to exist yet weren't installing) a quick reference to the community pages on SliceHosts absolutely wonderful information repository got me back on track in no time.

Wednesday, April 16, 2008

Sliced Bread. Now, Sliced Hosting!

It slices it dices, it...well, no, it just hosts.

So here I am, not even a paying customer of this place and I'm already excited about using them based on some valid feedback and about 30 minutes of researching customers of theirs. For a project I'm consulting this seems to be an ideal move for what we need. I can add resources when need be, load-balance AND host multiple application platforms. I've got the control from the ground up without an insane price tag.

I mean for $20/month you have a pretty vast development machine which you can control the environment of. Now, granted I'm still trying to find the gap in the armor here, so I'm not going to say this is the greatest thing since sliced (sorry for the pun) bread but...when Engine Yard is floating around at $300/month (however, yes you basically have bought an IT-staff) this seems to be the best way to start out your idea and have a nice path for growth.

Anyway, props to Jason "my name is too easy to Google for" Bynum. for pointing me in their direction.

Wednesday, April 9, 2008

Tip #0 - Less[Everything] is more!

Ok, Ok, so I didn't make a post yesterday after I had pledged to keep up-to-date on this. I'm sure with a little brain-washing and conditioning I'll get there. Hopefully today, I make up for it...let's begin.

With so many mentions of "eating your own dog food" made in the recent weeks, I've taken it upon myself to keep the ball rolling. This post is going to be my segue (there will be a pause - don't be so literal) into my 5 tips for the contest currently taking place over at

So with all that said I think a great candidate for the "eats their own dogfood" award should go to lesseverything. These guys are (seemingly) successfully running a business on Ruby/Rails (literally). So we'll just jump to the first example: you're a contractor, you need to keep track of your billable revenue (invoices, etc...) but, you aren't exactly happy with the open-source products on the market. Well, like anyone who is in this for the science (and profit) you naturally would roll your own. But, and this is where I really feel many small companies hurt themselves, you make it for "you" (DHH) not for everyone. Well, let's take a step back here. You can either absorb the costs time/hosting/beer/etc that came along with building this accounting system OR you make it simple enough that anyone and their aunt Minnie could jump in and track invoices.

These guys have accomplished this. And it's essentially the way (I believe) any small business with the programming capabilities should operate. If you can build something which helps you immensely and is flexible enough to aid in helping others at a minimal cost to maintain - that's billable revenue my friend! Check this out for yourselves at What's that you say? How do they keep the "www" off of their domain for branding purposes? Why it's simple - they'll tell you. So, just as a wrap-up real quick a little quote from their site:
Who is Less Accounting designed for?

We designed Less Accounting to meet our needs as small business owners. We tried to develop it flexible enough for personal use, but if you are a big business Less Accounting probably isn't for you.

I'd like to add a little something to that, if you're a bigger business - chances are your accounting system is overcomplicated anyways - overhaul and simplify. I know it's not the easiest thing to do what with all the personnel you've hired from your own family, but Uncle Joe will understand. He knows deep down in his heart that an Access database just won't cut it any longer and you're not prepared to take the plunge into a commercial accounting product. Give this a'll thank me later.

LessEverything has also released upon humanity, what I had been hoping someone would do for a long time and that is a social networking platform on Rails. I've had somewhat limited exposure to it, mostly because I think the world is better off without more social networking sites, however, it's what everyone wants. And I use this saying a lot as a developer and it really holds true here:
I want to develop a lever for <project>, polish it a little and deploy it.

Even if you're not writing a social network, there are quite a few benefits this application takes care of for you right off the bat. Adding blogs to accounts, creating relationships between accounts, many things which apply to a host of scenarios could be accomplished with some minimal undertaking. In terms of performance, I haven't sieged anything I've made with it so far, I guess that's another post outside the scope of my 6 tips.

So to wrap up - Tip #0 is identify your own needs and if it's viable, don't be so one dimensional, allow others to benefit (for a low cost), keep it simple and above all just get it out there! It's income you weren't expecting to have and who knows, maybe its earnings out-perform your original projects.

Monday, April 7, 2008

Keeping it going

Every couple of months Seth Godin goes and pokes everyone in the eye with a nugget about why your blog is important. I've read it at least twice in the past and now a third time. It's marketing, I get it...but this time, I REALLY get it because I'm going to do it!

Yes, the wonderful rule of three worked on me, I can't tell why it took three tries to get the fire lit up under my ass to keep this thing up to date (not only for my own sanity but to maybe help someone else out there). I could post for a year and not have anything really useful to say, just clogging this toilet of information up with more ramblings and complaints. But, in all of that I do have a hidden agenda to try to get some useful things in amongst it.

Hopefully with the opportunity that's staring me square in the face at the moment, I can make something of it (and myself) and express my successes and failures along the way. If nothing else, I should be able to look back and see what went wrong and what went right. Maybe it will help someone else as well.

Rails Cast hits 11, err 100.

Pretty cool little contest going on over at railstcasts. There's even an 8Gb iPod touch up for grabs...I've got my tips picked out already, of course, the tricky part is going to be blogging about them.

I encourage anyone who knows anything about Rails to post something, hopefully this contest has a great turnout and the community as a whole will benefit from some of the minds that aren't exactly "mainstream" (The Dr. Nic's, Fowlers, etc...). Not that there's anything wrong with them, I just think the more insight into this framework the better.

Good luck trying to get my iPod!