SlideShare a Scribd company logo
1 of 26
Download to read offline
‹#›
‹#›
‹#›
‹#›
‹#›
‹#›
‹#›
‹#›
‹#›
‹#›
6
                                   Worker	
  
                                   Thread

                                   Worker	
  
                                   Thread           Web Container
                                   Worker	
  
                                                    HTTP Engine
                                   Thread

                                   Worker	
  
                                                         VS Select
                                   Thread

            Acceptor	
             Worker	
         NSAPI Engine
            Thread                 Thread
                               4                5
            Acceptor	
             Worker	
         …
            Thread                 Thread

    1   2                  3                7


                                                        KeepAlive	
  
                                                         Thread
                                                        KeepAlive	
  
                                                         Thread
9                                               8




                                                                        ‹#›
                 	
	
                                            	
                    	



       B	
                       B	
  
               Thread-­‐1	
                        Thread-­‐1	
  

       B	
                       B	
  
               Thread-­‐2	
                        Thread-­‐2	
  

       B	
                       B	
  
               Thread-­‐3	
                        Thread-­‐3	
  




                                                                         ‹#›
‹#›
no9fy

no9fy




        ‹#›
Selector selector = Selector.open();!
ServerSocketChannel serverChannel = ServerSocketChannel.open();!
serverChannel.configureBlocking(false);//                   !
serverChannel.socket().bind(new InetSocketAddress(9090));!
serverChannel.register(selector, SelectionKey.OP_ACCEPT);!
while (selector.select() > 0) {!
    for (Iterator it = selector.selectedKeys().iterator();
it.hasNext();) {!
       SelectionKey key = (SelectionKey) it.next();!
       it.remove();!
       if (key.isAcceptable()) {!
           ServerSocketChannel serverChannel =!
               (ServerSocketChannel) key.channel();!
           SocketChannel channel = serverChannel.accept();!
           channel.configureBlocking(false);!
           channel.register(selector, SelectionKey.OP_READ);!

                                                             ‹#›
SocketChannel channel = serverChannel.accept();!



AsynchronousServerSocketChannel server =
AsynchronousServerSocketChannel.open().bind(9900);!
Future<AsynchronousSocketChannel> acceptFuture = server.accept
();!
AsynchronousSocketChannel worker = future.get();!
//AsynchronousSocketChannel worker = future.get(10,
TimeUnit.SECONDS); //                             !




                                                             ‹#›
‹#›
‹#›
GlassFish glassfish = GlassFishRuntime.bootstrap().!
     !     !     !     !     !     !     !newGlassFish();!
glassfish.start();!
!

CommandRunner commandRunner = glassfish.getService
(CommandRunner.class);!
CommandResult commandResult = commandRunner.run("create-http-
listener", "--listenerport=9090", "--listeneraddress=0.0.0.0",
"--defaultvs=server", "my-http-listener");!
!

Deployer deployer = glassfish.getDeployer();!
deployer.deploy(new File(“HelloWorldWeb-GA.war"));!




                                                             ‹#›
public class HelloWorldAdapter extends GrizzlyAdapter {!
    @Override!
    public void service(GrizzlyRequest request, GrizzlyResponse
response) {!
        try {!
             response.getWriter().println("HelloWorld");!
        } catch (IOException ex) {!
             ex.printStackTrace();!
        }}!

<adapters>!
    <adapter context-root="/helloworld" class-
name="co.jp.oracle.http.HelloWorldAdapter"/>!
</adapters>!

> asadmin deploy helloworld.jar


                                                             ‹#›
GrizzlyWebServer gws = new GrizzlyWebServer(8080, "no static
content");!
!
ServletAdapter simpleServletAdapter = new ServletAdapter();!
simpleServletAdapter.setContextPath("/hello");!
simpleServletAdapter.setServletInstance(new MyServlet());!
gws.addGrizzlyAdapter(simpleServletAdapter, new String[]{"/
hello"});!
!
gws.start();!




                                                               ‹#›
‹#›
-Dcom.sun.grizzly.displayConfiguration = true!


Grizzly running on Darwin - 10.8.0 under JDK version: 1.7.0-internal -
Oracle Corporation !
         port: 4848!
         Thread Pool:
com.sun.enterprise.v3.services.impl.monitor.MonitorableThreadPool@7e8e
68bd, port=4848!
         Read Selector: -1!
         ByteBuffer size: 8192 !
         maxHttpHeaderSize: 8192!
         sendBufferSize: 8192!
         maxKeepAliveRequests: 250!
         keepAliveTimeoutInSeconds: 30 !
         Static File Cache enabled: false!
                                                                     ‹#›
         Adapter : com.sun.enterprise.v3.services.impl.ContainerMapper !
         Asynchronous Request Processing enabled: false|#]!
-­‐Dcom.sun.grizzly.enableSnoop=true!



[#|2011-­‐09-­‐01T22:00:39.319+0900|INFO|glassfish3.1.1|
com.sun.grizzly.config.GrizzlyServiceListener|_ThreadID=67;_ThreadName=Thread-­‐2;|GRIZZLY0020:	
  
SocketChannel	
  headers	
  java.nio.channels.SocketChannel[connected	
  local=/127.0.0.1:4848	
  remote=/
127.0.0.1:55379]	
  are:	
  	
  
===	
  MimeHeaders	
  ===	
  
host	
  =	
  127.0.0.1:4848	
  
user-­‐agent	
  =	
  Mozilla/5.0	
  (Macintosh;	
  Intel	
  Mac	
  OS	
  X	
  10.6;	
  rv:6.0.1)	
  Gecko/20100101	
  Firefox/6.0.1	
  
accept	
  =	
  text/html,applica9on/xhtml+xml,applica9on/xml;q=0.9,*/*;q=0.8	
  
accept-­‐language	
  =	
  ja,en;q=0.7,en-­‐us;q=0.3	
  
accept-­‐encoding	
  =	
  gzip,	
  deflate	
  
accept-­‐charset	
  =	
  Shil_JIS,un-­‐8;q=0.7,*;q=0.7	
  



                                                                                                                                      ‹#›
-client!
-Xmx512m!


-server !
-Xmx3500m -Xms3500m -Xss128k !
-XX:+AggressiveHeap !
-XX:+DisableExplicitGC!




                                 ‹#›
‹#›

More Related Content

What's hot

Psgi Plack Sfpm
Psgi Plack SfpmPsgi Plack Sfpm
Psgi Plack Sfpmsom_nangia
 
Sinatra Rack And Middleware
Sinatra Rack And MiddlewareSinatra Rack And Middleware
Sinatra Rack And MiddlewareBen Schwarz
 
Quick Intro To JRuby
Quick Intro To JRubyQuick Intro To JRuby
Quick Intro To JRubyFrederic Jean
 
mruby で mackerel のプラグインを作るはなし
mruby で mackerel のプラグインを作るはなしmruby で mackerel のプラグインを作るはなし
mruby で mackerel のプラグインを作るはなしHiroshi SHIBATA
 
TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011bobmcwhirter
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryTatsuhiko Miyagawa
 
A tour of (advanced) Akka features in 40 minutes
A tour of (advanced) Akka features in 40 minutesA tour of (advanced) Akka features in 40 minutes
A tour of (advanced) Akka features in 40 minutesJohan Janssen
 
TorqueBox for Rubyists
TorqueBox for RubyistsTorqueBox for Rubyists
TorqueBox for Rubyistsbobmcwhirter
 
Middleware as Code with mruby
Middleware as Code with mrubyMiddleware as Code with mruby
Middleware as Code with mrubyHiroshi SHIBATA
 
PECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life betterPECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life betterZendCon
 
Beautiful code instead of callback hell using ES6 Generators, Koa, Bluebird (...
Beautiful code instead of callback hell using ES6 Generators, Koa, Bluebird (...Beautiful code instead of callback hell using ES6 Generators, Koa, Bluebird (...
Beautiful code instead of callback hell using ES6 Generators, Koa, Bluebird (...andreaslubbe
 
Presentation of JSConf.eu
Presentation of JSConf.euPresentation of JSConf.eu
Presentation of JSConf.euFredrik Wendt
 
Puppet and the HashiStack
Puppet and the HashiStackPuppet and the HashiStack
Puppet and the HashiStackBram Vogelaar
 
Message Queueing - by an MQ noob
Message Queueing - by an MQ noobMessage Queueing - by an MQ noob
Message Queueing - by an MQ noobRichard Jones
 

What's hot (19)

Psgi Plack Sfpm
Psgi Plack SfpmPsgi Plack Sfpm
Psgi Plack Sfpm
 
Sinatra Rack And Middleware
Sinatra Rack And MiddlewareSinatra Rack And Middleware
Sinatra Rack And Middleware
 
Quick Intro To JRuby
Quick Intro To JRubyQuick Intro To JRuby
Quick Intro To JRuby
 
mruby で mackerel のプラグインを作るはなし
mruby で mackerel のプラグインを作るはなしmruby で mackerel のプラグインを作るはなし
mruby で mackerel のプラグインを作るはなし
 
TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011TorqueBox at DC:JBUG - November 2011
TorqueBox at DC:JBUG - November 2011
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
 
Devignition 2011
Devignition 2011Devignition 2011
Devignition 2011
 
A tour of (advanced) Akka features in 40 minutes
A tour of (advanced) Akka features in 40 minutesA tour of (advanced) Akka features in 40 minutes
A tour of (advanced) Akka features in 40 minutes
 
Tatsumaki
TatsumakiTatsumaki
Tatsumaki
 
TorqueBox for Rubyists
TorqueBox for RubyistsTorqueBox for Rubyists
TorqueBox for Rubyists
 
Middleware as Code with mruby
Middleware as Code with mrubyMiddleware as Code with mruby
Middleware as Code with mruby
 
Beyond Phoenix
Beyond PhoenixBeyond Phoenix
Beyond Phoenix
 
Practical ngx_mruby
Practical ngx_mrubyPractical ngx_mruby
Practical ngx_mruby
 
PECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life betterPECL Picks - Extensions to make your life better
PECL Picks - Extensions to make your life better
 
Beautiful code instead of callback hell using ES6 Generators, Koa, Bluebird (...
Beautiful code instead of callback hell using ES6 Generators, Koa, Bluebird (...Beautiful code instead of callback hell using ES6 Generators, Koa, Bluebird (...
Beautiful code instead of callback hell using ES6 Generators, Koa, Bluebird (...
 
Presentation of JSConf.eu
Presentation of JSConf.euPresentation of JSConf.eu
Presentation of JSConf.eu
 
Message queueing
Message queueingMessage queueing
Message queueing
 
Puppet and the HashiStack
Puppet and the HashiStackPuppet and the HashiStack
Puppet and the HashiStack
 
Message Queueing - by an MQ noob
Message Queueing - by an MQ noobMessage Queueing - by an MQ noob
Message Queueing - by an MQ noob
 

Similar to Grizzly1.9.3x

Fisl - Deployment
Fisl - DeploymentFisl - Deployment
Fisl - DeploymentFabio Akita
 
Server-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick TourServer-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick Tourq3boy
 
Understanding the Rails web model and scalability options
Understanding the Rails web model and scalability optionsUnderstanding the Rails web model and scalability options
Understanding the Rails web model and scalability options.toster
 
Ruby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developerRuby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developergicappa
 
Rocket Fuelled Cucumbers
Rocket Fuelled CucumbersRocket Fuelled Cucumbers
Rocket Fuelled CucumbersJoseph Wilk
 
OSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialOSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialTom Croucher
 
plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6Nobuo Danjou
 
Rhebok, High Performance Rack Handler / Rubykaigi 2015
Rhebok, High Performance Rack Handler / Rubykaigi 2015Rhebok, High Performance Rack Handler / Rubykaigi 2015
Rhebok, High Performance Rack Handler / Rubykaigi 2015Masahiro Nagano
 
What is new and cool j2se & java
What is new and cool j2se & javaWhat is new and cool j2se & java
What is new and cool j2se & javaEugene Bogaart
 
Node.js - Advanced Basics
Node.js - Advanced BasicsNode.js - Advanced Basics
Node.js - Advanced BasicsDoug Jones
 
VUG5: Varnish at Opera Software
VUG5: Varnish at Opera SoftwareVUG5: Varnish at Opera Software
VUG5: Varnish at Opera SoftwareCosimo Streppone
 
Node js quick-tour_v2
Node js quick-tour_v2Node js quick-tour_v2
Node js quick-tour_v2http403
 
Node js quick tour v2
Node js quick tour v2Node js quick tour v2
Node js quick tour v2Wyatt Fang
 
Node js quick-tour_v2
Node js quick-tour_v2Node js quick-tour_v2
Node js quick-tour_v2tianyi5212222
 
Nodejs - Should Ruby Developers Care?
Nodejs - Should Ruby Developers Care?Nodejs - Should Ruby Developers Care?
Nodejs - Should Ruby Developers Care?Felix Geisendörfer
 

Similar to Grizzly1.9.3x (20)

Sinatra for REST services
Sinatra for REST servicesSinatra for REST services
Sinatra for REST services
 
Fisl - Deployment
Fisl - DeploymentFisl - Deployment
Fisl - Deployment
 
Server-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick TourServer-Side JavaScript Developement - Node.JS Quick Tour
Server-Side JavaScript Developement - Node.JS Quick Tour
 
Run Node Run
Run Node RunRun Node Run
Run Node Run
 
Understanding the Rails web model and scalability options
Understanding the Rails web model and scalability optionsUnderstanding the Rails web model and scalability options
Understanding the Rails web model and scalability options
 
Ruby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developerRuby on Rails survival guide of an aged Java developer
Ruby on Rails survival guide of an aged Java developer
 
Rocket Fuelled Cucumbers
Rocket Fuelled CucumbersRocket Fuelled Cucumbers
Rocket Fuelled Cucumbers
 
OSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js TutorialOSCON 2011 - Node.js Tutorial
OSCON 2011 - Node.js Tutorial
 
plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6
 
Rhebok, High Performance Rack Handler / Rubykaigi 2015
Rhebok, High Performance Rack Handler / Rubykaigi 2015Rhebok, High Performance Rack Handler / Rubykaigi 2015
Rhebok, High Performance Rack Handler / Rubykaigi 2015
 
What is new and cool j2se & java
What is new and cool j2se & javaWhat is new and cool j2se & java
What is new and cool j2se & java
 
Node.js - Advanced Basics
Node.js - Advanced BasicsNode.js - Advanced Basics
Node.js - Advanced Basics
 
VUG5: Varnish at Opera Software
VUG5: Varnish at Opera SoftwareVUG5: Varnish at Opera Software
VUG5: Varnish at Opera Software
 
Node js quick-tour_v2
Node js quick-tour_v2Node js quick-tour_v2
Node js quick-tour_v2
 
Node js quick tour v2
Node js quick tour v2Node js quick tour v2
Node js quick tour v2
 
Node js quick-tour_v2
Node js quick-tour_v2Node js quick-tour_v2
Node js quick-tour_v2
 
Nodejs - Should Ruby Developers Care?
Nodejs - Should Ruby Developers Care?Nodejs - Should Ruby Developers Care?
Nodejs - Should Ruby Developers Care?
 
Deployment de Rails
Deployment de RailsDeployment de Rails
Deployment de Rails
 
Nodejs - A quick tour (v6)
Nodejs - A quick tour (v6)Nodejs - A quick tour (v6)
Nodejs - A quick tour (v6)
 
Rails Performance
Rails PerformanceRails Performance
Rails Performance
 

More from Yoshio Terada

AI-Java-for-Financial.pdf
AI-Java-for-Financial.pdfAI-Java-for-Financial.pdf
AI-Java-for-Financial.pdfYoshio Terada
 
Java-Virtual-Thread-LT.pdf
Java-Virtual-Thread-LT.pdfJava-Virtual-Thread-LT.pdf
Java-Virtual-Thread-LT.pdfYoshio Terada
 
Cloud Native Architecture ことはじめ 最適な実行環境を選ぶポイント
Cloud Native Architecture ことはじめ 最適な実行環境を選ぶポイントCloud Native Architecture ことはじめ 最適な実行環境を選ぶポイント
Cloud Native Architecture ことはじめ 最適な実行環境を選ぶポイントYoshio Terada
 
Jakarta EE Microproile Update JJUG 2020 May
Jakarta EE Microproile Update JJUG 2020 MayJakarta EE Microproile Update JJUG 2020 May
Jakarta EE Microproile Update JJUG 2020 MayYoshio Terada
 
Azure RedHat OpenShift - Red Hat Forum 2019
Azure RedHat OpenShift - Red Hat Forum 2019Azure RedHat OpenShift - Red Hat Forum 2019
Azure RedHat OpenShift - Red Hat Forum 2019Yoshio Terada
 
JakartaOne 2020 Japan Announce
JakartaOne 2020 Japan AnnounceJakartaOne 2020 Japan Announce
JakartaOne 2020 Japan AnnounceYoshio Terada
 
Jjug CCC 2019 Fall Azure Spring Cloud
Jjug CCC 2019 Fall Azure Spring CloudJjug CCC 2019 Fall Azure Spring Cloud
Jjug CCC 2019 Fall Azure Spring CloudYoshio Terada
 
Sapporo Developer Festa 2019
Sapporo Developer Festa 2019Sapporo Developer Festa 2019
Sapporo Developer Festa 2019Yoshio Terada
 
AKS (k8s) Hands on Lab Contents
AKS (k8s) Hands on Lab ContentsAKS (k8s) Hands on Lab Contents
AKS (k8s) Hands on Lab ContentsYoshio Terada
 
Oisix ra Daichi Microservice with Kubernetes
Oisix ra Daichi Microservice with Kubernetes Oisix ra Daichi Microservice with Kubernetes
Oisix ra Daichi Microservice with Kubernetes Yoshio Terada
 
Virtual Kubelet and Virtual Node
Virtual Kubelet and Virtual NodeVirtual Kubelet and Virtual Node
Virtual Kubelet and Virtual NodeYoshio Terada
 
Japan Container Day 2018
Japan Container Day 2018Japan Container Day 2018
Japan Container Day 2018Yoshio Terada
 
Java on Kubernetes on Azure
Java on Kubernetes on AzureJava on Kubernetes on Azure
Java on Kubernetes on AzureYoshio Terada
 
The Experience of Java on Kubernetes with Microservices from HackFest
The Experience of Java on Kubernetes with Microservices from HackFestThe Experience of Java on Kubernetes with Microservices from HackFest
The Experience of Java on Kubernetes with Microservices from HackFestYoshio Terada
 
Application Development Vision
Application Development VisionApplication Development Vision
Application Development VisionYoshio Terada
 
How to face the Kubernetes ?
How to face the Kubernetes ? How to face the Kubernetes ?
How to face the Kubernetes ? Yoshio Terada
 
JavaOne 2016 Report for Java EE
JavaOne 2016 Report for Java EEJavaOne 2016 Report for Java EE
JavaOne 2016 Report for Java EEYoshio Terada
 
Istio on k8s on Azure (AKS)
Istio on k8s on Azure (AKS)Istio on k8s on Azure (AKS)
Istio on k8s on Azure (AKS)Yoshio Terada
 

More from Yoshio Terada (20)

AI-Java-for-Financial.pdf
AI-Java-for-Financial.pdfAI-Java-for-Financial.pdf
AI-Java-for-Financial.pdf
 
Java-Virtual-Thread-LT.pdf
Java-Virtual-Thread-LT.pdfJava-Virtual-Thread-LT.pdf
Java-Virtual-Thread-LT.pdf
 
Cloud Native Architecture ことはじめ 最適な実行環境を選ぶポイント
Cloud Native Architecture ことはじめ 最適な実行環境を選ぶポイントCloud Native Architecture ことはじめ 最適な実行環境を選ぶポイント
Cloud Native Architecture ことはじめ 最適な実行環境を選ぶポイント
 
Jakarta EE Microproile Update JJUG 2020 May
Jakarta EE Microproile Update JJUG 2020 MayJakarta EE Microproile Update JJUG 2020 May
Jakarta EE Microproile Update JJUG 2020 May
 
Azure RedHat OpenShift - Red Hat Forum 2019
Azure RedHat OpenShift - Red Hat Forum 2019Azure RedHat OpenShift - Red Hat Forum 2019
Azure RedHat OpenShift - Red Hat Forum 2019
 
JakartaOne 2020 Japan Announce
JakartaOne 2020 Japan AnnounceJakartaOne 2020 Japan Announce
JakartaOne 2020 Japan Announce
 
Jjug CCC 2019 Fall Azure Spring Cloud
Jjug CCC 2019 Fall Azure Spring CloudJjug CCC 2019 Fall Azure Spring Cloud
Jjug CCC 2019 Fall Azure Spring Cloud
 
Sapporo Developer Festa 2019
Sapporo Developer Festa 2019Sapporo Developer Festa 2019
Sapporo Developer Festa 2019
 
AKS (k8s) Hands on Lab Contents
AKS (k8s) Hands on Lab ContentsAKS (k8s) Hands on Lab Contents
AKS (k8s) Hands on Lab Contents
 
Java on Azure 2019
Java on Azure 2019Java on Azure 2019
Java on Azure 2019
 
Java on Azure 2019
Java on Azure 2019Java on Azure 2019
Java on Azure 2019
 
Oisix ra Daichi Microservice with Kubernetes
Oisix ra Daichi Microservice with Kubernetes Oisix ra Daichi Microservice with Kubernetes
Oisix ra Daichi Microservice with Kubernetes
 
Virtual Kubelet and Virtual Node
Virtual Kubelet and Virtual NodeVirtual Kubelet and Virtual Node
Virtual Kubelet and Virtual Node
 
Japan Container Day 2018
Japan Container Day 2018Japan Container Day 2018
Japan Container Day 2018
 
Java on Kubernetes on Azure
Java on Kubernetes on AzureJava on Kubernetes on Azure
Java on Kubernetes on Azure
 
The Experience of Java on Kubernetes with Microservices from HackFest
The Experience of Java on Kubernetes with Microservices from HackFestThe Experience of Java on Kubernetes with Microservices from HackFest
The Experience of Java on Kubernetes with Microservices from HackFest
 
Application Development Vision
Application Development VisionApplication Development Vision
Application Development Vision
 
How to face the Kubernetes ?
How to face the Kubernetes ? How to face the Kubernetes ?
How to face the Kubernetes ?
 
JavaOne 2016 Report for Java EE
JavaOne 2016 Report for Java EEJavaOne 2016 Report for Java EE
JavaOne 2016 Report for Java EE
 
Istio on k8s on Azure (AKS)
Istio on k8s on Azure (AKS)Istio on k8s on Azure (AKS)
Istio on k8s on Azure (AKS)
 

Recently uploaded

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
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"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
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
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
 
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
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
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
 
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
 
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
 

Recently uploaded (20)

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"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
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
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
 
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
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
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
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
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
 
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
 

Grizzly1.9.3x

  • 11. 6 Worker   Thread Worker   Thread Web Container Worker   HTTP Engine Thread Worker   VS Select Thread Acceptor   Worker   NSAPI Engine Thread Thread 4 5 Acceptor   Worker   … Thread Thread 1 2 3 7 KeepAlive   Thread KeepAlive   Thread 9 8 ‹#›
  • 12.     B   B   Thread-­‐1   Thread-­‐1   B   B   Thread-­‐2   Thread-­‐2   B   B   Thread-­‐3   Thread-­‐3   ‹#›
  • 14. no9fy no9fy ‹#›
  • 15. Selector selector = Selector.open();! ServerSocketChannel serverChannel = ServerSocketChannel.open();! serverChannel.configureBlocking(false);// ! serverChannel.socket().bind(new InetSocketAddress(9090));! serverChannel.register(selector, SelectionKey.OP_ACCEPT);! while (selector.select() > 0) {!     for (Iterator it = selector.selectedKeys().iterator(); it.hasNext();) {!        SelectionKey key = (SelectionKey) it.next();!        it.remove();!        if (key.isAcceptable()) {!            ServerSocketChannel serverChannel =! (ServerSocketChannel) key.channel();! SocketChannel channel = serverChannel.accept();! channel.configureBlocking(false);!            channel.register(selector, SelectionKey.OP_READ);! ‹#›
  • 16. SocketChannel channel = serverChannel.accept();! AsynchronousServerSocketChannel server = AsynchronousServerSocketChannel.open().bind(9900);! Future<AsynchronousSocketChannel> acceptFuture = server.accept ();! AsynchronousSocketChannel worker = future.get();! //AsynchronousSocketChannel worker = future.get(10, TimeUnit.SECONDS); // ! ‹#›
  • 19. GlassFish glassfish = GlassFishRuntime.bootstrap().! ! ! ! ! ! ! !newGlassFish();! glassfish.start();! ! CommandRunner commandRunner = glassfish.getService (CommandRunner.class);! CommandResult commandResult = commandRunner.run("create-http- listener", "--listenerport=9090", "--listeneraddress=0.0.0.0", "--defaultvs=server", "my-http-listener");! ! Deployer deployer = glassfish.getDeployer();! deployer.deploy(new File(“HelloWorldWeb-GA.war"));! ‹#›
  • 20. public class HelloWorldAdapter extends GrizzlyAdapter {! @Override! public void service(GrizzlyRequest request, GrizzlyResponse response) {! try {! response.getWriter().println("HelloWorld");! } catch (IOException ex) {! ex.printStackTrace();! }}! <adapters>! <adapter context-root="/helloworld" class- name="co.jp.oracle.http.HelloWorldAdapter"/>! </adapters>! > asadmin deploy helloworld.jar ‹#›
  • 21. GrizzlyWebServer gws = new GrizzlyWebServer(8080, "no static content");! ! ServletAdapter simpleServletAdapter = new ServletAdapter();! simpleServletAdapter.setContextPath("/hello");! simpleServletAdapter.setServletInstance(new MyServlet());! gws.addGrizzlyAdapter(simpleServletAdapter, new String[]{"/ hello"});! ! gws.start();! ‹#›
  • 23. -Dcom.sun.grizzly.displayConfiguration = true! Grizzly running on Darwin - 10.8.0 under JDK version: 1.7.0-internal - Oracle Corporation ! port: 4848! Thread Pool: com.sun.enterprise.v3.services.impl.monitor.MonitorableThreadPool@7e8e 68bd, port=4848! Read Selector: -1! ByteBuffer size: 8192 ! maxHttpHeaderSize: 8192! sendBufferSize: 8192! maxKeepAliveRequests: 250! keepAliveTimeoutInSeconds: 30 ! Static File Cache enabled: false! ‹#› Adapter : com.sun.enterprise.v3.services.impl.ContainerMapper ! Asynchronous Request Processing enabled: false|#]!
  • 24. -­‐Dcom.sun.grizzly.enableSnoop=true! [#|2011-­‐09-­‐01T22:00:39.319+0900|INFO|glassfish3.1.1| com.sun.grizzly.config.GrizzlyServiceListener|_ThreadID=67;_ThreadName=Thread-­‐2;|GRIZZLY0020:   SocketChannel  headers  java.nio.channels.SocketChannel[connected  local=/127.0.0.1:4848  remote=/ 127.0.0.1:55379]  are:     ===  MimeHeaders  ===   host  =  127.0.0.1:4848   user-­‐agent  =  Mozilla/5.0  (Macintosh;  Intel  Mac  OS  X  10.6;  rv:6.0.1)  Gecko/20100101  Firefox/6.0.1   accept  =  text/html,applica9on/xhtml+xml,applica9on/xml;q=0.9,*/*;q=0.8   accept-­‐language  =  ja,en;q=0.7,en-­‐us;q=0.3   accept-­‐encoding  =  gzip,  deflate   accept-­‐charset  =  Shil_JIS,un-­‐8;q=0.7,*;q=0.7   ‹#›
  • 25. -client! -Xmx512m! -server ! -Xmx3500m -Xms3500m -Xss128k ! -XX:+AggressiveHeap ! -XX:+DisableExplicitGC! ‹#›