52
Jean-Frederic Clere Red Hat

Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

  • Upload
    others

  • View
    10

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Jean-Frederic Clere

Red Hat

Page 2: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Choosing Tomcat ConnectorsChoosing Tomcat ConnectorsInternal and performancesInternal and performances

Page 3: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

What I will cover

● Who I am.

● Connectors

● JIO, NIO, NIO2, APR

● AJP/HTTP

● Proxy AJP/HTTP

● Performances tests

● With ab and shell scripts.

● Questions?

Page 4: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Who I am

Jean-Frederic Clere works for Red Hat

Responsible of JWS product.

Years writing JAVA code and server software

Tomcat committer since 2001

Doing OpenSource since 1999

Cyclist/Runner etc

Lived 15 years in Spain (Barcelona)

Now in Neuchâtel (CH)

Page 5: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Remote location

Page 6: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Red Hat Office Neuchâtel

Page 7: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Protocol basic

●HTTP/1.1 request

●Responses:

●Normal

●Chunked

●Upgrade (to websocket for example)

●Proxy AJP/HTTP

Page 8: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Request HTTP/1.1

POST /comet/CometServletTest1 HTTP/1.1\n

User-Agent: testclient\n

Host: localhost\n

Transfer-Encoding: chunked\n

Page 9: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Response for example

Chunked:

HTTP/1.1 200 OK\n

Server: Apache-Coyote/1.1\n

Set-Cookie: JSESSIONID=obcoR30qlz7DMJfZmsVTt+Uv; Path=/comet\n

Transfer-Encoding: chunked\n

Date: Mon, 07 Nov 2011 22:09:33 GMT\n

Upgrade:

HTTP/1.1 101 Switching Protocols

Upgrade: websocket

Connection: Upgrade

Sec-WebSocket-Accept: HSmrc0sMlYUkAGmm5OPpG2HaGWk=

Sec-WebSocket-Protocol: chat

Page 10: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

What is a Connector?

● Tomcat's interface to the world

● Binds to a port

● Understands a protocol

● Dispatches requests

● protocol="org.apache.coyote.http11.Http11Protocol"

● protocol="org.apache.coyote.http11.Http11AprProtocol"

● protocol="org.apache.coyote.http11.Http11NioProtocol"

● protocol="org.apache.coyote.http11.Http11Nio2Protocol"

Page 11: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Tomcat Connectors

● Java Blocking I/O (BIO or sometimes JIO)

● Native / Apache Portable Runtime (APR)

● Java Non-blocking I/O (NIO)

● Java NIO.2

Technically, there are combinations of all of the above with HTTP and AJP protocols.

We’ll discuss those a bit later.

Page 12: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Types of I/O

● Polling

● Straightforward API: peek()

● CPU-inefficient

● Thread loops while waiting for data

● Blocking

● Straightforward API: read()

● CPU-efficient (blocks)

● Thread stalls while waiting for data

Page 13: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Types of I/O

● Non-blocking

● Complicated API (registration, event callbacks)

● Channel

● Buffer

● Selector

● CPU-efficient

● Thread not required to wait: execution continues

● When data is ready, the selector notifies observers

Page 14: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Common Connector Features

● Support for all protocols

● HTTP, AJP, Websocket

● Support for all dispatch methods

● Standard, Comet, Servlet 3.0 async

● Support for HTTPS (SSL/TLS)

● Acceptor thread(s) call accept() and hand-off

● Request processor thread pool

Page 15: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Blocking I/O Connector (1)

● All I/O operations are blocking in processor thread

● SSL handshake

● Read request line (e.g. GET, POST, etc.)

● Read request body

● Write response

● Read next request (HTTP keep-alive)

● Simple, stable, mature

Page 16: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Blocking I/O Connector (2)

● Single thread handles request straight-through, after accept

● Uses Java Secure Sockets Extension (JSSE) for SSL/TLS

Page 17: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Blocking I/O Connector (3)

● Request throughput limited by thread count

● Clients can waste threads

● Slow request line (mobile)

● Aborted keep-alive stalls thread (default=20sec!)

● Unfair: accepted connections get priority for keep-alive requests

● Gone from tomcat9

Page 18: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

NON-Blocking I/O Connector (1)

● Single thread handles request after request-line

● Poller thread(s) manage non-blocking Selector

● Read SSL handshake

● Read request line

● Wait for next keep-alive request

Page 19: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

NON-Blocking I/O Connector (2)

● Block poller simulates blocking

● Request header/body reads

● Response writes

● Processor thread sleeps during sim-blocking

● Uses JSSE for SSL/TLS

● Supports sendFile

Page 20: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

NON-Blocking I/O Connector (3)

● Allows huge number of parallel requests

● Not limited by request-processor threads

● Slow clients do not stall threads

● Aborted keep-alives die in the poller queue

● Simulated blocking adds overhead

Page 21: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Native Connector (APR) (1)

● Single thread handles request after accept()

● Poller thread(s) handle certain I/O reads

● Wait for next keep-alive request

● Some I/O operations block processor thread

● SSL handshake

● Read request line

● Read request body

● Write response

Page 22: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Native Connector (APR) (2)

● Uses OpenSSL for SSL/TLS

● Supports sendFile

Page 23: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Native Connector (APR) (3)

● Request throughput limited by thread count

● Slow clients can stall threads

● Aborted keep-alives die in the poller queue

● OpenSSL offers performance advantage

● Native code risks JVM instability

Page 24: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

“Non-blocking” I/O Connector NIO.2 (1)

● Single thread handles request after request-line

● The thread are handled via an AsynchronousChannelGroup and completion call backs

● Read SSL handshake

● Read request line and headers

● Wait for next keep-alive request

Page 25: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

“Non-blocking” I/O Connector NIO.2 (2)

● NIO2 implementation takes care of blocking using Future objects waiting for IO

● Request body reads

● Response writes

● Processor thread sleeps during blocking

● Uses JSSE for SSL/TLS

● It emulates sendFile (NIO1 transferTo doesn't work with NIO2)

Page 26: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

“Non-blocking” I/O Connector NIO.2 (3)

● Allows huge number of parallel requests

● Not limited by request-processor threads

● Slow clients do not stall threads

● High level of abstraction and blocking over async adds overhead

● NIO 2 provides blocking capabilities over its async IO. The tomcat code is simpler (good) but an overhead still exists.

Page 27: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Technical constraints

● Don’t try bother using non-blocking protocols with blocking connectors (BIO+Websocket = bad)

● AJP can be thought of as 100% keep-alive

● AJP doesn’t support HTTP upgrade

● Use of sendFile is highly recommended for any static-content (APR or NIO.1)

● Remember JIO/BIO will be gone in Tomcat9

Page 28: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Connector Performance

● Compare connector throughput against each other

● Only static content was compared, varying file sizes

● Run on fast machines, 10 Gbps local network

● Tests:

● Compare the connectors (tc8.0.14) with httpd (2.2.22) no SSL.

● Same with SSL also with a recent tc (8.0.21) and httpd (2.4.10) and using java (1.8.0_40).

● What about using a proxy: compare proxies.

Page 29: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Connector Throughput (c4)

4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin0

100000

200000

300000

400000

500000

600000

700000

coyote_apr

coyote_nio

coyote_nio_ns

coyote_apr_ns

coyote

httpd

coyote_apr

coyote_nio

coyote_nio_ns

coyote_apr_ns

coyote

httpd

Page 30: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Connector CPU Use (c4)

4KiB 16KiB 64KiB 128KiB 512KiB 2MiB 8MiB 32MiB0

5

10

15

20

25

30

35

40

45

50

coyote_apr

coyote_nio

coyote_nio_ns

coyote_apr_ns

coyote

httpd

coyote_apr

coyote_nio

coyote_nio_ns

coyote_apr_ns

coyote

httpd

Page 31: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Connector Throughput (c40)

4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin0

100000

200000

300000

400000

500000

600000

700000

coyote_apr

coyote_nio

coyote_nio_ns

coyote_apr_ns

coyote

httpd

coyote_apr

coyote_nio

coyote_nio_ns

coyote_apr_ns

coyote

httpd

Page 32: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Connector CPU Use (c40)

4KiB 16KiB 64KiB 128KiB 512KiB 2MiB 8MiB 32MiB0

10

20

30

40

50

60

70

80

coyote_apr

coyote_nio

coyote_nio_ns

coyote_apr_ns

coyote

httpd

coyote_apr

coyote_nio

coyote_nio_ns

coyote_apr_ns

coyote

httpd

Page 33: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Connector Throughput (c80)

4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin0

100000

200000

300000

400000

500000

600000

700000

coyote_apr

coyote_nio

coyote_nio_ns

coyote_apr_ns

coyote

httpd

coyote_apr

coyote_nio

coyote_nio_ns

coyote_apr_ns

coyote

httpd

Page 34: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Connector CPU Use (c80)

4KiB 16KiB 64KiB 128KiB 512KiB 2MiB 8MiB 32MiB0

10

20

30

40

50

60

70

80

coyote_apr

coyote_nio

coyote_nio_ns

coyote_apr_ns

coyote

httpd

coyote_apr

coyote_nio

coyote_nio_ns

coyote_apr_ns

coyote

httpd

Page 35: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Connector Performance

● Intermediate conclusion:

● Using sendfile helps a little. (but just emulated in NIO2!)

● So using JIO/BIO is probably an “old” idea.

Page 36: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

SSL Connector Throughput (c4)

4KiB.bin16KiB.bin

64KiB.bin128KiB.bin

512KiB.bin2MiB.bin

8MiB.bin32MiB.bin

0

50000

100000

150000

200000

250000

300000

350000

400000

450000

4KiB.bin16KiB.bin

64KiB.bin128KiB.bin

512KiB.bin2MiB.bin

8MiB.bin32MiB.bin

0

100000

200000

300000

400000

500000

600000

700000 coyote_apr_ns

coyote_nio2_ns

coyote_nio_ns

coyote

httpd_ssl

RC4-SHA and AES128-GCM-SHA256

Page 37: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

SSL Connector CPU Use (c4)

4KiB 16KiB 64KiB 128KiB 512KiB 2MiB 8MiB 32MiB0

10

20

30

40

50

60

4KiB 16KiB 64KiB 128KiB 512KiB 2MiB 8MiB 32MiB0

10

20

30

40

50

60

Page 38: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

SSL Connector Throughput (c40)

4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin0

100000

200000

300000

400000

500000

600000

700000

4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin

0

100000

200000

300000

400000

500000

600000

coyote_apr_ns

coyote_nio2_ns

coyote_nio_ns

coyote

httpd_ssl

Page 39: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

SSL Connector CPU Use (c40)

4KiB 16KiB 64KiB 128KiB 512KiB 2MiB 8MiB 32MiB0

20

40

60

80

100

120

4KiB 16KiB 64KiB 128KiB 512KiB 2MiB 8MiB 32MiB

0

20

40

60

80

100

120

`

Page 40: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Connector Performance● Intermediate conclusion:

● OpenSSL performs better that JSSE

● JIO/BIO and NIO(2) give similar results.

● Modern and safer cryto suites use more cpu.

Page 41: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Proxy using localhost

4KiB 16KiB 64KiB 128KiB 512KiB 2MiB 8MiB 32MiB0

10

20

30

40

50

60

70

80

proxy localhost cpu C4

httpd_ssl

ssl_mod_jk

ssl_proxy_ajp

ssl_proxy_http

4KiB.bin16KiB.bin

64KiB.bin128KiB.bin

512KiB.bin2MiB.bin

8MiB.bin32MiB.bin

0

50000

100000

150000

200000

250000

300000

350000

400000

450000

proxy localhost throughput C4

Page 42: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Proxy using localhost

4KiB.bin16KiB.bin

64KiB.bin128KiB.bin

512KiB.bin2MiB.bin

8MiB.bin32MiB.bin

0

100000

200000

300000

400000

500000

600000

proxy localhost throughtput C40

4KiB 16KiB 64KiB 128KiB 512KiB 2MiB 8MiB 32MiB0

20

40

60

80

100

120

proxy localhost cpu C40

httpd_ssl

ssl_mod_jk

ssl_proxy_ajp

ssl_proxy_http

Page 43: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Proxy using localhost

4KiB.bin16KiB.bin

64KiB.bin128KiB.bin

512KiB.bin2MiB.bin

8MiB.bin32MiB.bin

0

100000

200000

300000

400000

500000

600000

proxy localhost throughput C80

4KiB 16KiB 64KiB 128KiB 512KiB 2MiB 8MiB 32MiB0

20

40

60

80

100

120

proxy localhost C80

httpd_ssl

ssl_mod_jk

ssl_proxy_ajp

ssl_proxy_http

Page 44: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Proxy using localhost● Conclusions:

● Using httpd as proxy boost the performances

● mod_jk looks better that proxy AJP

● Technical constraints● application with SSL information better

use AJP

Page 45: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Proxy Throughput (c4)

4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin0

100000

200000

300000

400000

500000

600000

700000

httpd_ssl

httpd

mod_jk

proxy_ajp

proxy_http

ssl_mod_jk

ssl_proxy_ajp

ssl_proxy_http

Page 46: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

HTTPD CPU Use (c4)

4KiB 16KiB 64KiB 128KiB 512KiB 2MiB 8MiB 32MiB0

10

20

30

40

50

60

70

httpd_ssl

httpd

mod_jk

proxy_ajp

proxy_http

ssl_mod_jk

ssl_proxy_ajp

ssl_proxy_http

Page 47: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

SSL Proxy CPU Use (c4)

4KiB 16KiB 64KiB 128KiB 512KiB 2MiB 8MiB 32MiB0

10

20

30

40

50

60

70

httpd_ssl

ssl_mod_jk

ssl_proxy_ajp

ssl_proxy_http

Page 48: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Proxy Throughput (c40)

4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin0

100000

200000

300000

400000

500000

600000

mod_jk

proxy_ajp

proxy_http

ssl_mod_jk

ssl_proxy_ajp

ssl_proxy_http

Page 49: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Proxy CPU Use (c40)

4KiB 16KiB 64KiB 128KiB 512KiB 2MiB 8MiB 32MiB0

20

40

60

80

100

120

mod_jk

proxy_ajp

proxy_http

ssl_mod_jk

ssl_proxy_ajp

ssl_proxy_http

Page 50: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Connector/Proxy What use?

● Conclusion:

● If you need SSL better use a proxy

● Basically any “httpd proxy” will do the work.

● Use mod_jk if you need a Swiss knife configuration.

● Use http otherwise

● WebSocket

● Use httpd-2.4.x for mod_proxy_wstunnel.

Page 51: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Questions? Thank you!

[email protected]

[email protected]

● Repo with the scripts for the tests:

● https://github.com/jfclere/AC2014scripts

Page 52: Jean-Frederic Clere Red Hat · SSL Connector Throughput (c4) 4KiB.bin 16KiB.bin 64KiB.bin 128KiB.bin 512KiB.bin 2MiB.bin 8MiB.bin 32MiB.bin 0 50000 100000 150000 200000 250000 300000

Jean-Frederic Clere@[email protected]