SlideShare ist ein Scribd-Unternehmen logo
1 von 43
Downloaden Sie, um offline zu lesen
Mongrel2
 an introduction

     Paolo Negri - @hungryblank
Berlin Ruby User Group 7th Oct 2010
1st something
    about
  Mongrel1
Mongrel1

“Mongrel is a small library that
provides a very fast HTTP 1.1 server
for Ruby web applications.”


                   (Mongrel README)
Mongrel1

“Unicorn is copyright 2009 by all
contributors.
It is based on Mongrel”
                   (Unicorn README)
Mongrel1
“Thin is a Ruby web server that glues
together 3 of the best Ruby libraries in
web history:
•   the Mongrel parser...”
                        (Thin homepage)
Mongrel1
“Back then I wrote a little Ruby web
server called Ebb that was meant to be
a faster Mongrel.
That code was the starting point for
Node”
            (Ryan Dahl, node.js author)
Mongrel2 and Mongrel1
        share
 • HTTP parser
 • author - @zedshaw
Mongrel2
    is a web server

•
•
•
    application
    language
    network architecture   }   agnostic
Mongrel2
       Language Agnostic
•   Focus on HTTP
•   Not for a specific language
•   Use it with Ruby, Python, C++, PHP, Haskell,
    Common Lisp, Perl, .NET, Clojure, Lua ...
Mongrel2
MVC configuration
 M         V       C
SQLite3           Mongrel
           m2sh
Database          Process
Mongrel2
  MVC configuration
     M             V            C
    SQLite3                    Mongrel
                   m2sh
    Database                   Process




Configuration is stored in SQLite3 database
Mongrel2
MVC configuration
 M            V            C
SQLite3                   Mongrel
              m2sh
Database                  Process




 m2sh writes/reads configuration
Mongrel2
   MVC configuration
     M             V           C
    SQLite3                   Mongrel
                  m2sh
    Database                  Process




Mongrel reads config from SQLite3 and runs
               accordingly
Mongrel2
         m2sh - query
$ m2sh servers -db tests/config.sqlite

SERVERS:
------
 test localhost
AC1F8236-5919-4696-9D40-0F38DE9E5861

$ m2sh hosts -db tests/config.sqlite -
server test

HOSTS in test:
-----
 1 localhost
Mongrel2
   m2sh - launch/manage
$ m2sh start -db tests/config.sqlite 
   -host localhost -sudo


$ m2sh reload -db tests/config.sqlite  
    -host localhost 
Mongrel2
        Configuration
     Load a configuration file with m2sh
$ m2sh load -config 
  examples/config/sample.conf
Mongrel2
                 Configuration
main = Server( 
    uuid="f400bf85-4538-4f7a-8908-67e313d515c2", 
    access_log="/logs/access.log", 
    error_log="/logs/error.log", 
    chroot="./", 
    default_host="localhost", 
    name="test", 
    pid_file="/run/mongrel2.pid", 
    port=6767, 
    hosts = [ 
        Host(name="localhost", routes={ 
            '/tests/': Dir(base='tests/', index_file='index.html', 
                             default_ctype='text/plain') 
        }) 
    ] 
) 
Mongrel2
                 Configuration
                   Unique server identifier
main = Server( 
    uuid="f400bf85-4538-4f7a-8908-67e313d515c2", 
    access_log="/logs/access.log", 
    error_log="/logs/error.log", 
    chroot="./", 
    default_host="localhost", 
    name="test", 
    pid_file="/run/mongrel2.pid", 
    port=6767, 
    hosts = [ 
        Host(name="localhost", routes={ 
            '/tests/': Dir(base='tests/', index_file='index.html', 
                             default_ctype='text/plain') 
        }) 
    ] 
) 
Mongrel2
                 Configuration
            logfiles, port, server name, pid...
main = Server( 
    uuid="f400bf85-4538-4f7a-8908-67e313d515c2", 
    access_log="/logs/access.log", 
    error_log="/logs/error.log", 
    chroot="./", 
    default_host="localhost", 
    name="test", 
    pid_file="/run/mongrel2.pid", 
    port=6767, 
    hosts = [ 
        Host(name="localhost", routes={ 
            '/tests/': Dir(base='tests/', index_file='index.html', 
                             default_ctype='text/plain') 
        }) 
    ] 
) 
Mongrel2
        Configuration
• Server
 • Host
     • Route
         • Dir
         • Proxy
         • Handler
Mongrel2
        Configuration
• Server             Is the root element
                     of a configuration
 • Host
     • Route
         • Dir
         • Proxy
         • Handler
Mongrel2
           Configuration
• Server            DNS hostname to
                    answer for
 • Host             A server can
    • Route         contain multiple
        • Dir       hosts

        • Proxy
        • Handler
