際際滷

際際滷Share a Scribd company logo
Netty Internals
       and Core Concepts
危
Twitter, Inc.
CONTENTS


   螳
   企欧 覈
   る 覈
   ろ
   螳 蟇磯Μ
螳
   ろ磯 ?
   蟲煙
       企欧 襭
       危殊 (BiDiCoR)
ろ磯 ?


   Java network application framework

       http://netty.io/

       @netty_project

   Asynchronous & event-driven

       High-throughput & highly concurrent connection

       .. with less resources  threads, memory & CPU cycles

   API as an I/O abstraction layer

       Works with NIO, OIO, AIO & more without many changes

   Well-defined event model & thread model

   Flexible event handling with bi-directional chain of responsibility pattern

   Promotes 'separation of concerns'

       I/O layer (Netty)

       Protocol codec (Netty or user)

       Business logic (user)
蟲煙


                                   Business Logic



                          Custom Event Handlers & Codecs


                                    User Code


                                                HTTP



       TCP      UDP        In-VM                Codec Framework



                                                       Event Handlers

             Transports                                  Handlers

              I/O Abstraction  Channels, Event Loops, and Pipelines



                                      Buffers

                                       Core
企欧 襭


   Similar to..

       Windows event dispatcher

       Swing event loop

       Reactor

    I/O 豌 豌襴

       企欧 襭 る 伎 豌 蟆曙 讀

       企欧 襭 る 語 豌 蟆曙 企欧 襭   l れ譽

   碁 蠏轟 覦螻 危殊語 襴

       一危磯ゼ 曙企れ

       貅 覯手 蟒 谿殊

   螳    ろ

       One-time or periodic
危殊


   BiDiCoR

       Bi-directional Chain of Responsibility pattern

       Similar to Servlet filters and decorator pattern

   Inbound event

       企欧 襭螳 覦 企欧 ( 貅 郁屋 , 一危   )

       螳 燕 inbound event handler 螳   襦  譴

   Outbound event

       螳 豌  ( 郁鍵 , 所鍵 殊 譴  )

       螳 燕 outbound event handler 螳 るジ 碁る 豌  螳襦豈  襦  譴

       豕譬朱 企欧 襭  れ I/O 螳 襦 

   

       [1:EvLoop]  [2:Protocol Decoder]  [3:Protocol Encoder]  [4:Business Logic]

        : 1  2  4

       ′ : 4  3  1
企欧 覈
   Before, After & Considerations
蠍一ヾ 企欧 覈


   企欧 = 覦 螳豌                                                 Is GC cheap?

                                                                 No at extreme scale

       ChannelOpen (instanceof ChannelStateEvent)
                                                                Can buffer pool beat JVM's memory allocator?

       ChannelBound (instanceof ChannelStateEvent)                 Think memory bandwidth took by memset

       ChannelConnected (instanceof ChannelStateEvent)             Modern concurrency constructs enable close-to-native
                                                                     efficiency in object pooling
       MessageEvent (inbound)
                                                                Too many state events!
       MessageEvent (outbound)
                                                                    Open  bound  connected is an overkill in most TCP conns
       ChannelDisconnected (instanceof ChannelStateEvent)
                                                                    What's interesting to user is 'connected'.
       ChannelUnbound (instanceof ChannelStateEvent)

       ChannelClosed (instanceof ChannelStateEvent)
                                                                New buffer is created on every MessageEvent.

                                                                    GC pressure

                                                                    User has no control over the buffer

                                                                        Heap or direct
                                                                        Bounded or unbounded
                                                                No buffered flush

                                                                    Every write is an immediate flush

                                                                    Sometimes not desired
 企欧 覈


   企欧 = 覃 語                    

                               碁る螳  覦 ′ 覯朱ゼ 襷れ ろ一蟆 螻牛覃
                                   讌朱 
       ChannelRegistered
                                      覯 伎  覈覩襦 襷 蟲  螳
       ChannelActive
                                      企欧語 覯 覲願 
       InboundBufferUpdated
                                  Buffered flush
       Flush

       ChannelInactive               覯殊 一危磯ゼ 豈  flush 企欧碁ゼ 覦る 蟆朱
                                       MessageEvent 豌
       ChannelUnregistered
                                       螳 覃讌襯   flush  ろ 貊 

                                    GC 觜

                                      企欧 螳豌   語 ろ

                                       覦 ′ 覯

                                  

                                      企欧 覲襦 覃襯 覿 伎  ( 貊 譴覲 )

                                        企欧 豌襴 企れ

                                          覲襦 UserEventTriggered 覃 豢螳
る 覈
   Why is well-defined thread model necessary?
  る 覈語 


     貊螳 企 る 語 ろ 讌 豢覿  伎 

   螳 企  thread safety 襯  貊 (e.g. 企欧 碁る ) 蟆 螻牛 蟆瑚 ?

       企欧 螳 happens-before 蟯螻

       ろ郁 碁る 覃襯  ろ 蟆曙郁 螳

       觜蠍 I/O 豌 危 襭 襴殊 企 る ろ伎 螳

       螳 讌 蠍壱襦   dead lock 覦 讌 螳

    る 覈語 讌 朱  貊 覦伎朱 (  覿蟆 ) 焔

       覿 蠍壱 覦 蠏語 磯ジ dead lock (  覿譟燕 蠍壱襦 誤 race condition)

       焔  覦 讌 覲伎 觜 讀螳

    : ろ一 SSL 碁る

       LoC: 1469  925 (3.5 vs 4.0)
ろ 4 る 覈


   3.x 觜 企欧 覈 螳螻 蟷 螳 譴螻 蠍 覲

   ろ磯 碁る螳 @Sharable 企誤伎 覿  蟆曙郁 覃  螳 碁る 覃襯  語讌  .

         燕 碁る 企れ 覃襯 蠍壱 螳  .

        ,  螳 碁る 語ろ伎るゼ 危殊語  覯 豢螳   .

   ろ郁 碁る 覃襯 語  螳 語 伎 happens-before 蟯螻螳 焔渚 .

        碁る 覃る 覲襯 volatile 襦 誤 螳  .

   企欧碁  炎 る襦 ろ .

       碁る 覃  螳 る襦覿 語 .

   觜蠍 豌  蟆郁骸 給慨 (ChannelFuture)  企欧 襭 る  企伎 .
