A lot of our applications are developed using Java or Kotlin. Adjust the Readiness Probe, if there is one defined for the application, or disable it altogether if it causes Pod restarts before being able to connect JProfiler to the JVM.At OLX Autos, we run a lot of JVM workloads in our Kubernetes cluster. Start JProfiler up locally and point it to 127.0.0.1, port 8849.Īt this point JProfiler should connect to the JVM in the Pod and the application startup should continue.If it is not, specify a different port and use it in the step below. The local port 8849 (the number to the left of “:”) must be available. Set up port forwarding from the local host to the JProfiler agent’s port in the Kubernetes Pod (8849):.Next, connect local JProfiler to the JVM that is in a Kubernetes Pod: If the JProfiler GUI is started first then it has to be configured to wait for the application to be started.Without the “nowait” argument, the application won’t start until JProfiler GUI connects to it.For example, by configuring spec:Īnother way is to use “replicas: 0”, deploy the application, and at a later point scale it to 1 when ready to profile the application. Running the Applicationĭeploy the application with the new deployment configuration and using a single replica. The reason is that with this configuration the profiling agent does not receive its profiling settings as command line parameters or from a config file but from the JProfiler GUI. That will block the JVM at startup and wait for a JProfiler GUI to connect. Notice that there isn’t a “nowait” argument. agentpath:/jprofiler/bin/linux-圆4/libjprofilerti.so=port=8849Ĭhange the path accordingly if using an image other than one built using the Dockerfile above. “Where” to add it depends on how the application is started and JVM arguments passed in:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |