Skip to content

Instantly share code, notes, and snippets.

@maiha
Last active August 29, 2015 14:23
Show Gist options
  • Save maiha/907d874b7ec23da21c33 to your computer and use it in GitHub Desktop.
Save maiha/907d874b7ec23da21c33 to your computer and use it in GitHub Desktop.
ThreadPoolの調査

ThreadPoolの種類

Executors.newCachedThreadPool

  • 初期: 0個
  • 最大: Int.max個
  • タイムアウト: 60秒

AsyncHttpClient

並列数

  • MaxConnections: 並列数の上限(default: -1)
  • MaxConnectionsPerHost: 接続先単位(host, port)での上限 (default: -1)

ThreadPool

  • ConfigでExecutorServiceを渡すことができる
  • デフォルトは Executors.newCachedThreadPool()

実験

  • client: seven-http-out-adapter
  • server: http-endpoint-mock

デフォルト

  • 並列数: n times { ahc.kick }
  • バイト数: POSTのリクエストボディーのバイト数
  • スレッド数: Thread.activeCount
並列数 バイト数 スレッド数 qps
10 6B 33 1780
100 6B 42 5000
1000 6B 43 5500
10 10KB 34 1550
100 10KB 43 3800
1000 10KB 43 3400
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment