Can't profile remote linux application

Questions about YourKit Java Profiler
Post Reply
timfox
Posts: 2
Joined: Mon Jun 15, 2015 5:59 pm

Can't profile remote linux application

Post by timfox »

Hello folks,

I have an application on a remote Linux server that I wish to profile from my laptop.

I have installed yjp on both server and laptop (same latest version)

I have started the server with the agent and specifying listen host:port:

java -agentpath:/home/tim/yjp-2015-build-15060/bin/linux-x86-64/libyjpagent.so=listen=<myhost>:10001

(where <myhost> is the actual public IP address)

I have disabled iptables on the linux server. There is no firewall on the client.

I can successfully connect to the agent over http to the see the status page:

http://<myhost>:10001/

So I know it's all up and running and no firewall issue.

I now try and connect using the profiler from the laptop:

1. connect to remote application
2. specify <myhost>:10001

It initially connects and the profiling page appears

but within a second the status bar says:

"Local application XYZ at port 10001 has terminated or connection lost"

There is nothing in the local yjp logs

Any ideas?
timfox
Posts: 2
Joined: Mon Jun 15, 2015 5:59 pm

Re: Can't profile remote linux application

Post by timfox »

I tried running the profiler as root on the client and... it works!

(I received lots of warnings while doing this that the profiler should not be run as root)

So I guess there is some permissions issue - the profiler is attempting to do something that it is not allowed to do and barfs.

BTW I have a very standard user setup (completely Vanilla Linux Mint)
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Can't profile remote linux application

Post by Anton Katilin »

Hi,

What were the warnings in particular?
"Local application XYZ at port 10001 has terminated or connection lost"
The word "Local" may be the clue. For a remote connection, it should have been "Remote" instead.

The fact that you saw "Local" means that the profiled application's host was for some reason detected as the same host as your local one.

The profiler UI performs a special check for local applications: it periodically checks that the application with given PID is still running. If it's not, the session is closed and the disconnected message is displayed.

Obviously, since the profiled application runs on the remote host, its PID is not among the PIDs on the local host. The profiler thinks the process is dead and disconnects.

Running the profiler under a different user affects host matching algorithms. As the result, the profiler no longer thinks the hosts are same and thus properly detects the session as remote.

This explanation is a theory, we have not seen such problem before, and do not know how to reproduce it. That's why we'd appreciate a lot if you could provide the the logs of the profiler agent (from the remote machine) and client (from the local machine) from ~/.yjp/log, where "~" in both cases corresponds to appropriate user's home. If you cannot provide the logs in full, could you please do

echo xxx.log | grep hid

Best regards,
Anton
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Can't profile remote linux application

Post by Anton Katilin »

An update:

Looks like we've found the problem, it must indeed be related with remote vs local host detection. The next build will fix it.

Anyway, we're still interested in the requested log entries to ensure we've properly understood the problem.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Can't profile remote linux application

Post by Anton Katilin »

Could you please try the latest build 15062:
http://www.yourkit.com/download

Does it solve the problem if you run the profiler UI as a regular user?
Post Reply