SlideShare une entreprise Scribd logo
1  sur  37
Télécharger pour lire hors ligne
Merb, not rails? !
A practical introduction to a new framework.
Intro to merb
What is merb?

• MVC Framework.
• Similar to Rails.
• Lightweight, extensible, fast.
Merb Ideology

• Hacker-friendly.
• Core should be small, plugins bountiful.
• Code should be as simple as possible.
• Code should not be “magical.”
Merb is like rails


• Application structure is very similar
• Can use ActiveRecord
What does merb-core include?

• rack-based request handling
• session handling
• before / after filters
• layouts / views with erb
• routing
What does merb-core include?

• gem-based plugins
• mailers
• partials
• exceptions
• generator for controllers, and models
  (integrates with your chosen ORM).
What is elsewhere?

• an ORM (can use ActiveRecord,
  DataMapper, Sequel)
• form helpers such as form_for
  (merb_helper)
• ActiveSupport and all those little ruby
  extensions (extlib?)
What is elsewhere?
• flash (merb_has_flash and
  redirect :message)
 • redirect(quot;/posts/34quot;, :message =>
    { :notice => 'Post updated successfully!' })
• scaffolding
• caching (merb-cache)
• ajax library (merb_jquery)
DataMapper

• Thread-safe.
• Supports data stores you don’t manage.
• Optimizations in eager-loading, lazy-loading,
  etc.
What do we need
 helper functions for?

• Why not just use HTML for templating
  instead of all those helper functions?
• Why not just use JQuery for AJAX instead
  of all those AJAX helper functions?
Thread-safety

• Merb is thread-safe now.
• Rails will be thread-safe in 2.2.
• What does that mean? http://
  blog.headius.com/2008/08/qa-what-thread-
  safe-rails-means.html
Considerations
• Does your app block?
 • File uploads
 • Remote HTTP calls
   • Facebook app: 1-2s wait time?
• Do you have native threads?
 • JRuby / C ruby differences
Instances Required
                                Merb   Rails

C MRI, one core, no blocking     1      1

C MRI, one core, 80% blocking    1      5

C MRI, two cores, no blocking    2      2

C MRI, two core, 80% blocking    2      10

Jruby, one core, no blocking     1      1

Jruby, one core, 80% blocking    1      5

Jruby, two cores, no blocking    1      2

Jruby, two core, 80% blocking    1      10

Jruby, 16 cores, 80% blocking    1      80
Practical Intro Merb
Case study
The Project

• CMS for Faculty.
• Keeps track of courses, education,
  biography info, etc.
• Deployed to Tomcat.
Requirements

• 2500 faculty websites.
• 5 concurrent backend users.
• 500 users per day on the public facing
  pages.
Can Rails handle that?


• One process per file upload?
• RAM requirements?
Why merb?

• Thread-safe.
• Low memory footprint.
• ???
Why JRuby?


• Authentication integration using JRadius
• Java platform lowers IT stress level.
What is development
         like?
• There are no books... yet.
• The codebase is changing.
• Smaller userbase than rails.
• If you are doing anything weird, be prepared
  to corepatch!
Problems
• File upload broken in Tomcat deploy.
• Partial behavior is totally weird.
• Render syntax changed / broke export
  code.
• Activerecord-jdbc mysql quote error.
• String concurrency problem??
Other Issues


• acts_as_list had to be extracted from
  ActiveRecord files and manually included in
  init.rb.
Post-mortem
Speed Comparison

•   Test with simple merb / rails apps using ActiveRecord

•   Tests using ab -n 10000

•   Testing serially, not concurrently.

•   Tested on this MacBook Pro
C MRI Mongrel


• Merb: 170 requests / second
• Rails: 32 requests / second
JRuby Tomcat


• Merb: 69 requests / second
• Rails : 121 requests / second
JRuby Mongrel


• Merb: 104 requests / second
• Rails: 29 requests / second
JRuby Glassfish


• Merb: 106 requests / second
• Rails : 125 requests / second
What is the deal?

• JRuby thread pool, instead of thread
  instantiation?
• Default session handling?
• Overspinning threads in app server?
• Incorrect JIT compilation?
Tomcat Memory Usage

• Merb: ~30 MB for all threads
• Rails: ~60 MB+ additional memory per
  process


• (Tested on Tomcat)
Was it worth it?
• Thread-safety is a minor advantage when it
  comes to file uploads.
• Merb uses less memory.
• Merb is slower than rails.
• Merb may die on string thread-safe bug
  until JRuby / Merb team fix it.
Conclusion
Consider merb if...
• you’re writing a small tool.
• you have limited memory requirements.
• you like trying new ORMs.
• you need fast performance (and you’ve
  figured out why it runs so slow on JRuby).
• you like hacking about in frameworks.
Upcoming

• Merb 1.0 is released Oct 11-12.
• MerbCamp is in San Diego Oct 11-12.
• Merb in Action book (2009?).
Available

• I’m available for contracts again. Talk to me
  here, at 408-646-2240 or
  paulboone@mindbucket.com.
• http://www.mindbucket.com/

Contenu connexe

Tendances

Dconrails Gecco Presentation
Dconrails Gecco PresentationDconrails Gecco Presentation
Dconrails Gecco PresentationJuan J. Merelo
 
Starting a new ruby on rails development
Starting a new ruby on rails developmentStarting a new ruby on rails development
Starting a new ruby on rails developmentNicolas Alpi
 
From java-to-ruby-book-summary
From java-to-ruby-book-summaryFrom java-to-ruby-book-summary
From java-to-ruby-book-summary120bi
 
Merb For The Enterprise
Merb For The EnterpriseMerb For The Enterprise
Merb For The EnterpriseMatt Aimonetti
 
Bitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRubyBitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRubyBrian Sam-Bodden
 
Ola Bini Evolving The Java Platform
Ola Bini Evolving The Java PlatformOla Bini Evolving The Java Platform
Ola Bini Evolving The Java Platformdeimos
 
Fighting Ruby code smell
Fighting Ruby code smellFighting Ruby code smell
Fighting Ruby code smellolegshpynov
 
Myphp-busters: symfony framework (PHPCon.it)
Myphp-busters: symfony framework (PHPCon.it)Myphp-busters: symfony framework (PHPCon.it)
Myphp-busters: symfony framework (PHPCon.it)Stefan Koopmanschap
 
Myphp-busters: symfony framework
Myphp-busters: symfony frameworkMyphp-busters: symfony framework
Myphp-busters: symfony frameworkStefan Koopmanschap
 
WebSocket For Web Rubyists
WebSocket For Web RubyistsWebSocket For Web Rubyists
WebSocket For Web RubyistsMu-Fan Teng
 
Gearman, Supervisor and PHP - Job Management with Sanity!
Gearman, Supervisor and PHP - Job Management with Sanity!Gearman, Supervisor and PHP - Job Management with Sanity!
Gearman, Supervisor and PHP - Job Management with Sanity!Abu Ashraf Masnun
 
JRuby and Google App Engine
JRuby and Google App EngineJRuby and Google App Engine
JRuby and Google App Enginejoshsmoore
 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorialoscon2007
 
Gearman and asynchronous processing in PHP applications
Gearman and asynchronous processing in PHP applicationsGearman and asynchronous processing in PHP applications
Gearman and asynchronous processing in PHP applicationsDinh Pham
 

Tendances (15)

Dconrails Gecco Presentation
Dconrails Gecco PresentationDconrails Gecco Presentation
Dconrails Gecco Presentation
 
Starting a new ruby on rails development
Starting a new ruby on rails developmentStarting a new ruby on rails development
Starting a new ruby on rails development
 
From java-to-ruby-book-summary
From java-to-ruby-book-summaryFrom java-to-ruby-book-summary
From java-to-ruby-book-summary
 
Merb For The Enterprise
Merb For The EnterpriseMerb For The Enterprise
Merb For The Enterprise
 
Bitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRubyBitter Java, Sweeten with JRuby
Bitter Java, Sweeten with JRuby
 
