2

I'm using Perfino to monitor some Tomcats in SLES. The server has its own installer, so upgrading it is not an issue (just run the installer, and it'll detect the existing installation an upgrade it). But there is no installer for the agents.

I already contacted EJ-Technology's support about this issue (emphasis mine):

the agents are updated automatically. The monitored applications will continue to run with the same agent until they are restarted. In the VMs view you will see a special icon next to VM that indicates that the agent is out of date.

If I understand it correctly, the agents in the running JVMs are upgraded on the fly. But I checked the agent.jar, perfino.jar and libperfino.so and neither of them are modified, so after restart, the server will need to upgrade it again.

I've already experienced problems with outdated agents, so I have begun building my own rpms to deploy the agent upgrades (that is, all the agent.tar.gz). But I'm now a bit concerned about the appropriateness of this method: it depends on the class loader the jar of a running application can be overwritten. I've done it already and nothing broke. But...

Is it safe to unpack a new agent.tar.gz of a running monitored application?

Alberto
  • 5,021
  • 4
  • 46
  • 69

1 Answers1

1

But I checked the agent.jar, perfino.jar and libperfino.so and neither of them are modified

The server pushes the new agent to all monitored JVMs, but it does not overwrite the agent that you specified in the -javaagent:[path to perfino.jar] VM parameter, because those files may be in use and they might not even be writable.

Instead, the new agent is saved to the ~/.perfino/agent directory. Each agent update has an ID and that is the name of the subdirectory where the agent is stored. The file perfino.jar is just a bootstrapper that selects the most recent available agent at startup.

Is it safe to unpack a new agent.tar.gz of a running monitored application?

No, that would not be safe in general, the removed JAR files may still be required for class loading.

Ingo Kegel
  • 46,523
  • 10
  • 71
  • 102
  • So I should never have incompatibility problems between server-agent versions as long as the monitored apps are running, nor I should care about reinstalling the agent for them. What about servers ongoing maintenance and being a while down: would they also be updated on restart? – Alberto Mar 23 '17 at 09:09
  • This also means that if I experience any misbehaviour with respect to incompatible versions, I'd be facing a bug? – Alberto Mar 23 '17 at 09:10
  • What most confuses me: if the `perfino.jar` is only a bootstrapper, why are the files different with each version? (well, I have to admit that I'm only comparing checksums... it could be only timestamps in manifests, for example, but it'd be convenient to know) – Alberto Mar 23 '17 at 09:26
  • Could I then use the same `agent.tar.gz` for all future installs to? (saving me the effort to build new rpms for new deployments) – Alberto Mar 23 '17 at 09:29
  • 1
    There should never be a problem with incompatible agents. New agents are used automatically when the JVM is restarted. You can use an old agent in your `agent.tar.gz` deployment, it will then be updated for the next restart. And perfino.jar is definitely just a bootstrapper, but that does not mean that the checksum of the JAR file may never change for new versions for whatever reasons. – Ingo Kegel Mar 23 '17 at 10:00