Mongrel2
           Configuration
• Server            URL paths and
                    patterns to match
 • Host             example ‘/images/’
    • Route
        • Dir
        • Proxy
        • Handler
Mongrel2
        Configuration
• Server             Serves files out of a
                     directory
 • Host              (full 304 and ETag
     • Route         support)
         • Dir
         • Proxy
         • Handler
Mongrel2
           Configuration
• Server            Requests matching the
                    route are sent to
 • Host             another HTTP server
    • Route
        • Dir
        • Proxy
        • Handler
Mongrel2
        Configuration
• Server             “A Handler is the best
                     part of Mongrel2”
 • Host
     • Route
         • Dir
         • Proxy
         • Handler
Mongrel2
Handler
 browser


mongrel2

 handler
Mongrel2
Handler
 browser


mongrel2

 handler
Mongrel2
Handler
 browser


mongrel2

 handler
Mongrel2
Handler
 browser


mongrel2

 handler
Mongrel2
            Handler

• Handlers receive asynchronous requests
  from Mongrel2
• Handlers and Mongrel2 communicate via
  ØMQ sockets
Mongrel2
Handler
 mongrel2
ØMQ sockets
 handler
  handler
   handler
Mongrel2
           Handler
           mongrel2
   Push/Pull        Pub/Sub
            handler
Requests                 Responses
             handler
              handler
Mongrel2
               Handler
               mongrel2
     Push/Pull          Pub/Sub
                handler
 Requests                    Responses
Round robin
                 handler
distribution      handler
Mongrel2
           Handler
           mongrel2
   Push/Pull        Pub/Sub
            handler
Requests                 Responses
             handler    Target up to
              handler    128 clients
Mongrel2
           Handler
UUID ID PATH SIZE:HEADERS,SIZE:BODY

   Push/Pull        Pub/Sub
            handler
Requests                  Responses
             handler
              handler
Mongrel2
           Handler
       UUID SIZE:ID ID ID, BODY

   Push/Pull          Pub/Sub
             handler
Requests                     Responses
              handler
               handler
Mongrel2
            Handler

• One or many handlers
• Increase/decrease # of handlers while the
  server is running, no reload/restart needed
• UUID are used to route messages
Mongrel2
            Handler
• Communication with handler completely
  async
• ØMQ   sockets can work over different
  transports (tcp, domain sockets...)
• Messages to/from handler built on
  netstrings (D. J. Bernstein) are easy to parse
Mongrel2
        Ruby Handler

• http://github.com/perplexes/m2r
• JRuby or ruby 1.9.2
• Simple handler or Rack enabled
Mongrel2
        Ruby Handler

• Run any Rack app using mongrel2, now!
Mongrel2
Questions



   ?
Thanks!


Paolo Negri
@hungryblank

Weitere ähnliche Inhalte

Was ist angesagt?

How you can contribute to Apache Cassandra
How you can contribute to Apache CassandraHow you can contribute to Apache Cassandra
How you can contribute to Apache CassandraYuki Morishita
 
Maria DB Galera Cluster for High Availability
Maria DB Galera Cluster for High AvailabilityMaria DB Galera Cluster for High Availability
Maria DB Galera Cluster for High AvailabilityOSSCube
 
Training Slides: 101 - Basics: Tungsten Clustering - Under The Hood
Training Slides: 101 - Basics: Tungsten Clustering - Under The HoodTraining Slides: 101 - Basics: Tungsten Clustering - Under The Hood
Training Slides: 101 - Basics: Tungsten Clustering - Under The HoodContinuent
 
Achieving Infrastructure Portability with Chef
Achieving Infrastructure Portability with ChefAchieving Infrastructure Portability with Chef
Achieving Infrastructure Portability with ChefMatt Ray
 
XMPP/Jingle(VoIP)/Perl Ocean 2012/03
XMPP/Jingle(VoIP)/Perl Ocean 2012/03XMPP/Jingle(VoIP)/Perl Ocean 2012/03
XMPP/Jingle(VoIP)/Perl Ocean 2012/03Lyo Kato
 
under the covers -- chef in 20 minutes or less
under the covers -- chef in 20 minutes or lessunder the covers -- chef in 20 minutes or less
under the covers -- chef in 20 minutes or lesssarahnovotny
 
Cassandra Summit 2014: Deploying Cassandra for Call of Duty
Cassandra Summit 2014: Deploying Cassandra for Call of DutyCassandra Summit 2014: Deploying Cassandra for Call of Duty
Cassandra Summit 2014: Deploying Cassandra for Call of DutyDataStax Academy
 
Introduction to Apache Kafka
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache KafkaShiao-An Yuan
 
