Easy and Fast Solaris Zone Creation

Posted by Sam

Want to automate the creation of Solaris zones or just want to create zones faster? Using Zone Manager you can save yourself several steps and even some time. As I'll show below you can easily create a brand new zone in less than two minutes with one command. Grab Zone Manager and stick it in your path. I put mine in /usr/sbin. Here's an example: bash-3.00# time zonemgr -a add \
> -n web1 \
> -z /opt/zones \
> -P secret \
> -I "10.100.1.1|bge0|255.255.255.0|web1" \
> -C /etc/resolv.conf \
> -C /etc/nsswitch.conf

Checking to see if the zone IP address (10.100.1.1) is already in use...IP is available.
Preparing to install zone < web1 >.
Creating list of files to copy from the global zone.
Copying <297> files to the zone.
Initializing zone product registry.
Determining zone package initialization order.
Preparing to initialize <205> packages on the zone.
Initialized <205> packages on zone.
Zone < web1 > is initialized.
The file contains a log of the zone installation.
Creating the sysidcfg file for automated zone configuration.
Copying (/etc/resolv.conf) from the global zone to (/etc/resolv.conf) in the non-global zone.
Copying (/etc/nsswitch.conf) from the global zone to (/etc/nsswitch.conf) in the non-global zone.
Copy completed.
Booting zone for the first time.
Waiting for first boot tasks to complete.
Updating netmask information.
Copying (/etc/nsswitch.conf) from the global zone to (/etc/nsswitch.conf) in the non-global zone.
Copy completed.
Updating /etc/inet/hosts of the global zone with the webshell IP information.
Zone web1 is ready.

real 1m52.449s
user 0m12.063s
sys 0m16.275s

What we did

Here's what we did, line by line.

  1. Add the zone
  2. Name the zone web1
  3. Create the zone in /opt/zones/web1
  4. Set the password to secret
  5. Set the IP address, ethernet adaptor, subnet mask and hostname
  6. Copy the resolv.conf file from the global zone
  7. Copy the nsswitch.conf file from the global zone

That's it! With one command and in less than two minutes you have a brand new, fully functional zone. For more information on Zone Manager check out the docs. You can also subscribe to the Zone Manager blog. To see how much time and how many steps that saves check out this blog. Happy Zoning!

Tags: solaris zones

Easy Ruby on Rails Deployments

Posted by Sam

A couple of days ago a large web hosting company named DreamHost posted a blog about how Ruby on Rails could be improved. Some of what they are wrestling with I also wrestled with when we first started deploying Rails applications. But honestly I figured out how to overcome these problems several years ago so I'm wondering what their problem is. Just to put my money where my mouth is I thought I would touch on their points one by one.

Ruby on Rails needs to be a helluva lot faster. With a proper accelerator it’s nicely usable but without one it’s painful. Ruby itself is a big part of the problem so this one may come down to just simplifying the management of the accelerator technologies, unfortunately. Mongrel seems like a big step in the right direction, even though it’s not Rails-specific. I hope the Rails core developers will be cooperating a lot more closely with Mongrel developers in the future. Ok, where to begin on this. First of all let me say for the record that I don't understand why everybody insists on saying Rails is soooo slow. Judging by all the Rails is slow posts all over the net you would think it takes days to load a page, yet these folks handled it just fine. Any technology can fold under traffic and just about any technology if used correctly can scale. Is Ruby the fastest language? No, definitely not. Neither is PHP. If you really need speed you need to go with Java or C and you need to code it correctly. A fast language alone is no guarantee of performance. And because PHP has to startup every time a request comes in it can easily be much slower than Rails.

As for Mongrel being a big step in the right direction I couldn't disagree more strongly. Mongrel is a nightmare for hosting more than one or two sites. Having to setup clusters that don't grow and shrink based on the load is ridiculous. Especially for a shared hosting environment. I can't believe people have latched on to this so much and if Zed is so brilliant why can't he think of a MUCH better way to handle this. LiteSpeed handles this a million times better. Basically just tell LiteSpeed the maximum number of Rails instances and it handles bringing them up and down to handle the load. Oh yeah and LiteSpeed is much faster than Apache so all the way around it's a better setup.

