Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Jprofiler to remotely monitor online services

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

How to use Jprofiler remote monitoring online service, in view of this problem, this article introduces the corresponding analysis and answer in detail, hoping to help more partners who want to solve this problem to find a more simple and easy way.

First of all, let's talk about the pit encountered in the past two days.

1. The Jenkins provided by my colleague was not matched properly, so the deployment of the code I uploaded did not work. Because the jar packaged by the Gradle server was not transferred to the target server. The reason is that the configuration of Jenkins transport jar package miswrites the package name of jar package, which makes me check both security group configuration and ssh configuration, which is a waste of time.

two。 Last week, the background service often hung up, which was dropped by the system kill after running out of memory, and then directly applied for a new server. However, I have observed that memory is still soaring and cpu usage remains high. After thinking about it for a long time, it is not possible for the background to consume 1.7g of memory, let alone a business that consumes 100% CPU. There must be something wrong. After configuring jprofiler remote monitoring, I found the reason. It turned out that the jdbc plug-in I wrote consumed a lot of memory for cpu,sql slow monitoring, so I really dug a hole for myself. Temporarily offline this plug-in.

3. Service split. Back-end services are getting bloated, and it's time to redefine micro-services. My split scheme is to separate all scheduled tasks into a separate service. Some of the highly coupled ones have to be slowly removed later.

Use Jprofiler to remotely monitor online services

Jprofiler is the most powerful JVM performance monitoring tool I know. Using Jprofiler plus jhat provided by jdk can solve common performance tuning and troubleshooting problems.

For some problems, it is convenient to use jdk to provide command tools, so you have to choose the appropriate tool according to the specific situation. for example, you can use the online gceasy website to analyze gc diary files.

The image above is a screenshot I used to find slow Sql, which is much more useful than the slow sql monitoring plug-in I wrote myself. The plug-in I wrote failed to monitor slow sql instead of using aop, but to analyze the execution plan of sql.

Local GUI tool installation for Jprofiler

Jprofiler local tool installation, installation cracked version can search for my previous articles, I remember I wrote.

Download and installation of remote server

It is important to note that the locally installed Jprofiler graphical interface tools must match the version number installed on the remote server. Otherwise, the remote connection cannot be connected. I came across this pit. I installed 9.2 locally and installed 9.1 remotely. As a result, I tried it for a long time and changed to a 9.2 version on Linux. Server Jprofiler version to the official website to download, local to the Internet to find a cracked version.

Install locally first, because you need to find a cracked version locally. The download page of the official website is as follows.

Be careful to select the version number.

The Linux server selects the Linux version and gets the download link to download using wget, or download it locally and then upload it to the server using ssh.

Use RPM to install after the download is complete. Such as rpm-ivh jprofiler_linux_9_2_1.rpm. Can also download gz compression package, directly decompress on the line, how convenient to come.

If your Jdk is not installed using the yum command, then you need to configure the jdk environment variable yourself, which I think is nonsense.

Configure remote monitoring using Jpenable

In the jprofiler installation directory, go to the bin directory to have a jpenable tool, run it, and then select the java process you need to monitor. If there is only one java process, it will be selected by default, and multiple java processes will allow you to choose.

Then select profiling mode, enter 1 to select GUI, and press enter. Finally, enter a port number, which is the port on which your local Jprofiler communicates with the remote jprofiler process. If it is an Aliyun or Amazon server, remember to configure security group rules for the port. If there is a firewall on, remember to open the port. The specific steps are shown in the figure.

Local monitoring and remote monitoring

Follow the steps. The first step is to create a session, which is a local connection to the remote jprofiler, which reads the information of the remote jprofiler monitoring target java process by establishing the connection. Select new remote integration.

The second step is to choose local or remote. Select the remote machine, and then select the system and cpu architecture of the server. Most servers are cpu of x86 or amd.

The third step is to configure which version of jdk is used by the remote server.

The fourth step, choose to configure first, then connect later.

Step 5: configure the ip address of the remote server

Step 6, configure the installation directory of the remote machine jprofiler

Step 7

Step 8, enter the port on which the remote machine jprofiler listens, the port number configured after the previous jpenable.

Then Finish is configured.

Connection failure condition

1. When executing. / jpenable on a remote machine, prompt No unprofiles JVMs found?

Analysis: the monitoring of the Java process has been enabled, and the target java process needs to be kill off and then restarted.

two。 How to turn off the remote monitoring of Jprofiler?

The only way is to restart the monitored java process, and the Jprofiler will fail. Re-monitoring requires restarting the java process and then reexecuting the jpenable.

The principle can refer to an article I wrote earlier about bytecode insertion to achieve business code call chain monitoring, but jprofiler uses a process-based approach, which is more complicated. You can also see the implementation principle of Arthas provided by Ali. Or take a look at the new features of Java SE 6-the new features of Instrumentation.

This is the answer to the question on how to use Jprofiler remote monitoring online services. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report