Master master vs master-slave database
Master master vs master-slave databaseMaster master vs master-slave database
Master master vs master-slave databaseWipro
 
Client Drivers and Cassandra, the Right Way
Client Drivers and Cassandra, the Right WayClient Drivers and Cassandra, the Right Way
Client Drivers and Cassandra, the Right WayDataStax Academy
 
Redis everywhere - PHP London
Redis everywhere - PHP LondonRedis everywhere - PHP London
Redis everywhere - PHP LondonRicard Clau
 
Speed up your Symfony2 application and build awesome features with Redis
Speed up your Symfony2 application and build awesome features with RedisSpeed up your Symfony2 application and build awesome features with Redis
Speed up your Symfony2 application and build awesome features with RedisRicard Clau
 
Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...
Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...
Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...Erik Onnen
 
События, шины и интеграция данных в непростом мире микросервисов / Валентин Г...
События, шины и интеграция данных в непростом мире микросервисов / Валентин Г...События, шины и интеграция данных в непростом мире микросервисов / Валентин Г...
События, шины и интеграция данных в непростом мире микросервисов / Валентин Г...Ontico
 
Introduction Apache Kafka
Introduction Apache KafkaIntroduction Apache Kafka
Introduction Apache KafkaJoe Stein
 
Hashicorp: Delivering the Tao of DevOps
Hashicorp: Delivering the Tao of DevOpsHashicorp: Delivering the Tao of DevOps
Hashicorp: Delivering the Tao of DevOpsRamit Surana
 
Как сделать высоконагруженный сервис, не зная количество нагрузки / Олег Обле...
Как сделать высоконагруженный сервис, не зная количество нагрузки / Олег Обле...Как сделать высоконагруженный сервис, не зная количество нагрузки / Олег Обле...
Как сделать высоконагруженный сервис, не зная количество нагрузки / Олег Обле...Ontico
 

Was ist angesagt? (17)

How you can contribute to Apache Cassandra
How you can contribute to Apache CassandraHow you can contribute to Apache Cassandra
How you can contribute to Apache Cassandra
 
Maria DB Galera Cluster for High Availability
Maria DB Galera Cluster for High AvailabilityMaria DB Galera Cluster for High Availability
Maria DB Galera Cluster for High Availability
 
Training Slides: 101 - Basics: Tungsten Clustering - Under The Hood
Training Slides: 101 - Basics: Tungsten Clustering - Under The HoodTraining Slides: 101 - Basics: Tungsten Clustering - Under The Hood
Training Slides: 101 - Basics: Tungsten Clustering - Under The Hood
 
Achieving Infrastructure Portability with Chef
Achieving Infrastructure Portability with ChefAchieving Infrastructure Portability with Chef
Achieving Infrastructure Portability with Chef
 
XMPP/Jingle(VoIP)/Perl Ocean 2012/03
XMPP/Jingle(VoIP)/Perl Ocean 2012/03XMPP/Jingle(VoIP)/Perl Ocean 2012/03
XMPP/Jingle(VoIP)/Perl Ocean 2012/03
 
under the covers -- chef in 20 minutes or less
under the covers -- chef in 20 minutes or lessunder the covers -- chef in 20 minutes or less
under the covers -- chef in 20 minutes or less
 
Cassandra Summit 2014: Deploying Cassandra for Call of Duty
Cassandra Summit 2014: Deploying Cassandra for Call of DutyCassandra Summit 2014: Deploying Cassandra for Call of Duty
Cassandra Summit 2014: Deploying Cassandra for Call of Duty
 
Introduction to Apache Kafka
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache Kafka
 
Master master vs master-slave database
Master master vs master-slave databaseMaster master vs master-slave database
Master master vs master-slave database
 
Client Drivers and Cassandra, the Right Way
Client Drivers and Cassandra, the Right WayClient Drivers and Cassandra, the Right Way
Client Drivers and Cassandra, the Right Way
 
Redis everywhere - PHP London
Redis everywhere - PHP LondonRedis everywhere - PHP London
Redis everywhere - PHP London
 
Speed up your Symfony2 application and build awesome features with Redis
Speed up your Symfony2 application and build awesome features with RedisSpeed up your Symfony2 application and build awesome features with Redis
Speed up your Symfony2 application and build awesome features with Redis
 
Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...
Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...
Data Models and Consumer Idioms Using Apache Kafka for Continuous Data Stream...
 
События, шины и интеграция данных в непростом мире микросервисов / Валентин Г...
События, шины и интеграция данных в непростом мире микросервисов / Валентин Г...События, шины и интеграция данных в непростом мире микросервисов / Валентин Г...
События, шины и интеграция данных в непростом мире микросервисов / Валентин Г...
 