Ola Bini Evolving The Java Platform
Ola Bini Evolving The Java PlatformOla Bini Evolving The Java Platform
Ola Bini Evolving The Java Platform
 
Fighting Ruby code smell
Fighting Ruby code smellFighting Ruby code smell
Fighting Ruby code smell
 
pearls of Perl
pearls of Perlpearls of Perl
pearls of Perl
 
Myphp-busters: symfony framework (PHPCon.it)
Myphp-busters: symfony framework (PHPCon.it)Myphp-busters: symfony framework (PHPCon.it)
Myphp-busters: symfony framework (PHPCon.it)
 
Myphp-busters: symfony framework
Myphp-busters: symfony frameworkMyphp-busters: symfony framework
Myphp-busters: symfony framework
 
WebSocket For Web Rubyists
WebSocket For Web RubyistsWebSocket For Web Rubyists
WebSocket For Web Rubyists
 
Gearman, Supervisor and PHP - Job Management with Sanity!
Gearman, Supervisor and PHP - Job Management with Sanity!Gearman, Supervisor and PHP - Job Management with Sanity!
Gearman, Supervisor and PHP - Job Management with Sanity!
 
JRuby and Google App Engine
JRuby and Google App EngineJRuby and Google App Engine
JRuby and Google App Engine
 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorial
 
Gearman and asynchronous processing in PHP applications
Gearman and asynchronous processing in PHP applicationsGearman and asynchronous processing in PHP applications
Gearman and asynchronous processing in PHP applications
 

En vedette

I made something people want
I made something people wantI made something people want
I made something people wantPaul Pajo
 
talentsinc: Christian Arts & Media and The Cultural Mandate
talentsinc: Christian Arts & Media and The Cultural Mandatetalentsinc: Christian Arts & Media and The Cultural Mandate
talentsinc: Christian Arts & Media and The Cultural MandatePaul Pajo
 
Tech island2014
Tech island2014Tech island2014
Tech island2014Paul Pajo
 
Principal Factors Analysis on IS Survey
Principal Factors Analysis on IS SurveyPrincipal Factors Analysis on IS Survey
Principal Factors Analysis on IS SurveyPaul Pajo
 
Hacker To Founder - Filipino Technical Co-Founders at Work
Hacker To Founder - Filipino Technical Co-Founders at WorkHacker To Founder - Filipino Technical Co-Founders at Work
Hacker To Founder - Filipino Technical Co-Founders at WorkPaul Pajo
 
Using Twitter, Plurk, Etherpad, Pb Works
Using Twitter, Plurk, Etherpad, Pb WorksUsing Twitter, Plurk, Etherpad, Pb Works
Using Twitter, Plurk, Etherpad, Pb WorksPaul Pajo
 

En vedette (7)

I made something people want
I made something people wantI made something people want
I made something people want
 
talentsinc: Christian Arts & Media and The Cultural Mandate
talentsinc: Christian Arts & Media and The Cultural Mandatetalentsinc: Christian Arts & Media and The Cultural Mandate
talentsinc: Christian Arts & Media and The Cultural Mandate
 
24 To 1
24 To 124 To 1
24 To 1
 
Tech island2014
Tech island2014Tech island2014
Tech island2014
 
Principal Factors Analysis on IS Survey
Principal Factors Analysis on IS SurveyPrincipal Factors Analysis on IS Survey
Principal Factors Analysis on IS Survey
 
Hacker To Founder - Filipino Technical Co-Founders at Work
Hacker To Founder - Filipino Technical Co-Founders at WorkHacker To Founder - Filipino Technical Co-Founders at Work
Hacker To Founder - Filipino Technical Co-Founders at Work
 
Using Twitter, Plurk, Etherpad, Pb Works
Using Twitter, Plurk, Etherpad, Pb WorksUsing Twitter, Plurk, Etherpad, Pb Works
Using Twitter, Plurk, Etherpad, Pb Works
 

Similaire à Practical Intro Merb

Merb presentation at ORUG
Merb presentation at ORUGMerb presentation at ORUG
Merb presentation at ORUGMatt Aimonetti
 