ろ
   ろ  ろ
   ろ 豌伎 ろ
ろ  ろ


   ろ磯 EmbeddedChannel 企 覿襴 Channel 蟲 螻

     燕 碁る襯 EmbeddedChannel  危殊語 豢螳螻 企欧碁ゼ 襦 覦貅 ろ

       @Test
       public void testLineProtocol() {
           EmbeddedByteChannel ch = new EmbeddedByteChannel(new LineDecoder());

           // Ordinary input
           ch.writeInbound(Unpooled.wrappedBuffer(new byte[] { 'A' }));
           assertNull(ch.readInbound());
           ch.writeInbound(Unpooled.wrappedBuffer(new byte[] { 'B' }));
           assertNull(ch.readInbound());
           ch.writeInbound(Unpooled.wrappedBuffer(new byte[] { 'C' }));
           assertNull(ch.readInbound());
           ch.writeInbound(Unpooled.wrappedBuffer(new byte[] { 'n' }));
           assertEquals(Unpooled.wrappedBuffer(new byte[] { 'A', 'B', 'C' }),
                        ch.readInbound());

           // Truncated input
           ch.writeInbound(Unpooled.wrappedBuffer(new byte[] { 'A' }));
           assertNull(ch.readInbound());
           ch.close();
           assertNull(ch.readInbound());
       }
ろ 豌伎 ろ


   螳 碁ろ語   誤蠍  覈 碁ろ 譟壱螻 譯殊 襦貊 譟壱  蟲谿 ろ 

       TCP: NIO x AIO x OIO = 9  1 (OIO x OIO)

       UDP: NIO x OIO = 4

       襦貊 : Echo, SSL, SPDY = 3 * TCP (8) = 24

   豌 螻 碁る 蟆曙磯 EmbeddedChannel  伎

   蠍壱

       Jenkins

       Animal Sniffer: Build fails on violation before packaging

       Checkstyle: Build fails on violation before compilation
螳 蟇磯Μ
   Dynamic event routing
   Statistical Distributed Performance Analysis on Mesos Cluster
   Management and Monitoring
   Native Transport
   Scalable Community
[E6]2012. netty internals
[E6]2012. netty internals
襷 螻


   螻旧 襭

       伎 - http://netty.io/

       4.0 覲蟆  覈 - http://goo.gl/E2BJ2

   貉るる 襭

       觚襦蠏 覈 - http://goo.gl/2iMKP

       ろる襦 - http://stackoverflow.com/questions/tagged/netty

   ろ 襦 語 螻

       https://twitter.com/netty_project

   ろ 蟲 伎 覈

       https://groups.google.com/forum/#!forum/netty-ko

More Related Content

What's hot (19)

Social game programming footage 1 client to server connection
Social game programming footage 1 client to server connectionSocial game programming footage 1 client to server connection
Social game programming footage 1 client to server connection
Nettention
Android Push Server & MQTT
Android Push Server & MQTTAndroid Push Server & MQTT
Android Push Server & MQTT
Multi thread
Multi threadMulti thread
Multi thread
Nam Hyeonuk
11 一る
11 一る11 一る
11 一る
ssuser0c2478
Easy gameserver
Easy gameserverEasy gameserver
Easy gameserver
讌 覓
multi-thread 危襴貅伎 覈 螳覦螳 讌 朱 蟆
multi-thread 危襴貅伎  覈 螳覦螳  讌 朱   蟆multi-thread 危襴貅伎  覈 螳覦螳  讌 朱   蟆
multi-thread 危襴貅伎 覈 螳覦螳 讌 朱 蟆
ル旭 豕
V8 engine internal
V8 engine internalV8 engine internal
V8 engine internal
Jinhyuck Kim
Windows via C/C++ 06 る 蠍磯蓋
Windows via C/C++ 06 る 蠍磯蓋Windows via C/C++ 06 る 蠍磯蓋
Windows via C/C++ 06 る 蠍磯蓋
ssuser0c2478
ろ語 蠍磯蓋
ろ語 蠍磯蓋ろ語 蠍磯蓋
ろ語 蠍磯蓋
TOAST_NHNent
TCP/IP Protocol - JAVA
TCP/IP Protocol - JAVATCP/IP Protocol - JAVA
TCP/IP Protocol - JAVA
cooddy
Lock free queue
Lock free queueLock free queue
Lock free queue
Bongseok Cho
IBM MQTT Mobile Push Solution 螳
IBM MQTT Mobile Push Solution 螳IBM MQTT Mobile Push Solution 螳
IBM MQTT Mobile Push Solution 螳
Shaun LEE
襴 襴豌 Windows via C/C++ : 8 覈 る 蠍壱
襴 襴豌 Windows via C/C++ : 8  覈 る 蠍壱襴 襴豌 Windows via C/C++ : 8  覈 る 蠍壱
襴 襴豌 Windows via C/C++ : 8 覈 る 蠍壱
sung ki choi
Windows via c/c++ ch03. 貉るる
Windows via c/c++ ch03. 貉るるWindows via c/c++ ch03. 貉るる
Windows via c/c++ ch03. 貉るる
ssuser0c2478
MutiCore 19-20
MutiCore 19-20MutiCore 19-20
MutiCore 19-20
HyeonSeok Choi
05_Reliable UDP 蟲
05_Reliable UDP 蟲05_Reliable UDP 蟲
05_Reliable UDP 蟲
noerror
Mastering ethereum(smart contract)
Mastering ethereum(smart contract)Mastering ethereum(smart contract)
Mastering ethereum(smart contract)
Windws via c/c++ chapter 6
Windws via c/c++ chapter 6Windws via c/c++ chapter 6
Windws via c/c++ chapter 6
SukYun Yoon
Multi-thread : producer - consumer
Multi-thread : producer - consumerMulti-thread : producer - consumer
Multi-thread : producer - consumer
Chang Yoon Oh
Social game programming footage 1 client to server connection
Social game programming footage 1 client to server connectionSocial game programming footage 1 client to server connection
Social game programming footage 1 client to server connection
Nettention
Android Push Server & MQTT
Android Push Server & MQTTAndroid Push Server & MQTT
Android Push Server & MQTT
Easy gameserver
Easy gameserverEasy gameserver
Easy gameserver
讌 覓
multi-thread 危襴貅伎 覈 螳覦螳 讌 朱 蟆
multi-thread 危襴貅伎  覈 螳覦螳  讌 朱   蟆multi-thread 危襴貅伎  覈 螳覦螳  讌 朱   蟆
multi-thread 危襴貅伎 覈 螳覦螳 讌 朱 蟆
ル旭 豕
V8 engine internal
V8 engine internalV8 engine internal
V8 engine internal
Jinhyuck Kim
Windows via C/C++ 06 る 蠍磯蓋
Windows via C/C++ 06 る 蠍磯蓋Windows via C/C++ 06 る 蠍磯蓋
Windows via C/C++ 06 る 蠍磯蓋
ssuser0c2478
TCP/IP Protocol - JAVA
TCP/IP Protocol - JAVATCP/IP Protocol - JAVA
TCP/IP Protocol - JAVA
cooddy
Lock free queue
Lock free queueLock free queue
Lock free queue
Bongseok Cho
IBM MQTT Mobile Push Solution 螳
IBM MQTT Mobile Push Solution 螳IBM MQTT Mobile Push Solution 螳
IBM MQTT Mobile Push Solution 螳
Shaun LEE
襴 襴豌 Windows via C/C++ : 8 覈 る 蠍壱
襴 襴豌 Windows via C/C++ : 8  覈 る 蠍壱襴 襴豌 Windows via C/C++ : 8  覈 る 蠍壱
襴 襴豌 Windows via C/C++ : 8 覈 る 蠍壱
sung ki choi
Windows via c/c++ ch03. 貉るる
Windows via c/c++ ch03. 貉るるWindows via c/c++ ch03. 貉るる
Windows via c/c++ ch03. 貉るる
ssuser0c2478
05_Reliable UDP 蟲
05_Reliable UDP 蟲05_Reliable UDP 蟲
05_Reliable UDP 蟲
noerror
Mastering ethereum(smart contract)
Mastering ethereum(smart contract)Mastering ethereum(smart contract)
Mastering ethereum(smart contract)
Windws via c/c++ chapter 6
Windws via c/c++ chapter 6Windws via c/c++ chapter 6
Windws via c/c++ chapter 6
SukYun Yoon
Multi-thread : producer - consumer
Multi-thread : producer - consumerMulti-thread : producer - consumer
Multi-thread : producer - consumer
Chang Yoon Oh

Viewers also liked (12)

覦 ろ語 Netty 襴觀
覦 ろ語  Netty 襴觀覦 ろ語  Netty 襴觀
覦 ろ語 Netty 襴觀
Woojin Joe
Network 豐覲伎襯 Netty
Network 豐覲伎襯  NettyNetwork 豐覲伎襯  Netty
Network 豐覲伎襯 Netty
Choulhyouc Lee
Netty 求== (1)
Netty 求== (1)Netty 求== (1)
Netty 求== (1)
Daehyun Kim
OB1K - New, Better, Faster, Devops Friendly Java container by Outbrain
OB1K - New, Better, Faster, Devops Friendly Java container by OutbrainOB1K - New, Better, Faster, Devops Friendly Java container by Outbrain
OB1K - New, Better, Faster, Devops Friendly Java container by Outbrain
Eran Harel
Vert.x - Dess狸
Vert.x - Dess狸Vert.x - Dess狸
Vert.x - Dess狸
Codemotion
Netty 求== (2)
Netty 求== (2)Netty 求== (2)
Netty 求== (2)
Daehyun Kim
ろ 螳覦 危 豐讌ク
ろ  螳覦 危 豐讌クろ  螳覦 危 豐讌ク
ろ 螳覦 危 豐讌ク
The Power Of Event Chapter 7
The Power Of Event Chapter 7The Power Of Event Chapter 7
The Power Of Event Chapter 7
Woojin Joe
Netty 求== (4)
Netty 求== (4)Netty 求== (4)
Netty 求== (4)
Daehyun Kim
Baidu push 磯蠍
Baidu push 磯蠍Baidu push 磯蠍
Baidu push 磯蠍
Choulhyouc Lee
Docker (Compose) - 螳覦 蟆 蟲燕蠍
Docker (Compose)  - 螳覦 蟆 蟲燕蠍Docker (Compose)  - 螳覦 蟆 蟲燕蠍
Docker (Compose) - 螳覦 蟆 蟲燕蠍
raccoony
Netty 4-based RPC System Development
Netty 4-based RPC System DevelopmentNetty 4-based RPC System Development
Netty 4-based RPC System Development
Allan Huang
覦 ろ語 Netty 襴觀
覦 ろ語  Netty 襴觀覦 ろ語  Netty 襴觀
覦 ろ語 Netty 襴觀
Woojin Joe
Network 豐覲伎襯 Netty
Network 豐覲伎襯  NettyNetwork 豐覲伎襯  Netty
Network 豐覲伎襯 Netty
Choulhyouc Lee
Netty 求== (1)
Netty 求== (1)Netty 求== (1)
Netty 求== (1)
Daehyun Kim
OB1K - New, Better, Faster, Devops Friendly Java container by Outbrain
OB1K - New, Better, Faster, Devops Friendly Java container by OutbrainOB1K - New, Better, Faster, Devops Friendly Java container by Outbrain
OB1K - New, Better, Faster, Devops Friendly Java container by Outbrain
Eran Harel
Vert.x - Dess狸
Vert.x - Dess狸Vert.x - Dess狸
Vert.x - Dess狸
Codemotion
Netty 求== (2)
Netty 求== (2)Netty 求== (2)
Netty 求== (2)
Daehyun Kim
ろ 螳覦 危 豐讌ク
ろ  螳覦 危 豐讌クろ  螳覦 危 豐讌ク
ろ 螳覦 危 豐讌ク
The Power Of Event Chapter 7
The Power Of Event Chapter 7The Power Of Event Chapter 7
The Power Of Event Chapter 7
Woojin Joe
Netty 求== (4)
Netty 求== (4)Netty 求== (4)
Netty 求== (4)
Daehyun Kim
Docker (Compose) - 螳覦 蟆 蟲燕蠍
Docker (Compose)  - 螳覦 蟆 蟲燕蠍Docker (Compose)  - 螳覦 蟆 蟲燕蠍
Docker (Compose) - 螳覦 蟆 蟲燕蠍
raccoony
Netty 4-based RPC System Development
Netty 4-based RPC System DevelopmentNetty 4-based RPC System Development
Netty 4-based RPC System Development
Allan Huang

