Share
Embed
Rails on Solaris and Friends
Why you might consider SmartOS, Solaris, or another Solaris derivative for deploying your Rails application.
Mike Danko
May 16, 2013
Transcript
22 slides
-
As a Developer... • Hey bro, it’s 2013. We have
Heroku. • Platform? The client can gure that out. • Everyone uses Linux. Why bother using anything else? • I got out of ops so I didn’t have to think about this! -
You Should Care Because... • Deploying to Heroku? Great. It
can’t be beat. • If you’re building a service of scale, platform is important. • You can sell your platform as a feature. -
So Why Not Linux? • Well, why not? If it
works for you, great. • There are other options with great ops and development features not available on Linux. • Licensing can work against you if applicable, such as deploying a black box product. -
Let’s Talk Solaris • The Revolution starts with OpenSolaris. •
Derivatives • SmartOS • Nexenta/NexentaStor -
So These Features... • Semantic Commands • Zones • Storage.
ZFS. • DTrace. • Network Virtualization / Crossbow • KVM/Xen • SMF • RBAC -
Semantic Commands • Solaris: ZFS • Linux: • fdisk •
mkfs • lvm • /etc/exports • SAMBA • ETC ETC -
So DTrace? • Count system calls for any process •
See time spent in nanoseconds on any process/method/module/class. • DTrace Toolkit • See Tenderlove’s Blog for More. -
ZFS? • Snapshots Bro. • Boot into a previous environment.
• Block sizes per lesystem. • Reliability - No silent data corruption • Pools! RAIDZ! -
ZFS? (cont.) • 128 Bit - Boiling the Oceans •
Deduplication and Compression. PostgreSQL’s Friend! • Hybrid Storage Pools, SSD/Spindles • Integrated Search • NAS and SAN in the same box. -
ZFS Scenario #1 • Developer Bob is going to create
a migration. • Bob snapshots his Postgres data directory. • Bob screws up. • Bob restores the snapshot. -
ZFS Scenario #2 • Deployer Dan upgrades some packages and
gems. • Explosions, reworks, blue smoke. • Reboot, pick previous environment from GRUB, problem solved. -
ZFS Scenario #3 • NOC Admin Nate has 500,000 RRD
les. • Nate encounters the Linux page/block size problem. • Nate sets the block size at 8k. • Nate cuts down IO by 75%. -
ZFS Scenario #4 • Ops Oliver has a power issue
causing silent data errors on a single disk in a RAIDZ. • ZFS recognizes this, marks the disk bad, and there’s no data loss in the pool. • OIiver ZFS sends the FS to another box, replaces the hardware and moves on with life. -
ZFS Scenario #5 • Maltreated Mike gets little budget. •
His main server is out of space, has four drives of various sizes, and one open slot. • He plugs in the disk and ZFS adds it to the main pool automatically. • ZFS automatically allocates recovery data in an intelligent way across the pool. • He can go on being oppressed in other ways. -
Zones? • Jailesque • Large Zones, Small Zones • Native
and LX Branded • Resource pools, device access -
Zones In Action • Deploy Apache on a zone with
read only access to a le system with content, limit its resources via a pool. • Create another zone with limited access via RBAC (we’ll get there) with RW to the content le system. -
Crossbow • Fine Grained Network Virtualization • Build an entire
network between zones • Dedicate TCP/IP processing to a pool • Bind interfaces arbitrarily. • Killer for things like streaming assets. -
KVM/Xen • Virtualization • Which you get depends on platform
choice • Move VM’s from machine to machine with zero downtime. • Freeze, pause, snapshot, whatever. • Bene ts of Solaris for other platforms. -
SMF • Dependency Order • Message verbosity • Delegation to
non-root users • Parallel starting of services. • Restart after failure -
RBAC • Think SELinux, sudo • Roles allow for: •
A DBA to have complete access to Postgres, nothing else. • An application to only have access to resources in its scope. -
Final Thoughts • If you can’t Heroku... • You can
run these in EC2, the advantages of ZFS are there even if you don’t use other features. • If you need to build your own mini-cloud, there are very few options that are better. • It’s the killer full-stack enterprise product platform.