Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Rails on Solaris and Friends

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
Tweet

More Decks by Mike Danko

Other Decks in Technology

Transcript

  1. 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!
  2. 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.
  3. 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.
  4. Let’s Talk Solaris • The Revolution starts with OpenSolaris. •

    Derivatives • SmartOS • Nexenta/NexentaStor
  5. So These Features... • Semantic Commands • Zones • Storage.

    ZFS. • DTrace. • Network Virtualization / Crossbow • KVM/Xen • SMF • RBAC
  6. Semantic Commands • Solaris: ZFS • Linux: • fdisk •

    mkfs • lvm • /etc/exports • SAMBA • ETC ETC
  7. 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.
  8. ZFS? • Snapshots Bro. • Boot into a previous environment.

    • Block sizes per lesystem. • Reliability - No silent data corruption • Pools! RAIDZ!
  9. 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.
  10. ZFS Scenario #1 • Developer Bob is going to create

    a migration. • Bob snapshots his Postgres data directory. • Bob screws up. • Bob restores the snapshot.
  11. ZFS Scenario #2 • Deployer Dan upgrades some packages and

    gems. • Explosions, reworks, blue smoke. • Reboot, pick previous environment from GRUB, problem solved.
  12. 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%.
  13. 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.
  14. 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.
  15. Zones? • Jailesque • Large Zones, Small Zones • Native

    and LX Branded • Resource pools, device access
  16. 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.
  17. 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.
  18. 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.
  19. SMF • Dependency Order • Message verbosity • Delegation to

    non-root users • Parallel starting of services. • Restart after failure
  20. 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.
  21. 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.