Similar to [E6]2012. netty internals (20)

[ろれ雑ろ]貎覯ろ一るゼ 螳覦蟆 蟲豢
[ろれ雑ろ]貎覯ろ一るゼ  螳覦蟆 蟲豢[ろれ雑ろ]貎覯ろ一るゼ  螳覦蟆 蟲豢
[ろれ雑ろ]貎覯ろ一るゼ 螳覦蟆 蟲豢
Ji-Woong Choi
Implementing remote procedure calls rev2
Implementing remote procedure calls rev2Implementing remote procedure calls rev2
Implementing remote procedure calls rev2
Sung-jae Park
求梶 =罪= Real-time In-memory Stream Processing 求a
求梶 =罪= Real-time In-memory Stream Processing 求a求梶 =罪= Real-time In-memory Stream Processing 求a
求梶 =罪= Real-time In-memory Stream Processing 求a
Ted Won
語3 node.js 覩語 覦
語3 node.js 覩語 覦 語3 node.js 覩語 覦
語3 node.js 覩語 覦
Lee Ji Eun
Multithread pattern 螳
Multithread pattern 螳Multithread pattern 螳
Multithread pattern 螳
Sunghyouk Bae
1st-BE-sideproject-GDGonCampus_KyungHee_Univ.pdf
1st-BE-sideproject-GDGonCampus_KyungHee_Univ.pdf1st-BE-sideproject-GDGonCampus_KyungHee_Univ.pdf
1st-BE-sideproject-GDGonCampus_KyungHee_Univ.pdf
dpfls5645
Ch7,8. Configmaps, Secrets and API
Ch7,8. Configmaps, Secrets and APICh7,8. Configmaps, Secrets and API
Ch7,8. Configmaps, Secrets and API
Hongmin Park
蟆 覯 螳覦 蟯 覲 Node.js ル螻
蟆 覯 螳覦 蟯 覲 Node.js ル螻 蟆 覯 螳覦 蟯 覲 Node.js ル螻
蟆 覯 螳覦 蟯 覲 Node.js ル螻
Jeongsang Baek
濠鍵覦蟆螳 2010 CPD
濠鍵覦蟆螳 2010 CPD濠鍵覦蟆螳 2010 CPD
濠鍵覦蟆螳 2010 CPD
[れ企ろれ碁碁] Pinpoint襯 伎伎 覯襴 Apache Openwhisk 碁伎燕蠍 - れ麹
[れ企ろれ碁碁] Pinpoint襯 伎伎 覯襴  Apache Openwhisk 碁伎燕蠍 - れ麹[れ企ろれ碁碁] Pinpoint襯 伎伎 覯襴  Apache Openwhisk 碁伎燕蠍 - れ麹
[れ企ろれ碁碁] Pinpoint襯 伎伎 覯襴 Apache Openwhisk 碁伎燕蠍 - れ麹
NAVER Engineering
11st Legacy Application Spring Cloud 蠍磯 MicroServices襦 螳覦 襦
11st Legacy Application Spring Cloud 蠍磯 MicroServices襦  螳覦 襦11st Legacy Application Spring Cloud 蠍磯 MicroServices襦  螳覦 襦
11st Legacy Application Spring Cloud 蠍磯 MicroServices襦 螳覦 襦
YongSung Yoon
KAFKA 3.1.0.pdf
KAFKA 3.1.0.pdfKAFKA 3.1.0.pdf
KAFKA 3.1.0.pdf
wonyong hwang
=≡ Web proxy_≡=_2006п11_pas_ktf
=≡ Web proxy_≡=_2006п11_pas_ktf=≡ Web proxy_≡=_2006п11_pas_ktf
=≡ Web proxy_≡=_2006п11_pas_ktf
Daehee Han
覯襯 覈瑚骸 Staged eventdrivenarchitecture
覯襯   覈瑚骸 Staged eventdrivenarchitecture覯襯   覈瑚骸 Staged eventdrivenarchitecture
覯襯 覈瑚骸 Staged eventdrivenarchitecture
HyeonSeok Choi
Auto Scalable Deep Learning Production AI Serving Infra 蟲 覦 AI DevOps...
Auto Scalable  Deep Learning Production   AI Serving Infra 蟲 覦 AI DevOps...Auto Scalable  Deep Learning Production   AI Serving Infra 蟲 覦 AI DevOps...
Auto Scalable Deep Learning Production AI Serving Infra 蟲 覦 AI DevOps...
hoondong kim
[112]clova platform 瑚概讌レ 蠍一
[112]clova platform 瑚概讌レ  蠍一[112]clova platform 瑚概讌レ  蠍一
[112]clova platform 瑚概讌レ 蠍一
NAVER D2
2. klaytn developer meetup #2 univ chain
2. klaytn developer meetup #2 univ chain2. klaytn developer meetup #2 univ chain
2. klaytn developer meetup #2 univ chain
覩手
Kafka slideshare
Kafka   slideshareKafka   slideshare
Kafka slideshare
wonyong hwang
Warp
WarpWarp
Warp
aceigy6322
蠍壱, れ譴襷
蠍壱, れ譴襷蠍壱, れ譴襷
蠍壱, れ譴襷
xxbdxx
[ろれ雑ろ]貎覯ろ一るゼ 螳覦蟆 蟲豢
[ろれ雑ろ]貎覯ろ一るゼ  螳覦蟆 蟲豢[ろれ雑ろ]貎覯ろ一るゼ  螳覦蟆 蟲豢
[ろれ雑ろ]貎覯ろ一るゼ 螳覦蟆 蟲豢
Ji-Woong Choi
Implementing remote procedure calls rev2
Implementing remote procedure calls rev2Implementing remote procedure calls rev2
Implementing remote procedure calls rev2
Sung-jae Park
求梶 =罪= Real-time In-memory Stream Processing 求a
求梶 =罪= Real-time In-memory Stream Processing 求a求梶 =罪= Real-time In-memory Stream Processing 求a
求梶 =罪= Real-time In-memory Stream Processing 求a
Ted Won
語3 node.js 覩語 覦
語3 node.js 覩語 覦 語3 node.js 覩語 覦
語3 node.js 覩語 覦
Lee Ji Eun
Multithread pattern 螳
Multithread pattern 螳Multithread pattern 螳
Multithread pattern 螳
Sunghyouk Bae
1st-BE-sideproject-GDGonCampus_KyungHee_Univ.pdf
1st-BE-sideproject-GDGonCampus_KyungHee_Univ.pdf1st-BE-sideproject-GDGonCampus_KyungHee_Univ.pdf
1st-BE-sideproject-GDGonCampus_KyungHee_Univ.pdf
dpfls5645
Ch7,8. Configmaps, Secrets and API
Ch7,8. Configmaps, Secrets and APICh7,8. Configmaps, Secrets and API
Ch7,8. Configmaps, Secrets and API
Hongmin Park
蟆 覯 螳覦 蟯 覲 Node.js ル螻
蟆 覯 螳覦 蟯 覲 Node.js ル螻 蟆 覯 螳覦 蟯 覲 Node.js ル螻
蟆 覯 螳覦 蟯 覲 Node.js ル螻
Jeongsang Baek
濠鍵覦蟆螳 2010 CPD
濠鍵覦蟆螳 2010 CPD濠鍵覦蟆螳 2010 CPD
濠鍵覦蟆螳 2010 CPD
[れ企ろれ碁碁] Pinpoint襯 伎伎 覯襴 Apache Openwhisk 碁伎燕蠍 - れ麹
[れ企ろれ碁碁] Pinpoint襯 伎伎 覯襴  Apache Openwhisk 碁伎燕蠍 - れ麹[れ企ろれ碁碁] Pinpoint襯 伎伎 覯襴  Apache Openwhisk 碁伎燕蠍 - れ麹
[れ企ろれ碁碁] Pinpoint襯 伎伎 覯襴 Apache Openwhisk 碁伎燕蠍 - れ麹
NAVER Engineering
11st Legacy Application Spring Cloud 蠍磯 MicroServices襦 螳覦 襦
11st Legacy Application Spring Cloud 蠍磯 MicroServices襦  螳覦 襦11st Legacy Application Spring Cloud 蠍磯 MicroServices襦  螳覦 襦
11st Legacy Application Spring Cloud 蠍磯 MicroServices襦 螳覦 襦
YongSung Yoon
=≡ Web proxy_≡=_2006п11_pas_ktf
=≡ Web proxy_≡=_2006п11_pas_ktf=≡ Web proxy_≡=_2006п11_pas_ktf
=≡ Web proxy_≡=_2006п11_pas_ktf
Daehee Han
覯襯 覈瑚骸 Staged eventdrivenarchitecture
覯襯   覈瑚骸 Staged eventdrivenarchitecture覯襯   覈瑚骸 Staged eventdrivenarchitecture
覯襯 覈瑚骸 Staged eventdrivenarchitecture
HyeonSeok Choi
Auto Scalable Deep Learning Production AI Serving Infra 蟲 覦 AI DevOps...
Auto Scalable  Deep Learning Production   AI Serving Infra 蟲 覦 AI DevOps...Auto Scalable  Deep Learning Production   AI Serving Infra 蟲 覦 AI DevOps...
Auto Scalable Deep Learning Production AI Serving Infra 蟲 覦 AI DevOps...
hoondong kim
[112]clova platform 瑚概讌レ 蠍一
[112]clova platform 瑚概讌レ  蠍一[112]clova platform 瑚概讌レ  蠍一
[112]clova platform 瑚概讌レ 蠍一
NAVER D2
2. klaytn developer meetup #2 univ chain
2. klaytn developer meetup #2 univ chain2. klaytn developer meetup #2 univ chain
2. klaytn developer meetup #2 univ chain
覩手
蠍壱, れ譴襷
蠍壱, れ譴襷蠍壱, れ譴襷
蠍壱, れ譴襷
xxbdxx

More from NAVER D2 (20)

[211] 瑚概讌レ 瑚概讌 豈覺 襷
[211] 瑚概讌レ 瑚概讌 豈覺 襷[211] 瑚概讌レ 瑚概讌 豈覺 襷
[211] 瑚概讌レ 瑚概讌 豈覺 襷
NAVER D2
[233] 貉企 企ろ一 螻螳 Network Load Balancing: Maglev Hashing Scheduler i...
[233]  貉企 企ろ一 螻螳 Network Load Balancing: Maglev Hashing Scheduler i...[233]  貉企 企ろ一 螻螳 Network Load Balancing: Maglev Hashing Scheduler i...
[233] 貉企 企ろ一 螻螳 Network Load Balancing: Maglev Hashing Scheduler i...
NAVER D2
[215] Druid襦 所 觜襯願 一危 覿蠍
[215] Druid襦 所 觜襯願 一危 覿蠍[215] Druid襦 所 觜襯願 一危 覿蠍
[215] Druid襦 所 觜襯願 一危 覿蠍
NAVER D2
[245]Papago Internals: 覈碁螻 蠍一 螳覦
[245]Papago Internals: 覈碁螻 蠍一 螳覦[245]Papago Internals: 覈碁螻 蠍一 螳覦
[245]Papago Internals: 覈碁螻 蠍一 螳覦
NAVER D2
[236] ろ碁 レ 豕 伎手鍵: 豺 襭企襦覿 詞 蟲
[236] ろ碁 レ 豕 伎手鍵: 豺 襭企襦覿 詞 蟲[236] ろ碁 レ 豕 伎手鍵: 豺 襭企襦覿 詞 蟲
[236] ろ碁 レ 豕 伎手鍵: 豺 襭企襦覿 詞 蟲
NAVER D2
[235]Wikipedia-scale Q&A[235]Wikipedia-scale Q&A
[235]Wikipedia-scale Q&A
NAVER D2
[244]襦覺 瑚 牛襦 襷り鍵
[244]襦覺  瑚  牛襦 襷り鍵[244]襦覺  瑚  牛襦 襷り鍵
[244]襦覺 瑚 牛襦 襷り鍵
NAVER D2
[243] Deep Learning to help students Deep Learning
[243] Deep Learning to help students Deep Learning[243] Deep Learning to help students Deep Learning
[243] Deep Learning to help students Deep Learning
NAVER D2
[234]Fast & Accurate Data Annotation Pipeline for AI applications
[234]Fast & Accurate Data Annotation Pipeline for AI applications[234]Fast & Accurate Data Annotation Pipeline for AI applications
[234]Fast & Accurate Data Annotation Pipeline for AI applications
NAVER D2
Old version: [233] 貉企 企ろ一 螻螳 Network Load Balancing
Old version: [233] 貉企 企ろ一 螻螳 Network Load BalancingOld version: [233] 貉企 企ろ一 螻螳 Network Load Balancing
Old version: [233] 貉企 企ろ一 螻螳 Network Load Balancing
NAVER D2
[226]NAVER 蟯螻 deep click prediction: 覈碁覿 觜蟾讌
[226]NAVER 蟯螻 deep click prediction: 覈碁覿 觜蟾讌[226]NAVER 蟯螻 deep click prediction: 覈碁覿 觜蟾讌
[226]NAVER 蟯螻 deep click prediction: 覈碁覿 觜蟾讌
NAVER D2
[225]NSML: 襾語 觜ろ蠍 & 覈 蠍
[225]NSML: 襾語  觜ろ蠍 & 覈  蠍[225]NSML: 襾語  觜ろ蠍 & 覈  蠍
[225]NSML: 襾語 觜ろ蠍 & 覈 蠍
NAVER D2
[224]れ企 蟆螻 螳誤
[224]れ企 蟆螻 螳誤[224]れ企 蟆螻 螳誤
[224]れ企 蟆螻 螳誤
NAVER D2
[216]Search Reliability Engineering (覿: 讌讌 るΜ讌 れ企 蟆ろ)
[216]Search Reliability Engineering (覿: 讌讌 るΜ讌  れ企 蟆ろ)[216]Search Reliability Engineering (覿: 讌讌 るΜ讌  れ企 蟆ろ)
[216]Search Reliability Engineering (覿: 讌讌 るΜ讌 れ企 蟆ろ)
NAVER D2
[214] Ai Serving Platform: 襭 蟇伎 誤朱一るゼ 豌襴蠍 螻蟲磯蠍
[214] Ai Serving Platform: 襭   蟇伎 誤朱一るゼ 豌襴蠍  螻蟲磯蠍[214] Ai Serving Platform: 襭   蟇伎 誤朱一るゼ 豌襴蠍  螻蟲磯蠍
[214] Ai Serving Platform: 襭 蟇伎 誤朱一るゼ 豌襴蠍 螻蟲磯蠍
NAVER D2
[213] Fashion Visual Search
[213] Fashion Visual Search[213] Fashion Visual Search
[213] Fashion Visual Search
NAVER D2
[232] TensorRT襯 ル Inference 豕
[232] TensorRT襯  ル Inference 豕[232] TensorRT襯  ル Inference 豕
[232] TensorRT襯 ル Inference 豕
NAVER D2
[242]貉危 觜 伎 る 讌  一危 覦覯: ル 牛 POI 覲 讌[242]貉危 觜 伎 る 讌  一危 覦覯: ル 牛 POI 覲 讌
[242]貉危 觜 伎 る 讌 一危 覦覯: ル 牛 POI 覲 讌
NAVER D2
[212]C3, 一危 豌襴 觜蟾讌 螳ロ  企ろ[212]C3, 一危 豌襴 觜蟾讌 螳ロ  企ろ
[212]C3, 一危 豌襴 觜蟾讌 螳ロ 企ろ
NAVER D2
[223]蠍郁 QA: 蟆瑚, NLP瑚?
[223]蠍郁 QA: 蟆瑚, NLP瑚?[223]蠍郁 QA: 蟆瑚, NLP瑚?
[223]蠍郁 QA: 蟆瑚, NLP瑚?
NAVER D2
[211] 瑚概讌レ 瑚概讌 豈覺 襷
[211] 瑚概讌レ 瑚概讌 豈覺 襷[211] 瑚概讌レ 瑚概讌 豈覺 襷
[211] 瑚概讌レ 瑚概讌 豈覺 襷
NAVER D2
[233] 貉企 企ろ一 螻螳 Network Load Balancing: Maglev Hashing Scheduler i...
[233]  貉企 企ろ一 螻螳 Network Load Balancing: Maglev Hashing Scheduler i...[233]  貉企 企ろ一 螻螳 Network Load Balancing: Maglev Hashing Scheduler i...
[233] 貉企 企ろ一 螻螳 Network Load Balancing: Maglev Hashing Scheduler i...
NAVER D2
[215] Druid襦 所 觜襯願 一危 覿蠍
[215] Druid襦 所 觜襯願 一危 覿蠍[215] Druid襦 所 觜襯願 一危 覿蠍
[215] Druid襦 所 觜襯願 一危 覿蠍
NAVER D2
[245]Papago Internals: 覈碁螻 蠍一 螳覦
[245]Papago Internals: 覈碁螻 蠍一 螳覦[245]Papago Internals: 覈碁螻 蠍一 螳覦
[245]Papago Internals: 覈碁螻 蠍一 螳覦
NAVER D2
[236] ろ碁 レ 豕 伎手鍵: 豺 襭企襦覿 詞 蟲
[236] ろ碁 レ 豕 伎手鍵: 豺 襭企襦覿 詞 蟲[236] ろ碁 レ 豕 伎手鍵: 豺 襭企襦覿 詞 蟲
[236] ろ碁 レ 豕 伎手鍵: 豺 襭企襦覿 詞 蟲
NAVER D2
[235]Wikipedia-scale Q&A[235]Wikipedia-scale Q&A
[235]Wikipedia-scale Q&A
NAVER D2
[244]襦覺 瑚 牛襦 襷り鍵
[244]襦覺  瑚  牛襦 襷り鍵[244]襦覺  瑚  牛襦 襷り鍵
[244]襦覺 瑚 牛襦 襷り鍵
NAVER D2
[243] Deep Learning to help students Deep Learning
[243] Deep Learning to help students Deep Learning[243] Deep Learning to help students Deep Learning
[243] Deep Learning to help students Deep Learning
NAVER D2
[234]Fast & Accurate Data Annotation Pipeline for AI applications
[234]Fast & Accurate Data Annotation Pipeline for AI applications[234]Fast & Accurate Data Annotation Pipeline for AI applications
[234]Fast & Accurate Data Annotation Pipeline for AI applications
NAVER D2
Old version: [233] 貉企 企ろ一 螻螳 Network Load Balancing
Old version: [233] 貉企 企ろ一 螻螳 Network Load BalancingOld version: [233] 貉企 企ろ一 螻螳 Network Load Balancing
Old version: [233] 貉企 企ろ一 螻螳 Network Load Balancing
NAVER D2
[226]NAVER 蟯螻 deep click prediction: 覈碁覿 觜蟾讌
[226]NAVER 蟯螻 deep click prediction: 覈碁覿 觜蟾讌[226]NAVER 蟯螻 deep click prediction: 覈碁覿 觜蟾讌
[226]NAVER 蟯螻 deep click prediction: 覈碁覿 觜蟾讌
NAVER D2
[225]NSML: 襾語 觜ろ蠍 & 覈 蠍
[225]NSML: 襾語  觜ろ蠍 & 覈  蠍[225]NSML: 襾語  觜ろ蠍 & 覈  蠍
[225]NSML: 襾語 觜ろ蠍 & 覈 蠍
NAVER D2
[224]れ企 蟆螻 螳誤
[224]れ企 蟆螻 螳誤[224]れ企 蟆螻 螳誤
[224]れ企 蟆螻 螳誤
NAVER D2
[216]Search Reliability Engineering (覿: 讌讌 るΜ讌 れ企 蟆ろ)
[216]Search Reliability Engineering (覿: 讌讌 るΜ讌  れ企 蟆ろ)[216]Search Reliability Engineering (覿: 讌讌 るΜ讌  れ企 蟆ろ)
[216]Search Reliability Engineering (覿: 讌讌 るΜ讌 れ企 蟆ろ)
NAVER D2
[214] Ai Serving Platform: 襭 蟇伎 誤朱一るゼ 豌襴蠍 螻蟲磯蠍
[214] Ai Serving Platform: 襭   蟇伎 誤朱一るゼ 豌襴蠍  螻蟲磯蠍[214] Ai Serving Platform: 襭   蟇伎 誤朱一るゼ 豌襴蠍  螻蟲磯蠍
[214] Ai Serving Platform: 襭 蟇伎 誤朱一るゼ 豌襴蠍 螻蟲磯蠍
NAVER D2
[213] Fashion Visual Search
[213] Fashion Visual Search[213] Fashion Visual Search
[213] Fashion Visual Search
NAVER D2
[232] TensorRT襯 ル Inference 豕
[232] TensorRT襯  ル Inference 豕[232] TensorRT襯  ル Inference 豕
[232] TensorRT襯 ル Inference 豕
NAVER D2
[242]貉危 觜 伎 る 讌  一危 覦覯: ル 牛 POI 覲 讌[242]貉危 觜 伎 る 讌  一危 覦覯: ル 牛 POI 覲 讌
[242]貉危 觜 伎 る 讌 一危 覦覯: ル 牛 POI 覲 讌
NAVER D2
[212]C3, 一危 豌襴 觜蟾讌 螳ロ  企ろ[212]C3, 一危 豌襴 觜蟾讌 螳ロ  企ろ
[212]C3, 一危 豌襴 觜蟾讌 螳ロ 企ろ
NAVER D2
[223]蠍郁 QA: 蟆瑚, NLP瑚?
[223]蠍郁 QA: 蟆瑚, NLP瑚?[223]蠍郁 QA: 蟆瑚, NLP瑚?
[223]蠍郁 QA: 蟆瑚, NLP瑚?
NAVER D2

