Setting JVM Parameters for Collectors
Windows
The following procedure uses Windows 11 and designcenter-collector-server as an example.
- Navigate to the location of the startup script.
Go to the MgC Agent installation directory (C:\Edge by default) and find .\tools\plugins\collectors\designcenter-collector-server\bin\start.bat. designcenter-collector-server can be replaced with the collector you want to configure. The supported collectors include:
Database collector rda-collector-database
Container collector rda-collector-kubernetes
Platform collector designcenter-collector-platform
Server collector designcenter-collector-server
Big data collector bigdata-migration
Storage collector rda-storage-collector
- Set the JVM parameters.
- In the MgC Agent installation directory (C:\Edge by default), edit .\tools\plugins\collectors\designcenter-collector-server\bin\start.bat.
- Add the following JVM parameters after -jar in the second statement.
-Xms512M -Xmx1024M
In the preceding information, -Xms512M -Xmx1024M are the JVM parameters to be configured. -Xms512M indicates that the initial heap memory allocated to the JVM is 512 MB. -Xmx1024M indicates that the maximum heap memory that can be allocated to the JVM is 1,024 MB. You can add other JVM parameters as required.
- Save and exit start.bat. The JVM parameters are configured for the server collector.
- Restart the collector.
The JVM parameters will be applied after the collector is restarted.
- Go to the MgC Agent installation directory (C:\Edge by default) and run .\tools\plugins\collectors\designcenter-collector-server\bin\stop.bat as the administrator.
- Run the collector startup script start.bat in the same directory.
- Query the JVM parameters of the collector.
- Press Ctrl, Alt, and Delete and select Task Manager on the displayed page to open it. In the Task Manager dialog box, choose the Details tab.
- Find designcenter-collector-server.exe and check its PID.
- Open Command Prompt as the administrator, enter the following command, and press Enter:
jinfo <PID>
In the preceding command, PID indicates the PID of the MgC Agent program. You can view the effective JVM parameters in the command output.Figure 1 Command prompt
Linux
The following procedure uses CentOS 8 and designcenter-collector-server as an example.
- Navigate to the location of the startup script.
Go to the MgC Agent installation directory. The default directory is /opt/cloud/Edge. Find /tools/plugins/collectors/designcenter-collector-server. designcenter-collector-server can be replaced with the collector you want to configure. The supported collectors include:
Database collector rda-collector-database
Container collector rda-collector-kubernetes
Platform collector designcenter-collector-platform
Server collector designcenter-collector-server
Storage collector rda-storage-collector
Big data collector bigdata-migration
- Set the JVM parameters.
- In the MgC Agent installation directory (/opt/cloud/Edge by default), edit /tools/plugins/collectors/designcenter-collector-server.
- Create the start.sh file and add the following information to the file:
nohup java -jar -Xms256M -Xmx512M designcenter-collector-server.jar >/dev/null 2>&1 &
In the preceding information, -Xms512M -Xmx1024M are the JVM parameters to be configured. -Xms512M indicates that the initial heap memory allocated to the JVM is 512 MB. -Xmx1024M indicates that the maximum heap memory that can be allocated to the JVM is 1,024 MB. You can add other JVM parameters as required.
- Save and exit start.sh. The JVM parameters are configured for the server collector.
- Restart the collector.
The JVM parameters will be applied after the collector is restarted.
- Run the following command to view the PID of the collector:
ps -ef|grep java
- Enter the following command and press Enter to stop the collector.
kill -9 PID
- Enter the following command to run the new startup script start.sh:
sh start.sh
- Run the following command to view the PID of the collector:
- Query the JVM parameters of the collector.
Run the following command to view the JVM parameters of the collector:
ps -ef|grep java
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.