Can I give up frameworks for lent?

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

I learned something last week that just blew me away.

You see, I was using codeigniter for ChatSpring’s back end. But I was only using it for the pretty url-routing. I wasn’t using active-record. I wasn’t using *any* features that I thought would cause a huge performance hit.

But the framework was just eating up CPU like crazy.

On my development machine, I can pull 50 requests per second for a simple “hello world” page in codeigniter. My actual controller that hits the db was down at 20 rps.

But now that I’ve removed CI from my app, I’m up to 80 requests per second for my controller that does real work.

That just seems crazy.

And that bit I wrote about mysql being as fast as memcache. That’s completely wrong. It’s much faster, but CI was acting as a bottleneck that made it appear slow.

4 comments ↓

#1 Gil on 01.30.08 at 7:23 am

Great to hear. I’m working on my own web app for small companies, and we chose to use Rails because of the apparent boost in development speed. The verdict’s still out on that part, but now that we’re close to beta, it’s painfully obvious that we’ll need a dedicated machine to run it because it’s SLOW.

Of course that means we have to not only pay for a server, but for someone to manage it. Do you do that before beta, so your first users have the best experience possible, or after, when you have money rolling in? No easy answer…

#2 Carlos on 01.30.08 at 2:03 pm

There have got to be so many factors figuring in to how my requests per second your machine could handle. First of all, what is the profile for your development machine? Does it mirror what you’ll have in production?

Personally, I think it was silly to avoid the feature benefits of CodeIgniter. It’s a framework that does some things for you, of course at a cost. You can write your own app and framework at a lower level for the best speed, but the counterargument is that you could also have a scaling strategy to make up for the loss of performance. Don’t get me wrong, 20 rps vs. 20 rps is pretty compelling. What I’m saying is if you added in the useful features of CodeIgniter, you may not have been much worse off from the 20 rps number while reaping many more benefits.

#3 Starr on 01.30.08 at 3:27 pm

Hey, Gil - I’d love to see your app whenever you release it to the world, so be sure to ping me.

Personally, I’m getting the dedicated server before beta, because I figure server configuration needs to be tested, just like everything else.

And Carlos - I agree with you that it’s silly to have a whole framework and only use a small part of it. I thought I would use more of the bells and whistles, but wound up not needing them.

The reason is that the ChatSpring backend exists only as a set of web services that take in a query string and spit back JSON. Everything else is implemented in an ext-js client. (Ext is the one framework I’m never giving up for lent. :)

Essentially, It just boils down to money. If I can spend a few days to make the app capable of handling 4x as many customers per server…why not?

#4 Carlos on 01.30.08 at 3:48 pm

I’m with ya. I run a site which outputs dynamic GIFs. While I’m in the process of rebuilding the core of the site with CodeIgniter, the PHP scripts that generate the images will not. Simply no need!

Leave a Comment