[E6]2012. netty internals

  • 1. Netty Internals and Core Concepts 危 Twitter, Inc.
  • 2. CONTENTS 螳 企欧 覈 る 覈 ろ 螳 蟇磯Μ
  • 3. ろ磯 ? 蟲煙 企欧 襭 危殊 (BiDiCoR)
  • 4. ろ磯 ? Java network application framework http://netty.io/ @netty_project Asynchronous & event-driven High-throughput & highly concurrent connection .. with less resources threads, memory & CPU cycles API as an I/O abstraction layer Works with NIO, OIO, AIO & more without many changes Well-defined event model & thread model Flexible event handling with bi-directional chain of responsibility pattern Promotes 'separation of concerns' I/O layer (Netty) Protocol codec (Netty or user) Business logic (user)
  • 5. 蟲煙 Business Logic Custom Event Handlers & Codecs User Code HTTP TCP UDP In-VM Codec Framework Event Handlers Transports Handlers I/O Abstraction Channels, Event Loops, and Pipelines Buffers Core
  • 6. 企欧 襭 Similar to.. Windows event dispatcher Swing event loop Reactor I/O 豌 豌襴 企欧 襭 る 伎 豌 蟆曙 讀 企欧 襭 る 語 豌 蟆曙 企欧 襭 l れ譽 碁 蠏轟 覦螻 危殊語 襴 一危磯ゼ 曙企れ 貅 覯手 蟒 谿殊 螳 ろ One-time or periodic
  • 7. 危殊 BiDiCoR Bi-directional Chain of Responsibility pattern Similar to Servlet filters and decorator pattern Inbound event 企欧 襭螳 覦 企欧 ( 貅 郁屋 , 一危 ) 螳 燕 inbound event handler 螳 襦 譴 Outbound event 螳 豌 ( 郁鍵 , 所鍵 殊 譴 ) 螳 燕 outbound event handler 螳 るジ 碁る 豌 螳襦豈 襦 譴 豕譬朱 企欧 襭 れ I/O 螳 襦 [1:EvLoop] [2:Protocol Decoder] [3:Protocol Encoder] [4:Business Logic] : 1 2 4 ′ : 4 3 1
  • 8. 企欧 覈 Before, After & Considerations
  • 9. 蠍一ヾ 企欧 覈 企欧 = 覦 螳豌 Is GC cheap? No at extreme scale ChannelOpen (instanceof ChannelStateEvent) Can buffer pool beat JVM's memory allocator? ChannelBound (instanceof ChannelStateEvent) Think memory bandwidth took by memset ChannelConnected (instanceof ChannelStateEvent) Modern concurrency constructs enable close-to-native efficiency in object pooling MessageEvent (inbound) Too many state events! MessageEvent (outbound) Open bound connected is an overkill in most TCP conns ChannelDisconnected (instanceof ChannelStateEvent) What's interesting to user is 'connected'. ChannelUnbound (instanceof ChannelStateEvent) ChannelClosed (instanceof ChannelStateEvent) New buffer is created on every MessageEvent. GC pressure User has no control over the buffer Heap or direct Bounded or unbounded No buffered flush Every write is an immediate flush Sometimes not desired
  • 10. 企欧 覈 企欧 = 覃 語 碁る螳 覦 ′ 覯朱ゼ 襷れ ろ一蟆 螻牛覃 讌朱 ChannelRegistered 覯 伎 覈覩襦 襷 蟲 螳 ChannelActive 企欧語 覯 覲願 InboundBufferUpdated Buffered flush Flush ChannelInactive 覯殊 一危磯ゼ 豈 flush 企欧碁ゼ 覦る 蟆朱 MessageEvent 豌 ChannelUnregistered 螳 覃讌襯 flush ろ 貊 GC 觜 企欧 螳豌 語 ろ 覦 ′ 覯 企欧 覲襦 覃襯 覿 伎 ( 貊 譴覲 ) 企欧 豌襴 企れ 覲襦 UserEventTriggered 覃 豢螳
  • 11. る 覈 Why is well-defined thread model necessary?
  • 12. 覈語 貊螳 企 る 語 ろ 讌 豢覿 伎 螳 企 thread safety 襯 貊 (e.g. 企欧 碁る ) 蟆 螻牛 蟆瑚 ? 企欧 螳 happens-before 蟯螻 ろ郁 碁る 覃襯 ろ 蟆曙郁 螳 觜蠍 I/O 豌 危 襭 襴殊 企 る ろ伎 螳 螳 讌 蠍壱襦 dead lock 覦 讌 螳 る 覈語 讌 朱 貊 覦伎朱 ( 覿蟆 ) 焔 覿 蠍壱 覦 蠏語 磯ジ dead lock ( 覿譟燕 蠍壱襦 誤 race condition) 焔 覦 讌 覲伎 觜 讀螳 : ろ一 SSL 碁る LoC: 1469 925 (3.5 vs 4.0)
  • 13. ろ 4 る 覈 3.x 觜 企欧 覈 螳螻 蟷 螳 譴螻 蠍 覲 ろ磯 碁る螳 @Sharable 企誤伎 覿 蟆曙郁 覃 螳 碁る 覃襯 語讌 . 燕 碁る 企れ 覃襯 蠍壱 螳 . , 螳 碁る 語ろ伎るゼ 危殊語 覯 豢螳 . ろ郁 碁る 覃襯 語 螳 語 伎 happens-before 蟯螻螳 焔渚 . 碁る 覃る 覲襯 volatile 襦 誤 螳 . 企欧碁 炎 る襦 ろ . 碁る 覃 螳 る襦覿 語 . 觜蠍 豌 蟆郁骸 給慨 (ChannelFuture) 企欧 襭 る 企伎 .
  • 14. ろ ろ ろ 豌伎 ろ
  • 15. ろ ろ ろ磯 EmbeddedChannel 企 覿襴 Channel 蟲 螻 燕 碁る襯 EmbeddedChannel 危殊語 豢螳螻 企欧碁ゼ 襦 覦貅 ろ @Test public void testLineProtocol() { EmbeddedByteChannel ch = new EmbeddedByteChannel(new LineDecoder()); // Ordinary input ch.writeInbound(Unpooled.wrappedBuffer(new byte[] { 'A' })); assertNull(ch.readInbound()); ch.writeInbound(Unpooled.wrappedBuffer(new byte[] { 'B' })); assertNull(ch.readInbound()); ch.writeInbound(Unpooled.wrappedBuffer(new byte[] { 'C' })); assertNull(ch.readInbound()); ch.writeInbound(Unpooled.wrappedBuffer(new byte[] { 'n' })); assertEquals(Unpooled.wrappedBuffer(new byte[] { 'A', 'B', 'C' }), ch.readInbound()); // Truncated input ch.writeInbound(Unpooled.wrappedBuffer(new byte[] { 'A' })); assertNull(ch.readInbound()); ch.close(); assertNull(ch.readInbound()); }
  • 16. ろ 豌伎 ろ 螳 碁ろ語 誤蠍 覈 碁ろ 譟壱螻 譯殊 襦貊 譟壱 蟲谿 ろ TCP: NIO x AIO x OIO = 9 1 (OIO x OIO) UDP: NIO x OIO = 4 襦貊 : Echo, SSL, SPDY = 3 * TCP (8) = 24 豌 螻 碁る 蟆曙磯 EmbeddedChannel 伎 蠍壱 Jenkins Animal Sniffer: Build fails on violation before packaging Checkstyle: Build fails on violation before compilation
  • 17. 螳 蟇磯Μ Dynamic event routing Statistical Distributed Performance Analysis on Mesos Cluster Management and Monitoring Native Transport Scalable Community
  • 20. 襷 螻 螻旧 襭 伎 - http://netty.io/ 4.0 覲蟆 覈 - http://goo.gl/E2BJ2 貉るる 襭 觚襦蠏 覈 - http://goo.gl/2iMKP ろる襦 - http://stackoverflow.com/questions/tagged/netty ろ 襦 語 螻 https://twitter.com/netty_project ろ 蟲 伎 覈 https://groups.google.com/forum/#!forum/netty-ko