Agent stops after starting to listen

Questions about YourKit Java Profiler
Post Reply
pundir
Posts: 2
Joined: Fri May 05, 2023 12:31 pm

Agent stops after starting to listen

Post by pundir »

When manually attaching the agent to server, agent and server processes start. A few seconds later agent process dies. My server is running but I can't find the agent process, and hence cannot attach profiler.

Looking at the logs, agent had started listening. I've tried adding delay but the agent process does not last that long. I can see the process in Profiler UI and then it's gone coz the process on the server has died.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Agent stops after starting to listen

Post by Anton Katilin »

> My server is running but I can't find the agent process, and hence cannot attach profiler.
Apparently you added -agentpath to a wrong process. If your server is running, the agent should be loaded to its JVM. You likely added it to an intermediate process which launches the server process then finishes.

What kind of EE server do you have? Please use the EE server integration wizard which supports many servers and knows how to properly update their scripts to enable profiling:
https://www.yourkit.com/docs/java/help/ ... remote.jsp
pundir
Posts: 2
Joined: Fri May 05, 2023 12:31 pm

Re: Agent stops after starting to listen

Post by pundir »

Thanks for sharing the expected behavior. Turns out this was an issue on my end. Lesson, do not work at odd hours.

I'm using remote profiling over ssh. My service runs under a different user than the ssh user. That lead to the issue of not being able to see the service in Monitoring tab. I had to run the service under the same user as the ssh credentials. I must have done something wrong here coz the server that I mentioned earlier as running was actually a daemon from a previous instance.

We use systemctl to start services. My previous instance must have detached from the tracking process and was not being shut down after I ran systemctl restart or systemctl stop. So when the server with profiler agent would attempt to start, it was silently failing; likely coz the ports were not available.

Killing the daemon process manually and restarting service fixed the issue.
Post Reply