KillBill docker container JVM profiling.

179 views
Skip to first unread message

oleksii....@globallogic.com

unread,
Jun 8, 2018, 1:37:23 PM6/8/18
to Kill Bill users mailing-list
In order to use JvisualVM for KillBill profiling I need to setup JVM options for KillBIll instance (as per https://stackoverflow.com/questions/35108868/how-do-i-attach-visualvm-to-a-simple-java-process-running-in-a-docker-container):

-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=9010
-Dcom.sun.management.jmxremote.local.only=false
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false

1. Is there some procedure on how to setup these parameters to KillBill Docker image?

2. Or maybe there is a way to let JvisualVM connect to KillBill JVM running inside Docker container?

stephane brossier

unread,
Jun 8, 2018, 5:41:17 PM6/8/18
to oleksii....@globallogic.com, Kill Bill users mailing-list
Have you tried exporting your docker port 12345, and connecting to it -- docker run -tid  -p 12345:12345 ...  ?



--
You received this message because you are subscribed to the Google Groups "Kill Bill users mailing-list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to killbilling-users+unsubscribe@googlegroups.com.
To post to this group, send email to killbilling-users@googlegroups.com.
Visit this group at https://groups.google.com/group/killbilling-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/killbilling-users/d854d556-09cf-4c8a-95c3-05f06a73b095%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

oleksii....@globallogic.com

unread,
Jun 10, 2018, 2:57:49 AM6/10/18
to Kill Bill users mailing-list
I did this on the yaml:


killbill:
image: killbill/killbill:0.18.19
container_name: killbill
ports:
- 8080:8080
- 12345:12345
- 8000:8000

FYI. By default port 8000 used for com.sun.management.jmxremote.port in KillBill kpm.yaml

On Saturday, June 9, 2018 at 12:41:17 AM UTC+3, stephane brossier wrote:
> Have you tried exporting your docker port 12345, and connecting to it -- docker run -tid  -p 12345:12345 ...  ?
>
>
>
> On Fri, Jun 8, 2018 at 10:37 AM, oleksii.prosianko via Kill Bill users mailing-list <killbill...@googlegroups.com> wrote:
> In order to use JvisualVM for KillBill profiling I need to setup JVM options for KillBIll instance (as per https://stackoverflow.com/questions/35108868/how-do-i-attach-visualvm-to-a-simple-java-process-running-in-a-docker-container):
>
>
>
> -Dcom.sun.management.jmxremote
>
> -Dcom.sun.management.jmxremote.port=9010
>
> -Dcom.sun.management.jmxremote.local.only=false
>
> -Dcom.sun.management.jmxremote.authenticate=false
>
> -Dcom.sun.management.jmxremote.ssl=false
>
>
>
> 1. Is there some procedure on how to setup these parameters to KillBill Docker image?
>
>
>
> 2. Or maybe there is a way to let JvisualVM connect to KillBill JVM running inside Docker container?
>
>
>
> --
>
> You received this message because you are subscribed to the Google Groups "Kill Bill users mailing-list" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an email to killbilling-us...@googlegroups.com.
>
> To post to this group, send email to killbill...@googlegroups.com.

oleksii....@globallogic.com

unread,
Jun 10, 2018, 4:38:44 AM6/10/18
to Kill Bill users mailing-list
On Saturday, June 9, 2018 at 12:41:17 AM UTC+3, stephane brossier wrote:
> Have you tried exporting your docker port 12345, and connecting to it -- docker run -tid  -p 12345:12345 ...  ?
>
>
>
> On Fri, Jun 8, 2018 at 10:37 AM, oleksii.prosianko via Kill Bill users mailing-list <killbill...@googlegroups.com> wrote:
> In order to use JvisualVM for KillBill profiling I need to setup JVM options for KillBIll instance (as per https://stackoverflow.com/questions/35108868/how-do-i-attach-visualvm-to-a-simple-java-process-running-in-a-docker-container):
>
>
>
> -Dcom.sun.management.jmxremote
>
> -Dcom.sun.management.jmxremote.port=9010
>
> -Dcom.sun.management.jmxremote.local.only=false
>
> -Dcom.sun.management.jmxremote.authenticate=false
>
> -Dcom.sun.management.jmxremote.ssl=false
>
>
>
> 1. Is there some procedure on how to setup these parameters to KillBill Docker image?
>
>
>
> 2. Or maybe there is a way to let JvisualVM connect to KillBill JVM running inside Docker container?
>
>
>
> --
>
> You received this message because you are subscribed to the Google Groups "Kill Bill users mailing-list" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an email to killbilling-us...@googlegroups.com.
>
> To post to this group, send email to killbill...@googlegroups.com.
Also I had some workaround. May be this is a clue.
I need to setup remote host for jvisualvm tool. There is a property in kpm.yaml:

java.rmi.server.hostname: "$(hostname).$(hostname -d)"

What value is this property evaluates to?

stephane brossier

unread,
Jun 11, 2018, 1:53:40 PM6/11/18
to oleksii....@globallogic.com, Kill Bill users mailing-list
I misread your previous question -- my answer was about remote debugging the application, and not connecting to the application
using visualVM. The properties you are referring to below, are indeed the right one. Now, we don't offer a way to customize such properties,
unless you provide an overlay of the generated kpm.yml, in which case you can specify whatever you want.

Now just to be clear, what is the issue? Is it that it is not working -- you can't connect ? or is it that you don't like the default -- e.g the port number, ...


To unsubscribe from this group and stop receiving emails from it, send an email to killbilling-users+unsubscribe@googlegroups.com.
To post to this group, send email to killbilling-users@googlegroups.com.

oleksii....@globallogic.com

unread,
Jun 12, 2018, 5:10:13 AM6/12/18
to Kill Bill users mailing-list
1. "what is the issue?"
I cannot connect to killbill with jvisualvm for JVM profiling

2. "Is it that it is not working -- you can't connect ?"
I cannot connect with jvisualvm:

"Cannot connect to 172.18.0.3:8000 using
service:jmx:rmi:///jndi/rmi://172.18.0.3:8000/jmxrmi"

Where 172.18.0.3 is an IP address of killbill docker container.

Default options in kmp.yml are:

properties:
com.sun.management.jmxremote: true
com.sun.management.jmxremote.authenticate: false
com.sun.management.jmxremote.port: 8000
com.sun.management.jmxremote.ssl: false
java.rmi.server.hostname: "$(hostname).$(hostname -d)"

I evaluated:
echo "$(hostname).$(hostname -d)"
25fc9a6a2e5f.

This does not looks like a hostname or IP address.

3." or is it that you don't like the default -- e.g the port number, ..."
I am ok with port number. The problem was about:

java.rmi.server.hostname: "$(hostname).$(hostname -d)"

So I provided an overlay:

killbill:
properties:
java.rmi.server.hostname: 172.18.0.3

Try to connect by this IP but jvisualvm failed to do this (see error above)

stephane brossier

unread,
Jun 12, 2018, 11:34:51 AM6/12/18
to oleksii....@globallogic.com, Kill Bill users mailing-list
I don't know if i can provide a great answer but in terms of troubleshooting, that 's what i would do:

1. Do the JMX server runs on port 8000 ? 
    -> From inside the container, can you reach that port -- e.g telnet 127.0.0.1 8000 ? 

2. Is the port 8000 correctly open on your container - e.g have you specified the the `-p 8000:8000` option when running your container?
   -> If the answer to the previous question is 'yes' can you telnet from the outside to that port

Basically, 1. is this a docker issue or 2. is this that jxm server does not run or 3. you try to connect using wrong ip?

Stéphane



To unsubscribe from this group and stop receiving emails from it, send an email to killbilling-users+unsubscribe@googlegroups.com.
To post to this group, send email to killbilling-users@googlegroups.com.

oleksii....@globallogic.com

unread,
Jun 15, 2018, 8:56:17 AM6/15/18
to Kill Bill users mailing-list
1. Do the JMX server runs on port 8000 ?
-> From inside the container, can you reach that port -- e.g telnet 127.0.0.1 8000 ?

tomcat7@b97eeed91bba:/var/lib/tomcat7$ telnet 127.0.0.1 8000
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused

2. Is the port 8000 correctly open on your container - e.g have you specified the the `-p 8000:8000` option when running your container?

Yes I have:
sudo docker run -it --rm --name killbill-2 -p 8000:8000 killbill-2

-> If the answer to the previous question is 'yes' can you telnet from the outside to that port

Failed:

$ sudo docker inspect killbill-2 | grep "IPAddress"
"SecondaryIPAddresses": null,
"IPAddress": "172.17.0.2",
"IPAddress": "172.17.0.2",

$ telnet 172.17.0.2 8000
Trying 172.17.0.2...
telnet: Unable to connect to remote host: Connection refused

Also I tried for 172.0.0.1:

$ telnet 127.0.0.1 8000
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Connection closed by foreign host.
Reply all
Reply to author
Forward
0 new messages