Ruby on Rails needs to more or less work in ANY environment. You can’t just expect your users to set up their servers any which way. There are millions of established systems that cannot simply integrate any bleeding edge technology you think is better this week. If you continue to keep this attitude you are surely shooting yourselves in both feet. I'm guessing by any environment what they are really upset about is that it doesn't work in their environment. Guess what? To support a new technology you often have to make changes. When Java came on the scene you had to add additional application servers, which is far more of a pain than what Rails asks of you. And it does work in pretty much environment. Your real complaint is that it doesn't work in your broken environment. This is really your problem. There are plenty of places where Rails will work just fine as David points out in his blog.

You need to maintain backwards compatibility better. Admittedly this is the area where PHP has historically done very poorly, but that’s no reason to not one-up them. Also, Rails is admittedly very young as a development platform and you guys have gotten a LOT of attention very early on. Still, with big hype comes big responsibility. You need to keep the momentum going now. This is just dumb. Rails is an incredibly new framework and they have great backwards compatibility. In fact they have full backwards compatibility. If your site doesn't work with the latest version of Rails just stick with the one you are using. You can have hundreds of different versions of Rails installed at the same time and the app can use whatever version is wishes. This is full backwards compatibility.

Officially support shared hosting environments. The feeling I get from the Rails community is that Rails is being pushed as some sort of high-end application system and that makes it ok to ignore the vast majority of user web environments. You simply cannot ignore the shared hosting users. In my opinion, the one thing the PHP people did that got them to where they are today is to embrace shared hosting and work hard to make their software work well within it. That means it has to be very lightweight (it may be too late for that in Rails already!), and it has to ‘plug in’ to a wide variety of operating environments with minimal fuss and hassle. Compatibility work like that is not glamorous, exciting, or fun, but it’s gotta be done. The reason you get the feeling that Rails is some sort of high-end application system is because to some extent you are right. You absolutely can't ignore shared hosting? Really? Seems to have worked OK for Java. Why doesn't DreamHost support Java? Let me guess, because it's too heavy weight? Rails is a full fledged web development framework. Just like Java, it's always in memory so that it can take advantage of being a long running process. This is less than ideal for hosting companies that are trying to sell $5 hosting packages, but for building real web applications this is almost a necessity. I'd say not only CAN they ignore shared hosting companies but they quite successfully are ignore you. Rails doesn't lend itself as well to shared hosting as well as PHP does. It's up to the shared hosting companies to figure that out. That's what YOUR business is. Oh and several hosting companies can and have figured it out so your public rant is really kind of embarrassing for DreamHost.

Tags: rubyonrails litespeed

Perks of the Job

Posted by Sam

Nearly three months ago I posted a blog about Barkley (my employer) being on 20/20. Originally, I believe the story was supposed to air in November and then it was allegedly pushed back so they could extend our time. Well, looks like we are back in the news for being a top place to work. This time we are being recognized by CNN. Yes, that CNN. You can read the whole article here.

If you don't have time or desire to read the article I'll sum it up for you. Barkley came in number one in a list of twelve companies that are noted for being great places to work. We even beat out Google who was quite a ways behind us at number seven. Read it for yourself if you don't believe me. The funny thing is that they left off quite a few perks. Some of which they list under other companies, like the paid winter break. Maybe they felt like they needed to leave something for the other guys to brag about. I won't rehash all of our perks, but if you care you can go read my old blog post. I've said it before and I'll say it again. Barkley isn't a perfect place to work, but they definitely spend a lot of time, money and thought on their employees. I guess this makes sense since employee owned, but it's still pretty impressive how us lowly employees get treated. I for one am very glad to be a part of Barkley!

Tags: barkley

Merry Christmas to Me!

Posted by Sam

This year was probably the best Christmas I've ever had and the icing on the cake was that I asked Katie to marry me on Christmas day and she accepted. I wasn't sure at first because tears could go an either way, but eventually I heard a yes through the tears (of joy). :) Here's a shot of her beautiful wedding ring.

Tags: personal

Bad Christmas Gifts

Posted by Sam

In my last post (Annoying Flash Issues) I referred to the Barkley Holiday site that I was working on. I couldn't really talk about what it was at the time, but we unveiled it last week so I think I can safely publish the site URL on my blog. The site is called the Bad Gift Emporium and it's really bad. On purpose. The idea is you can upload your bad gifts for all the world to see. If you are willing to part with your bad gift you can even trade or sell it on the site. Let me know what you think.

Bad Gift Emporium - Barkley

Tags: web humor