SlideShare a Scribd company logo
1 of 32
Download to read offline
The 25th Annual European
Smalltalk User Group ConferenceSeptember 4, 2017
HTTP/2 in Cincom Smalltalk ™
SiouX Server
Speaker: Jerry Kott, OSCP
Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved.
HTTP:A Bit of History
• 1965:‘hypertext’ coined byTed Nelson for Xanadu project
• 1989: original HTTP and HTML at CERN (Tim Berners-Lee)
• 1991: HTTPV0.9 - first documented version.

https://www.w3.org/Protocols/HTTP/AsImplemented.html
• 1996: HTTP/1.0 - first version as an RFC 1945

https://tools.ietf.org/html/rfc1945

“This memo provides information for the Internet community. This memo does not
specify an Internet standard of any kind…”
• 1997: HTTP/1.1 standard released as RFC 2068
@cincomsmalltalk #ESUG17
Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved.
HTTP:A Bit of History
• 1999: HTTP/1.1 updates and improvements as RFC 2616
…15 years…
• 2014: HTTP/1.1 split into six different specification parts,
obsoletes RFC 2616
• 2015: HTTP/2 published as RFC 7540

https://tools.ietf.org/html/rfc7540
@cincomsmalltalk #ESUG17
Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved.
HTTP/2 Key Points
• Semantically compatible with HTTP/1.1
• Clients and servers negotiate to select version 1.1 or 2
• Fairly rapid adoption rate
• Improved page loading performance, e.g.:
• HTTP header compression
• Server push
• Request pipelining
• Stream multiplexing over a singleTCP connection
• Web browsers support HTTP/2 only overTLS
@cincomsmalltalk #ESUG17
Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved.
HTTP/2 Adoption Rate
@cincomsmalltalk #ESUG17
HTTP/2 is used by 16.4% of the top 10 million websites.
https://w3techs.com/technologies/details/ce-http2/all/all
Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved.
Components of HTTP/2
• Stream
• Message: request or response
• Frame: smallest part of HTTP/2 traffic
• Frame types:
• Control (e.g.: Priority, Header, 

Continuation, …)
• Data
• Frames may be interleaved
@cincomsmalltalk #ESUG17
Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved.
HTTP/2 in SiouX Server
• Preview was included in Cincom®VisualWorks® 8.2
• Full protocol implementation coming up inVisualWorks 8.3
• Supports both open and secure version.
• Added requirements on Cincom Smalltalk security frameworks
• HTTP/2 overTLS required by web browsers
• TLS cipher suites with AEAD ciphers
• Stream multiplexing, prioritization, dependencies
• Challenging but also kind of fun
@cincomsmalltalk #ESUG17
Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved.
Header Compression
@cincomsmalltalk #ESUG17
HTTP/1.1
POST /http2_test HTTP/1.1

Host: www.examples.org

Content-Type: text/plain
Content-Length: 10
98 bytes
HTTP/2
:method POST

:scheme http

:path /http_test

:authority www.example.org

content-type text/plain

content-length 10
HTTP/2 encoded bytes:

:method POST -> #[131]

:scheme http -> #[134]

:path /http2_test -> #[68 136 98 116 166 177 68 146 161 63]

:authority www.example.org -> #[65 140 241 227 194 229 242 58 107 160 171 158 201 191]

content-type text/plain -> #[95 135 73 124 165 138 232 25 170] 

content-length 10 -> #[92 2 49 48]
39 bytes
Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved.
Multiplexing
• Multiple interleaving requests over a singleTCP connection.
• Traffic is broken down into frames representing pieces of virtual HTTP
streams
• A stream represents an HTTP request/response pair
@cincomsmalltalk #ESUG17
Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved.
Multiplexing
• HTTP2ServerMultiplexer in SiouX-Http2 parcel
• HTTP/1.1 socket accept:
-> HttpConnection ~ Process ~ RequestContext
• ManyTCP connections, one process per connection
• HTTP/2 socket accept:
-> HttpConnection ~ Process ~ (upgrade) HTTP2ServerMultiplexer
header frame read from socket:
-> id -> HTTP2ServerStream ~ Process ~ RequestContext
• FewTCP connections, several processes per connection
@cincomsmalltalk #ESUG17
Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved.
Stream Prioritization
• Weight: a stream’s weight determines its processing
priority relative to other streams
• Dependency: a stream may depend on another stream
being processed first
• Web browser support for prioritization is evolving
(Chrome vs. Firefox vs. IE …)
@cincomsmalltalk #ESUG17
Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved.
Stream Prioritization
@cincomsmalltalk #ESUG17
Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved.
Flow Control
• Credit-based system
• A peer advertises resource availability
• Clients and servers must keep track of the amount of resources sent to
the peers
• Highly customizable settings allow the control of memory allocation for
read & write buffers
INITIAL_WINDOW_SIZE
MAX_FRAME_SIZE
…
• Some settings may be negotiated ‘on the fly’ as resource availability
changes
@cincomsmalltalk #ESUG17
Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved.
Server Push
• Replaces inlined resources
• Server pushes them to the client to initiate caching without a round-trip
request/response.
• Consider carefully when to use it (not always beneficial)
@cincomsmalltalk #ESUG17
Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved.
Server Push
@cincomsmalltalk #ESUG17
Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved.
SiouX HTTP/2 Code Samples
server := Server id: 'MyServer'.
listener := server listenOn: 8000 for: SiouX.HttpsConnection.
server
addSecureListener: listener
certificateFile: 'certificates.pem'
privateKeyFile: 'privatekey-rsa.key'.
listener useHTTP2Protocol.
server start.
@cincomsmalltalk #ESUG17
Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved.
Settings Control
“Configure TLS context to ensure HTTP/2 supported cipher suites and ALPN extension
are present.
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 is a mandatory cipher suite.”
listener tlsContext
suites: (TLSCipherSuite suites: #(tls12 (#ecdhe #(#sha256 #sha384))));
addExtension: Xtreams.TLSAppLayerProtocolNegotiation defaultH2.
version := Protocols.HTTPv20 new.
listener protocolVersions: (Array with: version).
@cincomsmalltalk #ESUG17
Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved.
Settings Control
“Default settings may be changed according to application needs, e.g.:”
version settings
maxConcurrentStreams: 200;
maxFrameSize: 1024 * 32;
…
outputWindowSize: 1024 * 64; “not part of spec, an internal optimization
mechanism”
…
@cincomsmalltalk #ESUG17
Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved.
Configure Server Push
“Server push must be enabled explicitly”
version settings enablePush.
“An HTTP response must receive #preloadLink for each resource to be pushed.
Consider which resources to push carefully. Typically useful only on a first page
load.”
aResponse
contentType: 'text/html';
preloadLink: self path, '/style.css';
preloadLink: self path, '/script.js';
…
contents: '<HTML><BODY>some html</BODY></HTML>’.
@cincomsmalltalk #ESUG17
Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved.
How About AppeX?
• All SiouX functionality inherent in AppeX
• Potential performance benefits:
• Single Page Application loads HTML only once
• HTTP/2 server push can download CSS and JS into the client as
HTML loads
• After initial load, only data travels between the client and the server
• Perceived performance improvement may be relatively small on the
client BUT
• Much less demand on the server and the network
@cincomsmalltalk #ESUG17
Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved.
Demo: HTTP/2 Compared to HTTP/1.1
• Inspired by akamai http2 demo:
https://http2.akamai.com/demo
• The same ‘application’ is shown in two <iframe> elements
• 400 tiles make up the final image.
• HTTP/1.1: 400 requests on multiple connections
• HTTP/2: 400 requests on a single multiplexed connection
• The only difference is in SiouX listeners’ configuration
@cincomsmalltalk #ESUG17
Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved.
Demo: HTTP/2 Compared to HTTP/1.1
@cincomsmalltalk #ESUG17
Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved.
Demo: HTTP/2 Compared to HTTP/1.1
@cincomsmalltalk #ESUG17
Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved.
Demo: HTTP/2 Compared to HTTP/1.1
• In terms of bandwidth efficiency (network time):
• HTTP/1.1: 6 x 9.95 ~ 60 seconds
• HTTP/2: 1 x 1.5 ~ 1.5 seconds
• HTTP/2 is a clear winner
@cincomsmalltalk #ESUG17
Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved.
(Some of) HTTP/2 Best Practices
• It’s all about performance
• Don’t concatenate files
• an HTTP/1.1 optimization technique to reduce number of requests.
• It can lead to expensive cache invalidation in the client, actually reducing
performance
• Don’t inline assets
• special case of file concatenation
• use server push instead, if / when appropriate
• Minimize the size of HTTP requests / responses
• Send the minimum amount of data to make your application work
• Use AppeX !
@cincomsmalltalk #ESUG17
Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved.
Issues
• Increased memory demands on the server because of multiplexing
- any server, not SiouX specifically
• Added complexity of secure certificate management andTLS
configuration
• Using server proxies becomes tricky
• e.g.: Apache has to be built from source, explicitly enabling HTTP/2
• The mod_proxy_http2 module is experimental
• Limited debugging with network sniffing tools - traffic is encrypted
@cincomsmalltalk #ESUG17
Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved.
Summary and Conclusion
• HTTP/2 is semantically compatible with HTTP/1.1
• But vastly different in specs and implementation
• Impressive performance gains
• Many optimization options
• Security built in because of browser vendors constraints
• A simple API for SiouX server HTTP/2 configuration
• Continuing work on enhancements and performance
optimization
@cincomsmalltalk #ESUG17
Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved.
Additional Resources
• https://hpbn.co/http2/
• http://httpwg.org/specs/rfc7540.html
• Read this document before using server push:

https://docs.google.com/document/d/
1K0NykTXBbbbTlv60t5MyJvXjqKGsCVNYHyLEXIxYMv0/
edit#heading=h.ke8t5vjw3jh4
• http://www.cincomsmalltalk.com/main/products/demos/http2/
@cincomsmalltalk #ESUG17
Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved.
Contact Us
Suzanne Fortman 

Director of Smalltalk Global Operations

sfortman@cincom.com

@SuzCST (Twitter)
Arden Thomas 

Product Manager

athomas@cincom.com

@ArdenTCST (Twitter)
Jerry Kott

Senior Software Engineer

jkott@cincom.com
@cincomsmalltalk #ESUG17
ThankYou!
Any questions?
Cincom, the Quadrant Logo, Cincom Smalltalk, Cincom ObjectStudio and Cincom VisualWorks
are trademarks or registered trademarks of Cincom Systems, Inc.
©2017 Cincom Systems, Inc.
All Rights Reserved

More Related Content

More from ESUG

Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
ESUG
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
ESUG
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
ESUG
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
ESUG
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
ESUG
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
ESUG
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
ESUG
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
ESUG
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
ESUG
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
ESUG
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
ESUG
 
gt4atproto, A Programmable Environment for Social Media
gt4atproto, A Programmable Environment for Social Mediagt4atproto, A Programmable Environment for Social Media
gt4atproto, A Programmable Environment for Social Media
ESUG
 

More from ESUG (20)

Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector Tuning
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing Score
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
 
BioSmalltalk
BioSmalltalkBioSmalltalk
BioSmalltalk
 
gt4atproto, A Programmable Environment for Social Media
gt4atproto, A Programmable Environment for Social Mediagt4atproto, A Programmable Environment for Social Media
gt4atproto, A Programmable Environment for Social Media
 
Roassal3 update
Roassal3 updateRoassal3 update
Roassal3 update
 
VASER Control: Smart Energy
VASER Control: Smart EnergyVASER Control: Smart Energy
VASER Control: Smart Energy
 

Recently uploaded

Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
chiefasafspells
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 

Recently uploaded (20)

MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
WSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AI
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 

HTTP/2 in the Cincom Smalltalk™ SiouX Server

  • 1. The 25th Annual European Smalltalk User Group ConferenceSeptember 4, 2017 HTTP/2 in Cincom Smalltalk ™ SiouX Server Speaker: Jerry Kott, OSCP
  • 2.
  • 3. Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved. HTTP:A Bit of History • 1965:‘hypertext’ coined byTed Nelson for Xanadu project • 1989: original HTTP and HTML at CERN (Tim Berners-Lee) • 1991: HTTPV0.9 - first documented version.
 https://www.w3.org/Protocols/HTTP/AsImplemented.html • 1996: HTTP/1.0 - first version as an RFC 1945
 https://tools.ietf.org/html/rfc1945
 “This memo provides information for the Internet community. This memo does not specify an Internet standard of any kind…” • 1997: HTTP/1.1 standard released as RFC 2068 @cincomsmalltalk #ESUG17
  • 4. Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved. HTTP:A Bit of History • 1999: HTTP/1.1 updates and improvements as RFC 2616 …15 years… • 2014: HTTP/1.1 split into six different specification parts, obsoletes RFC 2616 • 2015: HTTP/2 published as RFC 7540
 https://tools.ietf.org/html/rfc7540 @cincomsmalltalk #ESUG17
  • 5. Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved. HTTP/2 Key Points • Semantically compatible with HTTP/1.1 • Clients and servers negotiate to select version 1.1 or 2 • Fairly rapid adoption rate • Improved page loading performance, e.g.: • HTTP header compression • Server push • Request pipelining • Stream multiplexing over a singleTCP connection • Web browsers support HTTP/2 only overTLS @cincomsmalltalk #ESUG17
  • 6. Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved. HTTP/2 Adoption Rate @cincomsmalltalk #ESUG17 HTTP/2 is used by 16.4% of the top 10 million websites. https://w3techs.com/technologies/details/ce-http2/all/all
  • 7. Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved. Components of HTTP/2 • Stream • Message: request or response • Frame: smallest part of HTTP/2 traffic • Frame types: • Control (e.g.: Priority, Header, 
 Continuation, …) • Data • Frames may be interleaved @cincomsmalltalk #ESUG17
  • 8. Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved. HTTP/2 in SiouX Server • Preview was included in Cincom®VisualWorks® 8.2 • Full protocol implementation coming up inVisualWorks 8.3 • Supports both open and secure version. • Added requirements on Cincom Smalltalk security frameworks • HTTP/2 overTLS required by web browsers • TLS cipher suites with AEAD ciphers • Stream multiplexing, prioritization, dependencies • Challenging but also kind of fun @cincomsmalltalk #ESUG17
  • 9. Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved. Header Compression @cincomsmalltalk #ESUG17 HTTP/1.1 POST /http2_test HTTP/1.1
 Host: www.examples.org
 Content-Type: text/plain Content-Length: 10 98 bytes HTTP/2 :method POST
 :scheme http
 :path /http_test
 :authority www.example.org
 content-type text/plain
 content-length 10 HTTP/2 encoded bytes:
 :method POST -> #[131]
 :scheme http -> #[134]
 :path /http2_test -> #[68 136 98 116 166 177 68 146 161 63]
 :authority www.example.org -> #[65 140 241 227 194 229 242 58 107 160 171 158 201 191]
 content-type text/plain -> #[95 135 73 124 165 138 232 25 170] 
 content-length 10 -> #[92 2 49 48] 39 bytes
  • 10. Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved. Multiplexing • Multiple interleaving requests over a singleTCP connection. • Traffic is broken down into frames representing pieces of virtual HTTP streams • A stream represents an HTTP request/response pair @cincomsmalltalk #ESUG17
  • 11. Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved. Multiplexing • HTTP2ServerMultiplexer in SiouX-Http2 parcel • HTTP/1.1 socket accept: -> HttpConnection ~ Process ~ RequestContext • ManyTCP connections, one process per connection • HTTP/2 socket accept: -> HttpConnection ~ Process ~ (upgrade) HTTP2ServerMultiplexer header frame read from socket: -> id -> HTTP2ServerStream ~ Process ~ RequestContext • FewTCP connections, several processes per connection @cincomsmalltalk #ESUG17
  • 12. Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved. Stream Prioritization • Weight: a stream’s weight determines its processing priority relative to other streams • Dependency: a stream may depend on another stream being processed first • Web browser support for prioritization is evolving (Chrome vs. Firefox vs. IE …) @cincomsmalltalk #ESUG17
  • 13. Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved. Stream Prioritization @cincomsmalltalk #ESUG17
  • 14. Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved. Flow Control • Credit-based system • A peer advertises resource availability • Clients and servers must keep track of the amount of resources sent to the peers • Highly customizable settings allow the control of memory allocation for read & write buffers INITIAL_WINDOW_SIZE MAX_FRAME_SIZE … • Some settings may be negotiated ‘on the fly’ as resource availability changes @cincomsmalltalk #ESUG17
  • 15. Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved. Server Push • Replaces inlined resources • Server pushes them to the client to initiate caching without a round-trip request/response. • Consider carefully when to use it (not always beneficial) @cincomsmalltalk #ESUG17
  • 16. Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved. Server Push @cincomsmalltalk #ESUG17
  • 17. Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved. SiouX HTTP/2 Code Samples server := Server id: 'MyServer'. listener := server listenOn: 8000 for: SiouX.HttpsConnection. server addSecureListener: listener certificateFile: 'certificates.pem' privateKeyFile: 'privatekey-rsa.key'. listener useHTTP2Protocol. server start. @cincomsmalltalk #ESUG17
  • 18. Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved. Settings Control “Configure TLS context to ensure HTTP/2 supported cipher suites and ALPN extension are present. TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 is a mandatory cipher suite.” listener tlsContext suites: (TLSCipherSuite suites: #(tls12 (#ecdhe #(#sha256 #sha384)))); addExtension: Xtreams.TLSAppLayerProtocolNegotiation defaultH2. version := Protocols.HTTPv20 new. listener protocolVersions: (Array with: version). @cincomsmalltalk #ESUG17
  • 19. Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved. Settings Control “Default settings may be changed according to application needs, e.g.:” version settings maxConcurrentStreams: 200; maxFrameSize: 1024 * 32; … outputWindowSize: 1024 * 64; “not part of spec, an internal optimization mechanism” … @cincomsmalltalk #ESUG17
  • 20. Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved. Configure Server Push “Server push must be enabled explicitly” version settings enablePush. “An HTTP response must receive #preloadLink for each resource to be pushed. Consider which resources to push carefully. Typically useful only on a first page load.” aResponse contentType: 'text/html'; preloadLink: self path, '/style.css'; preloadLink: self path, '/script.js'; … contents: '<HTML><BODY>some html</BODY></HTML>’. @cincomsmalltalk #ESUG17
  • 21. Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved. How About AppeX? • All SiouX functionality inherent in AppeX • Potential performance benefits: • Single Page Application loads HTML only once • HTTP/2 server push can download CSS and JS into the client as HTML loads • After initial load, only data travels between the client and the server • Perceived performance improvement may be relatively small on the client BUT • Much less demand on the server and the network @cincomsmalltalk #ESUG17
  • 22. Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved. Demo: HTTP/2 Compared to HTTP/1.1 • Inspired by akamai http2 demo: https://http2.akamai.com/demo • The same ‘application’ is shown in two <iframe> elements • 400 tiles make up the final image. • HTTP/1.1: 400 requests on multiple connections • HTTP/2: 400 requests on a single multiplexed connection • The only difference is in SiouX listeners’ configuration @cincomsmalltalk #ESUG17
  • 23. Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved. Demo: HTTP/2 Compared to HTTP/1.1 @cincomsmalltalk #ESUG17
  • 24. Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved. Demo: HTTP/2 Compared to HTTP/1.1 @cincomsmalltalk #ESUG17
  • 25. Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved. Demo: HTTP/2 Compared to HTTP/1.1 • In terms of bandwidth efficiency (network time): • HTTP/1.1: 6 x 9.95 ~ 60 seconds • HTTP/2: 1 x 1.5 ~ 1.5 seconds • HTTP/2 is a clear winner @cincomsmalltalk #ESUG17
  • 26. Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved. (Some of) HTTP/2 Best Practices • It’s all about performance • Don’t concatenate files • an HTTP/1.1 optimization technique to reduce number of requests. • It can lead to expensive cache invalidation in the client, actually reducing performance • Don’t inline assets • special case of file concatenation • use server push instead, if / when appropriate • Minimize the size of HTTP requests / responses • Send the minimum amount of data to make your application work • Use AppeX ! @cincomsmalltalk #ESUG17
  • 27. Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved. Issues • Increased memory demands on the server because of multiplexing - any server, not SiouX specifically • Added complexity of secure certificate management andTLS configuration • Using server proxies becomes tricky • e.g.: Apache has to be built from source, explicitly enabling HTTP/2 • The mod_proxy_http2 module is experimental • Limited debugging with network sniffing tools - traffic is encrypted @cincomsmalltalk #ESUG17
  • 28. Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved. Summary and Conclusion • HTTP/2 is semantically compatible with HTTP/1.1 • But vastly different in specs and implementation • Impressive performance gains • Many optimization options • Security built in because of browser vendors constraints • A simple API for SiouX server HTTP/2 configuration • Continuing work on enhancements and performance optimization @cincomsmalltalk #ESUG17
  • 29. Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved. Additional Resources • https://hpbn.co/http2/ • http://httpwg.org/specs/rfc7540.html • Read this document before using server push:
 https://docs.google.com/document/d/ 1K0NykTXBbbbTlv60t5MyJvXjqKGsCVNYHyLEXIxYMv0/ edit#heading=h.ke8t5vjw3jh4 • http://www.cincomsmalltalk.com/main/products/demos/http2/ @cincomsmalltalk #ESUG17
  • 30. Proprietary & ConfidentialCOMPANY CONFIDENTIAL | ©2017 Cincom Systems, Inc.All Rights Reserved. Contact Us Suzanne Fortman 
 Director of Smalltalk Global Operations
 sfortman@cincom.com
 @SuzCST (Twitter) Arden Thomas 
 Product Manager
 athomas@cincom.com
 @ArdenTCST (Twitter) Jerry Kott
 Senior Software Engineer
 jkott@cincom.com @cincomsmalltalk #ESUG17
  • 32. Cincom, the Quadrant Logo, Cincom Smalltalk, Cincom ObjectStudio and Cincom VisualWorks are trademarks or registered trademarks of Cincom Systems, Inc. ©2017 Cincom Systems, Inc. All Rights Reserved