J Ruby Power On The Jvm
J Ruby Power On The JvmJ Ruby Power On The Jvm
J Ruby Power On The JvmQConLondon2008
 
Merb Presentation
Merb PresentationMerb Presentation
Merb Presentationgueste4d7fc
 
Introduction to JRuby
Introduction to JRubyIntroduction to JRuby
Introduction to JRubyAmit Solanki
 
Ola Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The JvmOla Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The Jvmdeimos
 
Xen_and_Rails_deployment
Xen_and_Rails_deploymentXen_and_Rails_deployment
Xen_and_Rails_deploymentAbhishek Singh
 
Merb The Super Bike Of Frameworks
Merb The Super Bike Of FrameworksMerb The Super Bike Of Frameworks
Merb The Super Bike Of FrameworksRowan Hick
 
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Coursepeter_marklund
 
Rails on JRuby
Rails on JRubyRails on JRuby
Rails on JRubyRob C
 
Flickr Architecture Presentation
Flickr Architecture PresentationFlickr Architecture Presentation
Flickr Architecture Presentationweb25
 
JRoR Deploying Rails on JRuby
JRoR Deploying Rails on JRubyJRoR Deploying Rails on JRuby
JRoR Deploying Rails on JRubyelliando dias
 
The Current State of Asynchronous Processing With Ruby
The Current State of Asynchronous Processing With RubyThe Current State of Asynchronous Processing With Ruby
The Current State of Asynchronous Processing With Rubymattmatt
 
The Year of JRuby - RubyC 2018
The Year of JRuby - RubyC 2018The Year of JRuby - RubyC 2018
The Year of JRuby - RubyC 2018Charles Nutter
 
Rails hosting
Rails hostingRails hosting
Rails hostingwonko
 
Jvm tuning in a rush! - Lviv JUG
Jvm tuning in a rush! - Lviv JUGJvm tuning in a rush! - Lviv JUG
Jvm tuning in a rush! - Lviv JUGTomek Borek
 
Rails Conf Europe 2007 Notes
Rails Conf  Europe 2007  NotesRails Conf  Europe 2007  Notes
Rails Conf Europe 2007 NotesRoss Lawley
 

Similaire à Practical Intro Merb (20)

Merb presentation at ORUG
Merb presentation at ORUGMerb presentation at ORUG
Merb presentation at ORUG
 
J Ruby Power On The Jvm
J Ruby Power On The JvmJ Ruby Power On The Jvm
J Ruby Power On The Jvm
 
re7olabini
re7olabinire7olabini
re7olabini
 
Merb Presentation
Merb PresentationMerb Presentation
Merb Presentation
 
Introduction to JRuby
Introduction to JRubyIntroduction to JRuby
Introduction to JRuby
 
Ola Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The JvmOla Bini J Ruby Power On The Jvm
Ola Bini J Ruby Power On The Jvm
 
Xen_and_Rails_deployment
Xen_and_Rails_deploymentXen_and_Rails_deployment
Xen_and_Rails_deployment
 
Scaling the Rails
Scaling the RailsScaling the Rails
Scaling the Rails
 
Merb The Super Bike Of Frameworks
Merb The Super Bike Of FrameworksMerb The Super Bike Of Frameworks
Merb The Super Bike Of Frameworks
 
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
 
Rails on JRuby
Rails on JRubyRails on JRuby
Rails on JRuby
 
Flickr Architecture Presentation
Flickr Architecture PresentationFlickr Architecture Presentation
Flickr Architecture Presentation
 
JRoR Deploying Rails on JRuby
JRoR Deploying Rails on JRubyJRoR Deploying Rails on JRuby
JRoR Deploying Rails on JRuby
 
The Current State of Asynchronous Processing With Ruby
The Current State of Asynchronous Processing With RubyThe Current State of Asynchronous Processing With Ruby
The Current State of Asynchronous Processing With Ruby
 
Merb + Nanite
Merb + NaniteMerb + Nanite
Merb + Nanite
 
The Year of JRuby - RubyC 2018
The Year of JRuby - RubyC 2018The Year of JRuby - RubyC 2018
The Year of JRuby - RubyC 2018
 
Rails hosting
Rails hostingRails hosting
Rails hosting
 
Jvm tuning in a rush! - Lviv JUG
Jvm tuning in a rush! - Lviv JUGJvm tuning in a rush! - Lviv JUG
Jvm tuning in a rush! - Lviv JUG
 
Spark Tips & Tricks
Spark Tips & TricksSpark Tips & Tricks
Spark Tips & Tricks
 
Rails Conf Europe 2007 Notes
Rails Conf  Europe 2007  NotesRails Conf  Europe 2007  Notes
Rails Conf Europe 2007 Notes
 

Plus de Paul Pajo

Geeks On A Beach 2013: Mobile App Trends
Geeks On A Beach 2013: Mobile App TrendsGeeks On A Beach 2013: Mobile App Trends
Geeks On A Beach 2013: Mobile App TrendsPaul Pajo
 
Have Code, Will Compete
Have Code, Will CompeteHave Code, Will Compete
Have Code, Will CompetePaul Pajo
 
My excel reviewer
My excel reviewer My excel reviewer
My excel reviewer Paul Pajo
 
Social Network-Driven Voter's Education
Social Network-Driven Voter's EducationSocial Network-Driven Voter's Education
Social Network-Driven Voter's EducationPaul Pajo
 
Presidentiable Leadeship Similiarity Survey
Presidentiable Leadeship Similiarity SurveyPresidentiable Leadeship Similiarity Survey
Presidentiable Leadeship Similiarity SurveyPaul Pajo
 
Principal Factors Analysis of IS Survey
Principal Factors Analysis of IS SurveyPrincipal Factors Analysis of IS Survey
Principal Factors Analysis of IS SurveyPaul Pajo
 
Cloud Computing Nist Paul Pajo
Cloud Computing Nist Paul PajoCloud Computing Nist Paul Pajo
Cloud Computing Nist Paul PajoPaul Pajo
 
ITETHIC Accomplisment Report 3 T 2008 2009
ITETHIC Accomplisment Report 3 T 2008 2009ITETHIC Accomplisment Report 3 T 2008 2009
ITETHIC Accomplisment Report 3 T 2008 2009Paul Pajo
 
Will You Be The Next Social Entrepreneur Mar 27, 2009
Will You Be The Next Social Entrepreneur Mar 27, 2009Will You Be The Next Social Entrepreneur Mar 27, 2009
Will You Be The Next Social Entrepreneur Mar 27, 2009Paul Pajo
 
Drip In Cultural Commons
Drip In Cultural CommonsDrip In Cultural Commons
Drip In Cultural CommonsPaul Pajo
 
Practical Intro Merb
Practical Intro MerbPractical Intro Merb
Practical Intro MerbPaul Pajo
 
Accomplishment Report Sysanal Itethic 1t20082009
Accomplishment Report Sysanal Itethic 1t20082009Accomplishment Report Sysanal Itethic 1t20082009
Accomplishment Report Sysanal Itethic 1t20082009Paul Pajo
 
Jasig Rubyon Rails
Jasig Rubyon RailsJasig Rubyon Rails
Jasig Rubyon RailsPaul Pajo
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method InvocationPaul Pajo
 
Ruby On Rails Presentation
Ruby On Rails PresentationRuby On Rails Presentation
Ruby On Rails PresentationPaul Pajo
 
Introduction To Business Ethics
Introduction To Business EthicsIntroduction To Business Ethics
Introduction To Business EthicsPaul Pajo
 
P I C S Ecommerce In The Region E Not What It Used To Be V2
P I C S  Ecommerce In The  Region  E  Not  What  It  Used  To  Be V2P I C S  Ecommerce In The  Region  E  Not  What  It  Used  To  Be V2
P I C S Ecommerce In The Region E Not What It Used To Be V2Paul Pajo
 
Andrian Lee Web 2.0 For The 3.0 Ngo
Andrian Lee   Web 2.0 For The 3.0 NgoAndrian Lee   Web 2.0 For The 3.0 Ngo
Andrian Lee Web 2.0 For The 3.0 NgoPaul Pajo
 

Plus de Paul Pajo (18)

Geeks On A Beach 2013: Mobile App Trends
Geeks On A Beach 2013: Mobile App TrendsGeeks On A Beach 2013: Mobile App Trends
Geeks On A Beach 2013: Mobile App Trends
 
Have Code, Will Compete
Have Code, Will CompeteHave Code, Will Compete
Have Code, Will Compete
 
My excel reviewer
My excel reviewer My excel reviewer
My excel reviewer
 
Social Network-Driven Voter's Education
Social Network-Driven Voter's EducationSocial Network-Driven Voter's Education
Social Network-Driven Voter's Education
 
Presidentiable Leadeship Similiarity Survey
Presidentiable Leadeship Similiarity SurveyPresidentiable Leadeship Similiarity Survey
Presidentiable Leadeship Similiarity Survey
 
Principal Factors Analysis of IS Survey
Principal Factors Analysis of IS SurveyPrincipal Factors Analysis of IS Survey
Principal Factors Analysis of IS Survey
 
Cloud Computing Nist Paul Pajo
Cloud Computing Nist Paul PajoCloud Computing Nist Paul Pajo
Cloud Computing Nist Paul Pajo
 
ITETHIC Accomplisment Report 3 T 2008 2009
ITETHIC Accomplisment Report 3 T 2008 2009ITETHIC Accomplisment Report 3 T 2008 2009
ITETHIC Accomplisment Report 3 T 2008 2009
 
Will You Be The Next Social Entrepreneur Mar 27, 2009
Will You Be The Next Social Entrepreneur Mar 27, 2009Will You Be The Next Social Entrepreneur Mar 27, 2009
Will You Be The Next Social Entrepreneur Mar 27, 2009
 
Drip In Cultural Commons
Drip In Cultural CommonsDrip In Cultural Commons
Drip In Cultural Commons
 
Practical Intro Merb
Practical Intro MerbPractical Intro Merb
Practical Intro Merb
 
Accomplishment Report Sysanal Itethic 1t20082009
Accomplishment Report Sysanal Itethic 1t20082009Accomplishment Report Sysanal Itethic 1t20082009
Accomplishment Report Sysanal Itethic 1t20082009
 
Jasig Rubyon Rails
Jasig Rubyon RailsJasig Rubyon Rails
Jasig Rubyon Rails
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method Invocation
 
Ruby On Rails Presentation
Ruby On Rails PresentationRuby On Rails Presentation
Ruby On Rails Presentation
 
Introduction To Business Ethics
Introduction To Business EthicsIntroduction To Business Ethics
Introduction To Business Ethics
 
P I C S Ecommerce In The Region E Not What It Used To Be V2
P I C S  Ecommerce In The  Region  E  Not  What  It  Used  To  Be V2P I C S  Ecommerce In The  Region  E  Not  What  It  Used  To  Be V2
P I C S Ecommerce In The Region E Not What It Used To Be V2
 
Andrian Lee Web 2.0 For The 3.0 Ngo
Andrian Lee   Web 2.0 For The 3.0 NgoAndrian Lee   Web 2.0 For The 3.0 Ngo
Andrian Lee Web 2.0 For The 3.0 Ngo
 

Dernier

UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7DianaGray10
 
Governance in SharePoint Premium:What's in the box?
Governance in SharePoint Premium:What's in the box?Governance in SharePoint Premium:What's in the box?
Governance in SharePoint Premium:What's in the box?Juan Carlos Gonzalez
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Brian Pichman
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostMatt Ray
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfAijun Zhang
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024D Cloud Solutions
 
IEEE Computer Society’s Strategic Activities and Products including SWEBOK Guide
IEEE Computer Society’s Strategic Activities and Products including SWEBOK GuideIEEE Computer Society’s Strategic Activities and Products including SWEBOK Guide
IEEE Computer Society’s Strategic Activities and Products including SWEBOK GuideHironori Washizaki
 
100+ ChatGPT Prompts for SEO Optimization
100+ ChatGPT Prompts for SEO Optimization100+ ChatGPT Prompts for SEO Optimization
100+ ChatGPT Prompts for SEO Optimizationarrow10202532yuvraj
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8DianaGray10
 
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"DianaGray10
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1DianaGray10
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Commit University
 
Valere | Digital Solutions & AI Transformation Portfolio | 2024
Valere | Digital Solutions & AI Transformation Portfolio | 2024Valere | Digital Solutions & AI Transformation Portfolio | 2024
Valere | Digital Solutions & AI Transformation Portfolio | 2024Alexander Turgeon
 
UiPath Studio Web workshop series - Day 5
UiPath Studio Web workshop series - Day 5UiPath Studio Web workshop series - Day 5
UiPath Studio Web workshop series - Day 5DianaGray10
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding TeamAdam Moalla
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXTarek Kalaji
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 
99.99% of Your Traces Are (Probably) Trash (SRECon NA 2024).pdf
99.99% of Your Traces  Are (Probably) Trash (SRECon NA 2024).pdf99.99% of Your Traces  Are (Probably) Trash (SRECon NA 2024).pdf
99.99% of Your Traces Are (Probably) Trash (SRECon NA 2024).pdfPaige Cruz
 

Dernier (20)

UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7
 
Governance in SharePoint Premium:What's in the box?
Governance in SharePoint Premium:What's in the box?Governance in SharePoint Premium:What's in the box?
Governance in SharePoint Premium:What's in the box?
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )
 
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCostKubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
KubeConEU24-Monitoring Kubernetes and Cloud Spend with OpenCost
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdf
 
201610817 - edge part1
201610817 - edge part1201610817 - edge part1
201610817 - edge part1
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024
 
IEEE Computer Society’s Strategic Activities and Products including SWEBOK Guide
IEEE Computer Society’s Strategic Activities and Products including SWEBOK GuideIEEE Computer Society’s Strategic Activities and Products including SWEBOK Guide
IEEE Computer Society’s Strategic Activities and Products including SWEBOK Guide
 
100+ ChatGPT Prompts for SEO Optimization
100+ ChatGPT Prompts for SEO Optimization100+ ChatGPT Prompts for SEO Optimization
100+ ChatGPT Prompts for SEO Optimization
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8
 
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
UiPath Clipboard AI: "A TIME Magazine Best Invention of 2023 Unveiled"
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)
 
Valere | Digital Solutions & AI Transformation Portfolio | 2024
Valere | Digital Solutions & AI Transformation Portfolio | 2024Valere | Digital Solutions & AI Transformation Portfolio | 2024
Valere | Digital Solutions & AI Transformation Portfolio | 2024
 
UiPath Studio Web workshop series - Day 5
UiPath Studio Web workshop series - Day 5UiPath Studio Web workshop series - Day 5
UiPath Studio Web workshop series - Day 5
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team
 
VoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBXVoIP Service and Marketing using Odoo and Asterisk PBX
VoIP Service and Marketing using Odoo and Asterisk PBX
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 
99.99% of Your Traces Are (Probably) Trash (SRECon NA 2024).pdf
99.99% of Your Traces  Are (Probably) Trash (SRECon NA 2024).pdf99.99% of Your Traces  Are (Probably) Trash (SRECon NA 2024).pdf
99.99% of Your Traces Are (Probably) Trash (SRECon NA 2024).pdf
 

