On a Ubuntu desktop install JProfiler GUI from here.
Download script and run it.
http://download-keycdn.ej-technologies.com/jprofiler/jprofiler_linux_9_2.sh
Provide key if you have , else use evaluation.
Now on the Ubuntu server where docker container is running, you need to stop containers first and modify Dockerfile to add jprofiler
wget http://download-keycdn.ej-technologies.com/jprofiler/jprofiler_linux_9_2.tar.gz && \
tar -xzf jprofiler_linux_9_1_1.tar.gz -C /usr/local
Also expose the port 8849 from container to host so that you can connect from your desktop.
If you use docker-compose.yml, map the port in the service , which you want to connect.
For example
version: "2"
services:
some_service:
build: .
ports:
- "8849:8849"
depends_on:
- "db"
entrypoint:
This will download jprofiler 9.2 and unpack it in /usr/local when you run docker container next time and map the port on host server.
Once docker container is up , you can ssh to it
docker exec -it /bin/bash
And just start the jprofiler using following command.
/usr/local/jprofiler9/bin/jpenable
You will be asked for 2 options , 1) GUI connect 2. Using config.xml
Use option 1 GUI connect
Now from Desktop you can open JProfiler UI and connect to server-ip:8849
You can profile the JVM you want.
Download script and run it.
http://download-keycdn.ej-technologies.com/jprofiler/jprofiler_linux_9_2.sh
Provide key if you have , else use evaluation.
Now on the Ubuntu server where docker container is running, you need to stop containers first and modify Dockerfile to add jprofiler
wget http://download-keycdn.ej-technologies.com/jprofiler/jprofiler_linux_9_2.tar.gz && \
tar -xzf jprofiler_linux_9_1_1.tar.gz -C /usr/local
Also expose the port 8849 from container to host so that you can connect from your desktop.
If you use docker-compose.yml, map the port in the service , which you want to connect.
For example
version: "2"
services:
some_service:
build: .
ports:
- "8849:8849"
depends_on:
- "db"
entrypoint:
This will download jprofiler 9.2 and unpack it in /usr/local when you run docker container next time and map the port on host server.
Once docker container is up , you can ssh to it
docker exec -it
And just start the jprofiler using following command.
/usr/local/jprofiler9/bin/jpenable
You will be asked for 2 options , 1) GUI connect 2. Using config.xml
Use option 1 GUI connect
Now from Desktop you can open JProfiler UI and connect to server-ip:8849
You can profile the JVM you want.
Nice post.Keep updating Devops online course
ReplyDeleteThis JVM remote profiling guide is very practical for performance engineers! The explanation of profiling tools and techniques for remote JVM instances is very clear. I appreciated the coverage of JVM monitoring and optimization. For developers looking to expand into AI and performance optimization, there's a comprehensive artificial intelligence course in Electronic City Bangalore that builds on foundational programming skills. Thanks for sharing this helpful Java performance guide!
ReplyDelete