Introduction Apache Kafka
Introduction Apache KafkaIntroduction Apache Kafka
Introduction Apache Kafka
 
Hashicorp: Delivering the Tao of DevOps
Hashicorp: Delivering the Tao of DevOpsHashicorp: Delivering the Tao of DevOps
Hashicorp: Delivering the Tao of DevOps
 
Как сделать высоконагруженный сервис, не зная количество нагрузки / Олег Обле...
Как сделать высоконагруженный сервис, не зная количество нагрузки / Олег Обле...Как сделать высоконагруженный сервис, не зная количество нагрузки / Олег Обле...
Как сделать высоконагруженный сервис, не зная количество нагрузки / Олег Обле...
 

Andere mochten auch

A Documentation Crash Course, LinuxCon 2016
A Documentation Crash Course, LinuxCon 2016A Documentation Crash Course, LinuxCon 2016
A Documentation Crash Course, LinuxCon 2016Chris Ward
 
Electron - Solving our cross platform dreams?
Electron - Solving our cross platform dreams?Electron - Solving our cross platform dreams?
Electron - Solving our cross platform dreams?Chris Ward
 
Content Management Systems and Refactoring - Drupal, WordPress and eZ Publish
Content Management Systems and Refactoring - Drupal, WordPress and eZ PublishContent Management Systems and Refactoring - Drupal, WordPress and eZ Publish
Content Management Systems and Refactoring - Drupal, WordPress and eZ PublishJani Tarvainen
 
Why you should come to DrupalSouth
Why you should come to DrupalSouthWhy you should come to DrupalSouth
Why you should come to DrupalSouthChris Ward
 
Entrez dans le mouvement Maker à l’aide des technologies Microsoft
Entrez dans le mouvement Maker à l’aide des technologies MicrosoftEntrez dans le mouvement Maker à l’aide des technologies Microsoft
Entrez dans le mouvement Maker à l’aide des technologies MicrosoftFabrice BARBIN
 
SimpleDb, an introduction
SimpleDb, an introductionSimpleDb, an introduction
SimpleDb, an introductionPaolo Negri
 
Offre développeur Javascript Back-end
Offre développeur Javascript Back-endOffre développeur Javascript Back-end
Offre développeur Javascript Back-endSite Analyzer
 
Contentful Berlin Offices
Contentful Berlin OfficesContentful Berlin Offices
Contentful Berlin OfficesIrina Botea
 
Erlang introduction geek2geek Berlin
Erlang introduction geek2geek BerlinErlang introduction geek2geek Berlin
Erlang introduction geek2geek BerlinPaolo Negri
 
Automate your docs, automate yourself
Automate your docs, automate yourselfAutomate your docs, automate yourself
Automate your docs, automate yourselfChris Ward
 
The Anatomy of Content Management (workshop by J Gollner at Intelligent Conte...
The Anatomy of Content Management (workshop by J Gollner at Intelligent Conte...The Anatomy of Content Management (workshop by J Gollner at Intelligent Conte...
The Anatomy of Content Management (workshop by J Gollner at Intelligent Conte...Joe Gollner
 
AWS Lambda in infrastructure
AWS Lambda in infrastructureAWS Lambda in infrastructure
AWS Lambda in infrastructurePaolo Negri
 
Le futur de Drupal et des applications web
Le futur de Drupal et des applications webLe futur de Drupal et des applications web
Le futur de Drupal et des applications webJulien Dubreuil
 
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...Paolo Negri
 
Devoxx France 2015 - Se préparer à l'arrivée d'Angular 2
Devoxx France 2015 - Se préparer à l'arrivée d'Angular 2Devoxx France 2015 - Se préparer à l'arrivée d'Angular 2
Devoxx France 2015 - Se préparer à l'arrivée d'Angular 2Romain Linsolas
 
Back to the future with static site generators
Back to the future with static site generatorsBack to the future with static site generators
Back to the future with static site generatorsChris Ward
 
ParisJS #10 : PhantomJs
ParisJS #10 : PhantomJs ParisJS #10 : PhantomJs
ParisJS #10 : PhantomJs Maurice Svay
 
Erlang as a cloud citizen, a fractal approach to throughput
Erlang as a cloud citizen, a fractal approach to throughputErlang as a cloud citizen, a fractal approach to throughput
Erlang as a cloud citizen, a fractal approach to throughputPaolo Negri
 
Google : Prise en charge de l'Ajax et de l'Angular JS
Google : Prise en charge de l'Ajax et de l'Angular JSGoogle : Prise en charge de l'Ajax et de l'Angular JS
Google : Prise en charge de l'Ajax et de l'Angular JSPeak Ace
 
API Days Australia - Automatic Testing of (RESTful) API Documentation
API Days Australia  - Automatic Testing of (RESTful) API DocumentationAPI Days Australia  - Automatic Testing of (RESTful) API Documentation
API Days Australia - Automatic Testing of (RESTful) API DocumentationRouven Weßling
 

Andere mochten auch (20)

A Documentation Crash Course, LinuxCon 2016
A Documentation Crash Course, LinuxCon 2016A Documentation Crash Course, LinuxCon 2016
A Documentation Crash Course, LinuxCon 2016
 
Electron - Solving our cross platform dreams?
Electron - Solving our cross platform dreams?Electron - Solving our cross platform dreams?
Electron - Solving our cross platform dreams?
 
Content Management Systems and Refactoring - Drupal, WordPress and eZ Publish
Content Management Systems and Refactoring - Drupal, WordPress and eZ PublishContent Management Systems and Refactoring - Drupal, WordPress and eZ Publish
Content Management Systems and Refactoring - Drupal, WordPress and eZ Publish
 
Why you should come to DrupalSouth
Why you should come to DrupalSouthWhy you should come to DrupalSouth
Why you should come to DrupalSouth
 
Entrez dans le mouvement Maker à l’aide des technologies Microsoft
Entrez dans le mouvement Maker à l’aide des technologies MicrosoftEntrez dans le mouvement Maker à l’aide des technologies Microsoft
Entrez dans le mouvement Maker à l’aide des technologies Microsoft
 
SimpleDb, an introduction
SimpleDb, an introductionSimpleDb, an introduction
SimpleDb, an introduction
 
Offre développeur Javascript Back-end
Offre développeur Javascript Back-endOffre développeur Javascript Back-end
Offre développeur Javascript Back-end
 
Contentful Berlin Offices
Contentful Berlin OfficesContentful Berlin Offices
Contentful Berlin Offices
 
Erlang introduction geek2geek Berlin
Erlang introduction geek2geek BerlinErlang introduction geek2geek Berlin
Erlang introduction geek2geek Berlin
 
Automate your docs, automate yourself
Automate your docs, automate yourselfAutomate your docs, automate yourself
Automate your docs, automate yourself
 
The Anatomy of Content Management (workshop by J Gollner at Intelligent Conte...
The Anatomy of Content Management (workshop by J Gollner at Intelligent Conte...The Anatomy of Content Management (workshop by J Gollner at Intelligent Conte...
The Anatomy of Content Management (workshop by J Gollner at Intelligent Conte...
 
AWS Lambda in infrastructure
AWS Lambda in infrastructureAWS Lambda in infrastructure
AWS Lambda in infrastructure
 
Le futur de Drupal et des applications web
Le futur de Drupal et des applications webLe futur de Drupal et des applications web
Le futur de Drupal et des applications web
 
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
 
Devoxx France 2015 - Se préparer à l'arrivée d'Angular 2
Devoxx France 2015 - Se préparer à l'arrivée d'Angular 2Devoxx France 2015 - Se préparer à l'arrivée d'Angular 2
Devoxx France 2015 - Se préparer à l'arrivée d'Angular 2
 
Back to the future with static site generators
Back to the future with static site generatorsBack to the future with static site generators
Back to the future with static site generators
 
ParisJS #10 : PhantomJs
ParisJS #10 : PhantomJs ParisJS #10 : PhantomJs
ParisJS #10 : PhantomJs
 
Erlang as a cloud citizen, a fractal approach to throughput
Erlang as a cloud citizen, a fractal approach to throughputErlang as a cloud citizen, a fractal approach to throughput
Erlang as a cloud citizen, a fractal approach to throughput
 
Google : Prise en charge de l'Ajax et de l'Angular JS
Google : Prise en charge de l'Ajax et de l'Angular JSGoogle : Prise en charge de l'Ajax et de l'Angular JS
Google : Prise en charge de l'Ajax et de l'Angular JS
 
API Days Australia - Automatic Testing of (RESTful) API Documentation
API Days Australia  - Automatic Testing of (RESTful) API DocumentationAPI Days Australia  - Automatic Testing of (RESTful) API Documentation
API Days Australia - Automatic Testing of (RESTful) API Documentation
 

Ähnlich wie Mongrel2, a short introduction

Apache Zeppelin & Cluster
Apache Zeppelin & ClusterApache Zeppelin & Cluster
Apache Zeppelin & ClusterJongyoul Lee
 
Containers orchestrators: Docker vs. Kubernetes
Containers orchestrators: Docker vs. KubernetesContainers orchestrators: Docker vs. Kubernetes
Containers orchestrators: Docker vs. KubernetesDmitry Lazarenko
 
Intro to Solr Cloud, Presented by Tim Potter at SolrExchage DC
Intro to Solr Cloud, Presented by Tim Potter at SolrExchage DCIntro to Solr Cloud, Presented by Tim Potter at SolrExchage DC
Intro to Solr Cloud, Presented by Tim Potter at SolrExchage DCLucidworks (Archived)
 
Solr Exchange: Introduction to SolrCloud
Solr Exchange: Introduction to SolrCloudSolr Exchange: Introduction to SolrCloud
Solr Exchange: Introduction to SolrCloudthelabdude
 
Docker Swarm and Traefik 2.0
Docker Swarm and Traefik 2.0Docker Swarm and Traefik 2.0
Docker Swarm and Traefik 2.0Jakub Hajek
 
Solr Lucene Revolution 2014 - Solr Compute Cloud - Nitin
Solr Lucene Revolution 2014 - Solr Compute Cloud - NitinSolr Lucene Revolution 2014 - Solr Compute Cloud - Nitin
Solr Lucene Revolution 2014 - Solr Compute Cloud - Nitinbloomreacheng
 
Orchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failuresOrchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failuresDocker, Inc.
 
HTTPプロクシライブラリproxy2の設計と実装
HTTPプロクシライブラリproxy2の設計と実装HTTPプロクシライブラリproxy2の設計と実装
HTTPプロクシライブラリproxy2の設計と実装inaz2
 
Try to implement Blockchain using libp2p
Try to implement Blockchain using libp2pTry to implement Blockchain using libp2p
Try to implement Blockchain using libp2pRyouta Kogaenzawa
 
Scientific Computing - Hardware
Scientific Computing - HardwareScientific Computing - Hardware
Scientific Computing - Hardwarejalle6
 
Kafka Technical Overview
Kafka Technical OverviewKafka Technical Overview
Kafka Technical OverviewSylvester John
 
Managing ejabberd Platforms with Docker - ejabberd Workshop #1
Managing ejabberd Platforms with Docker - ejabberd Workshop #1Managing ejabberd Platforms with Docker - ejabberd Workshop #1
Managing ejabberd Platforms with Docker - ejabberd Workshop #1Mickaël Rémond
 
视觉中国的MongoDB应用实践(QConBeijing2011)
视觉中国的MongoDB应用实践(QConBeijing2011)视觉中国的MongoDB应用实践(QConBeijing2011)
视觉中国的MongoDB应用实践(QConBeijing2011)Night Sailer
 
Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Chris Richardson
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Newlink
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Newlink
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640LLC NewLink
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Newlink
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Newlink
 

Ähnlich wie Mongrel2, a short introduction (20)

Apache Zeppelin & Cluster
Apache Zeppelin & ClusterApache Zeppelin & Cluster
Apache Zeppelin & Cluster
 
Containers orchestrators: Docker vs. Kubernetes
Containers orchestrators: Docker vs. KubernetesContainers orchestrators: Docker vs. Kubernetes
Containers orchestrators: Docker vs. Kubernetes
 
Intro to Solr Cloud, Presented by Tim Potter at SolrExchage DC
Intro to Solr Cloud, Presented by Tim Potter at SolrExchage DCIntro to Solr Cloud, Presented by Tim Potter at SolrExchage DC
Intro to Solr Cloud, Presented by Tim Potter at SolrExchage DC
 
Solr Exchange: Introduction to SolrCloud
Solr Exchange: Introduction to SolrCloudSolr Exchange: Introduction to SolrCloud
Solr Exchange: Introduction to SolrCloud
 
mtl_rubykaigi
mtl_rubykaigimtl_rubykaigi
mtl_rubykaigi
 
Docker Swarm and Traefik 2.0
Docker Swarm and Traefik 2.0Docker Swarm and Traefik 2.0
Docker Swarm and Traefik 2.0
 
Solr Lucene Revolution 2014 - Solr Compute Cloud - Nitin
Solr Lucene Revolution 2014 - Solr Compute Cloud - NitinSolr Lucene Revolution 2014 - Solr Compute Cloud - Nitin
Solr Lucene Revolution 2014 - Solr Compute Cloud - Nitin
 
Orchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failuresOrchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failures
 
HTTPプロクシライブラリproxy2の設計と実装
HTTPプロクシライブラリproxy2の設計と実装HTTPプロクシライブラリproxy2の設計と実装
HTTPプロクシライブラリproxy2の設計と実装
 
Try to implement Blockchain using libp2p
Try to implement Blockchain using libp2pTry to implement Blockchain using libp2p
Try to implement Blockchain using libp2p
 
Scientific Computing - Hardware
Scientific Computing - HardwareScientific Computing - Hardware
Scientific Computing - Hardware
 
Kafka Technical Overview
Kafka Technical OverviewKafka Technical Overview
Kafka Technical Overview
 
Managing ejabberd Platforms with Docker - ejabberd Workshop #1
Managing ejabberd Platforms with Docker - ejabberd Workshop #1Managing ejabberd Platforms with Docker - ejabberd Workshop #1
Managing ejabberd Platforms with Docker - ejabberd Workshop #1
 
视觉中国的MongoDB应用实践(QConBeijing2011)
视觉中国的MongoDB应用实践(QConBeijing2011)视觉中国的MongoDB应用实践(QConBeijing2011)
视觉中国的MongoDB应用实践(QConBeijing2011)
 
Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640
 
Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640Xen and-the-art-of-rails-deployment2640
Xen and-the-art-of-rails-deployment2640
 

Mehr von Paolo Negri

Turning the web stack upside down rethinking how data flows through systems
Turning the web stack upside down  rethinking how data flows through systemsTurning the web stack upside down  rethinking how data flows through systems
Turning the web stack upside down rethinking how data flows through systemsPaolo Negri
 
Getting real with erlang
Getting real with erlangGetting real with erlang
Getting real with erlangPaolo Negri
 
Erlang factory 2011 london
Erlang factory 2011 londonErlang factory 2011 london
Erlang factory 2011 londonPaolo Negri
 
Erlang factory SF 2011 "Erlang and the big switch in social games"
Erlang factory SF 2011 "Erlang and the big switch in social games"Erlang factory SF 2011 "Erlang and the big switch in social games"
Erlang factory SF 2011 "Erlang and the big switch in social games"Paolo Negri
 
RabbitMQ with python and ruby RuPy 2009
RabbitMQ with python and ruby RuPy 2009RabbitMQ with python and ruby RuPy 2009
RabbitMQ with python and ruby RuPy 2009Paolo Negri
 
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim CrontabsPaolo Negri
 

Mehr von Paolo Negri (6)

Turning the web stack upside down rethinking how data flows through systems
Turning the web stack upside down  rethinking how data flows through systemsTurning the web stack upside down  rethinking how data flows through systems
Turning the web stack upside down rethinking how data flows through systems
 
Getting real with erlang
Getting real with erlangGetting real with erlang
Getting real with erlang
 
Erlang factory 2011 london
Erlang factory 2011 londonErlang factory 2011 london
Erlang factory 2011 london
 
Erlang factory SF 2011 "Erlang and the big switch in social games"
Erlang factory SF 2011 "Erlang and the big switch in social games"Erlang factory SF 2011 "Erlang and the big switch in social games"
Erlang factory SF 2011 "Erlang and the big switch in social games"
 
RabbitMQ with python and ruby RuPy 2009
RabbitMQ with python and ruby RuPy 2009RabbitMQ with python and ruby RuPy 2009
RabbitMQ with python and ruby RuPy 2009
 
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
%w(map reduce).first - A Tale About Rabbits, Latency, and Slim Crontabs
 

Kürzlich hochgeladen

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 

Kürzlich hochgeladen (20)

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 

Mongrel2, a short introduction

  • 1. Mongrel2 an introduction Paolo Negri - @hungryblank Berlin Ruby User Group 7th Oct 2010
  • 2. 1st something about Mongrel1
  • 3. Mongrel1 “Mongrel is a small library that provides a very fast HTTP 1.1 server for Ruby web applications.” (Mongrel README)
  • 4. Mongrel1 “Unicorn is copyright 2009 by all contributors. It is based on Mongrel” (Unicorn README)
  • 5. Mongrel1 “Thin is a Ruby web server that glues together 3 of the best Ruby libraries in web history: • the Mongrel parser...” (Thin homepage)
  • 6. Mongrel1 “Back then I wrote a little Ruby web server called Ebb that was meant to be a faster Mongrel. That code was the starting point for Node” (Ryan Dahl, node.js author)
  • 7. Mongrel2 and Mongrel1 share • HTTP parser • author - @zedshaw
  • 8. Mongrel2 is a web server • • • application language network architecture } agnostic
  • 9. Mongrel2 Language Agnostic • Focus on HTTP • Not for a specific language • Use it with Ruby, Python, C++, PHP, Haskell, Common Lisp, Perl, .NET, Clojure, Lua ...
  • 10. Mongrel2 MVC configuration M V C SQLite3 Mongrel m2sh Database Process
  • 11. Mongrel2 MVC configuration M V C SQLite3 Mongrel m2sh Database Process Configuration is stored in SQLite3 database
  • 12. Mongrel2 MVC configuration M V C SQLite3 Mongrel m2sh Database Process m2sh writes/reads configuration
  • 13. Mongrel2 MVC configuration M V C SQLite3 Mongrel m2sh Database Process Mongrel reads config from SQLite3 and runs accordingly
  • 14. Mongrel2 m2sh - query $ m2sh servers -db tests/config.sqlite SERVERS: ------ test localhost AC1F8236-5919-4696-9D40-0F38DE9E5861 $ m2sh hosts -db tests/config.sqlite - server test HOSTS in test: ----- 1 localhost
  • 15. Mongrel2 m2sh - launch/manage $ m2sh start -db tests/config.sqlite  -host localhost -sudo $ m2sh reload -db tests/config.sqlite   -host localhost 
  • 16. Mongrel2 Configuration Load a configuration file with m2sh $ m2sh load -config  examples/config/sample.conf
  • 17. Mongrel2 Configuration main = Server(      uuid="f400bf85-4538-4f7a-8908-67e313d515c2",      access_log="/logs/access.log",      error_log="/logs/error.log",      chroot="./",      default_host="localhost",      name="test",      pid_file="/run/mongrel2.pid",      port=6767,      hosts = [          Host(name="localhost", routes={              '/tests/': Dir(base='tests/', index_file='index.html',                               default_ctype='text/plain')          })      ]  ) 
  • 18. Mongrel2 Configuration Unique server identifier main = Server(      uuid="f400bf85-4538-4f7a-8908-67e313d515c2",      access_log="/logs/access.log",      error_log="/logs/error.log",      chroot="./",      default_host="localhost",      name="test",      pid_file="/run/mongrel2.pid",      port=6767,      hosts = [          Host(name="localhost", routes={              '/tests/': Dir(base='tests/', index_file='index.html',                               default_ctype='text/plain')          })      ]  ) 
  • 19. Mongrel2 Configuration logfiles, port, server name, pid... main = Server(      uuid="f400bf85-4538-4f7a-8908-67e313d515c2",      access_log="/logs/access.log",      error_log="/logs/error.log",      chroot="./",      default_host="localhost",      name="test",      pid_file="/run/mongrel2.pid",      port=6767,      hosts = [          Host(name="localhost", routes={              '/tests/': Dir(base='tests/', index_file='index.html',                               default_ctype='text/plain')          })      ]  ) 
  • 20. Mongrel2 Configuration • Server • Host • Route • Dir • Proxy • Handler
  • 21. Mongrel2 Configuration • Server Is the root element of a configuration • Host • Route • Dir • Proxy • Handler
  • 22. Mongrel2 Configuration • Server DNS hostname to answer for • Host A server can • Route contain multiple • Dir hosts • Proxy • Handler
  • 23. Mongrel2 Configuration • Server URL paths and patterns to match • Host example ‘/images/’ • Route • Dir • Proxy • Handler
  • 24. Mongrel2 Configuration • Server Serves files out of a directory • Host (full 304 and ETag • Route support) • Dir • Proxy • Handler
  • 25. Mongrel2 Configuration • Server Requests matching the route are sent to • Host another HTTP server • Route • Dir • Proxy • Handler
  • 26. Mongrel2 Configuration • Server “A Handler is the best part of Mongrel2” • Host • Route • Dir • Proxy • Handler
  • 31. Mongrel2 Handler • Handlers receive asynchronous requests from Mongrel2 • Handlers and Mongrel2 communicate via ØMQ sockets
  • 32. Mongrel2 Handler mongrel2 ØMQ sockets handler handler handler
  • 33. Mongrel2 Handler mongrel2 Push/Pull Pub/Sub handler Requests Responses handler handler
  • 34. Mongrel2 Handler mongrel2 Push/Pull Pub/Sub handler Requests Responses Round robin handler distribution handler
  • 35. Mongrel2 Handler mongrel2 Push/Pull Pub/Sub handler Requests Responses handler Target up to handler 128 clients
  • 36. Mongrel2 Handler UUID ID PATH SIZE:HEADERS,SIZE:BODY Push/Pull Pub/Sub handler Requests Responses handler handler
  • 37. Mongrel2 Handler UUID SIZE:ID ID ID, BODY Push/Pull Pub/Sub handler Requests Responses handler handler
  • 38. Mongrel2 Handler • One or many handlers • Increase/decrease # of handlers while the server is running, no reload/restart needed • UUID are used to route messages
  • 39. Mongrel2 Handler • Communication with handler completely async • ØMQ sockets can work over different transports (tcp, domain sockets...) • Messages to/from handler built on netstrings (D. J. Bernstein) are easy to parse
  • 40. Mongrel2 Ruby Handler • http://github.com/perplexes/m2r • JRuby or ruby 1.9.2 • Simple handler or Rack enabled
  • 41. Mongrel2 Ruby Handler • Run any Rack app using mongrel2, now!