Practical Intro Merb

  • 1. Merb, not rails? ! A practical introduction to a new framework.
  • 3. What is merb? • MVC Framework. • Similar to Rails. • Lightweight, extensible, fast.
  • 4. Merb Ideology • Hacker-friendly. • Core should be small, plugins bountiful. • Code should be as simple as possible. • Code should not be “magical.”
  • 5. Merb is like rails • Application structure is very similar • Can use ActiveRecord
  • 6. What does merb-core include? • rack-based request handling • session handling • before / after filters • layouts / views with erb • routing
  • 7. What does merb-core include? • gem-based plugins • mailers • partials • exceptions • generator for controllers, and models (integrates with your chosen ORM).
  • 8. What is elsewhere? • an ORM (can use ActiveRecord, DataMapper, Sequel) • form helpers such as form_for (merb_helper) • ActiveSupport and all those little ruby extensions (extlib?)
  • 9. What is elsewhere? • flash (merb_has_flash and redirect :message) • redirect(quot;/posts/34quot;, :message => { :notice => 'Post updated successfully!' }) • scaffolding • caching (merb-cache) • ajax library (merb_jquery)
  • 10. DataMapper • Thread-safe. • Supports data stores you don’t manage. • Optimizations in eager-loading, lazy-loading, etc.
  • 11. What do we need helper functions for? • Why not just use HTML for templating instead of all those helper functions? • Why not just use JQuery for AJAX instead of all those AJAX helper functions?
  • 12. Thread-safety • Merb is thread-safe now. • Rails will be thread-safe in 2.2. • What does that mean? http:// blog.headius.com/2008/08/qa-what-thread- safe-rails-means.html
  • 13. Considerations • Does your app block? • File uploads • Remote HTTP calls • Facebook app: 1-2s wait time? • Do you have native threads? • JRuby / C ruby differences
  • 14. Instances Required Merb Rails C MRI, one core, no blocking 1 1 C MRI, one core, 80% blocking 1 5 C MRI, two cores, no blocking 2 2 C MRI, two core, 80% blocking 2 10 Jruby, one core, no blocking 1 1 Jruby, one core, 80% blocking 1 5 Jruby, two cores, no blocking 1 2 Jruby, two core, 80% blocking 1 10 Jruby, 16 cores, 80% blocking 1 80
  • 17. The Project • CMS for Faculty. • Keeps track of courses, education, biography info, etc. • Deployed to Tomcat.
  • 18. Requirements • 2500 faculty websites. • 5 concurrent backend users. • 500 users per day on the public facing pages.
  • 19. Can Rails handle that? • One process per file upload? • RAM requirements?
  • 20. Why merb? • Thread-safe. • Low memory footprint. • ???
  • 21. Why JRuby? • Authentication integration using JRadius • Java platform lowers IT stress level.
  • 22. What is development like? • There are no books... yet. • The codebase is changing. • Smaller userbase than rails. • If you are doing anything weird, be prepared to corepatch!
  • 23. Problems • File upload broken in Tomcat deploy. • Partial behavior is totally weird. • Render syntax changed / broke export code. • Activerecord-jdbc mysql quote error. • String concurrency problem??
  • 24. Other Issues • acts_as_list had to be extracted from ActiveRecord files and manually included in init.rb.
  • 26. Speed Comparison • Test with simple merb / rails apps using ActiveRecord • Tests using ab -n 10000 • Testing serially, not concurrently. • Tested on this MacBook Pro
  • 27. C MRI Mongrel • Merb: 170 requests / second • Rails: 32 requests / second
  • 28. JRuby Tomcat • Merb: 69 requests / second • Rails : 121 requests / second
  • 29. JRuby Mongrel • Merb: 104 requests / second • Rails: 29 requests / second
  • 30. JRuby Glassfish • Merb: 106 requests / second • Rails : 125 requests / second
  • 31. What is the deal? • JRuby thread pool, instead of thread instantiation? • Default session handling? • Overspinning threads in app server? • Incorrect JIT compilation?
  • 32. Tomcat Memory Usage • Merb: ~30 MB for all threads • Rails: ~60 MB+ additional memory per process • (Tested on Tomcat)
  • 33. Was it worth it? • Thread-safety is a minor advantage when it comes to file uploads. • Merb uses less memory. • Merb is slower than rails. • Merb may die on string thread-safe bug until JRuby / Merb team fix it.
  • 35. Consider merb if... • you’re writing a small tool. • you have limited memory requirements. • you like trying new ORMs. • you need fast performance (and you’ve figured out why it runs so slow on JRuby). • you like hacking about in frameworks.
  • 36. Upcoming • Merb 1.0 is released Oct 11-12. • MerbCamp is in San Diego Oct 11-12. • Merb in Action book (2009?).
  • 37. Available • I’m available for contracts again. Talk to me here, at 408-646-2240 or paulboone@mindbucket.com. • http://www.mindbucket.com/