2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Dockerコンテナ内のJVMをVisualVMでプロファイリングするための設定

Last updated at Posted at 2018-06-04

コンテナのJMX接続用portを開ける

docker-compose.ymlの一部

ports:
  - '9010:9010'

JVM起動オプションを指定する

重要なのはDjava, Dcom.*のオプション

java -jar  -Djava.rmi.server.hostname=0.0.0.0 -Dcom.sun.management.jmxremote.rmi.port=9010 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9010 target/scala-2.12/api-assembly-1.0.jar &

VisualVMのUIから接続情報を追加

Add JMX Connectionで追加
localhost:9010

これでCPUとかThreadとか確認できるようになる

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?