Uber jvm profiler如何使用

发布时间:2022-01-05 14:52:41 作者:小新
来源:亿速云 阅读:132

这篇文章将为大家详细讲解有关Uber jvm profiler如何使用,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。

背景

uber jvm profiler是用于在分布式监控收集jvm 相关指标,如:cpu/memory/io/gc信息等

安装

确保安装了maven和JDK>=8前提下,直接mvn clean package

java application

参数说明
reporterreporter类别, 此处直接默认为com.uber.profiling.reporters.KafkaOutputReporter就可以
brokerList如reporter为com.uber.profiling.reporters.KafkaOutputReporter,则brokerList为kafka列表,以逗号分隔
topicPrefix如reporter为com.uber.profiling.reporters.KafkaOutputReporter,则topicPrefix为kafka topic的前缀
tagkey为tag的metric,会输出到reporter中
metricIntervalmetric report的频率,根据实际情况设置,单位为ms
sampleIntervaljvm堆栈metrics report的频率,根据实际情况设置,单位为ms
  "nonHeapMemoryTotalUsed": 11890584.0,
  "bufferPools": [
      {
          "totalCapacity": 0,
          "name": "direct",
          "count": 0,
          "memoryUsed": 0
      },
      {
          "totalCapacity": 0,
          "name": "mapped",
          "count": 0,
          "memoryUsed": 0
      }
  ],
  "heapMemoryTotalUsed": 24330736.0,
  "epochMillis": 1515627003374,
  "nonHeapMemoryCommitted": 13565952.0,
  "heapMemoryCommitted": 257425408.0,
  "memoryPools": [
      {
          "peakUsageMax": 251658240,
          "usageMax": 251658240,
          "peakUsageUsed": 1194496,
          "name": "Code Cache",
          "peakUsageCommitted": 2555904,
          "usageUsed": 1173504,
          "type": "Non-heap memory",
          "usageCommitted": 2555904
      },
      {
          "peakUsageMax": -1,
          "usageMax": -1,
          "peakUsageUsed": 9622920,
          "name": "Metaspace",
          "peakUsageCommitted": 9830400,
          "usageUsed": 9622920,
          "type": "Non-heap memory",
          "usageCommitted": 9830400
      },
      {
          "peakUsageMax": 1073741824,
          "usageMax": 1073741824,
          "peakUsageUsed": 1094160,
          "name": "Compressed Class Space",
          "peakUsageCommitted": 1179648,
          "usageUsed": 1094160,
          "type": "Non-heap memory",
          "usageCommitted": 1179648
      },
      {
          "peakUsageMax": 1409286144,
          "usageMax": 1409286144,
          "peakUsageUsed": 24330736,
          "name": "PS Eden Space",
          "peakUsageCommitted": 67108864,
          "usageUsed": 24330736,
          "type": "Heap memory",
          "usageCommitted": 67108864
      },
      {
          "peakUsageMax": 11010048,
          "usageMax": 11010048,
          "peakUsageUsed": 0,
          "name": "PS Survivor Space",
          "peakUsageCommitted": 11010048,
          "usageUsed": 0,
          "type": "Heap memory",
          "usageCommitted": 11010048
      },
      {
          "peakUsageMax": 2863661056,
          "usageMax": 2863661056,
          "peakUsageUsed": 0,
          "name": "PS Old Gen",
          "peakUsageCommitted": 179306496,
          "usageUsed": 0,
          "type": "Heap memory",
          "usageCommitted": 179306496
      }
  ],
  "processCpuLoad": 0.0008024004394748531,
  "systemCpuLoad": 0.23138430784607697,
  "processCpuTime": 496918000,
  "appId": null,
  "name": "24103@machine01",
  "host": "machine01",
  "processUuid": "3c2ec835-749d-45ea-a7ec-e4b9fe17c23a",
  "tag": "mytag",
  "gc": [
      {
          "collectionTime": 0,
          "name": "PS Scavenge",
          "collectionCount": 0
      },
      {
          "collectionTime": 0,
          "name": "PS MarkSweep",
          "collectionCount": 0
      }
  ]
}

spark application

参数说明
reporterreporter类别, 此处直接默认为com.uber.profiling.reporters.KafkaOutputReporter就可以
brokerList如reporter为com.uber.profiling.reporters.KafkaOutputReporter,则brokerList为kafka列表,以逗号分隔
topicPrefix如reporter为com.uber.profiling.reporters.KafkaOutputReporter,则topicPrefix为kafka topic的前缀
tagkey为tag的metric,会输出到reporter中
metricIntervalmetric report的频率,根据实际情况设置,单位为ms
sampleIntervaljvm堆栈metrics report的频率,根据实际情况设置,单位为ms
  "nonHeapMemoryTotalUsed": 11890584.0,
  "bufferPools": [
      {
          "totalCapacity": 0,
          "name": "direct",
          "count": 0,
          "memoryUsed": 0
      },
      {
          "totalCapacity": 0,
          "name": "mapped",
          "count": 0,
          "memoryUsed": 0
      }
  ],
  "heapMemoryTotalUsed": 24330736.0,
  "epochMillis": 1515627003374,
  "nonHeapMemoryCommitted": 13565952.0,
  "heapMemoryCommitted": 257425408.0,
  "memoryPools": [
      {
          "peakUsageMax": 251658240,
          "usageMax": 251658240,
          "peakUsageUsed": 1194496,
          "name": "Code Cache",
          "peakUsageCommitted": 2555904,
          "usageUsed": 1173504,
          "type": "Non-heap memory",
          "usageCommitted": 2555904
      },
      {
          "peakUsageMax": -1,
          "usageMax": -1,
          "peakUsageUsed": 9622920,
          "name": "Metaspace",
          "peakUsageCommitted": 9830400,
          "usageUsed": 9622920,
          "type": "Non-heap memory",
          "usageCommitted": 9830400
      },
      {
          "peakUsageMax": 1073741824,
          "usageMax": 1073741824,
          "peakUsageUsed": 1094160,
          "name": "Compressed Class Space",
          "peakUsageCommitted": 1179648,
          "usageUsed": 1094160,
          "type": "Non-heap memory",
          "usageCommitted": 1179648
      },
      {
          "peakUsageMax": 1409286144,
          "usageMax": 1409286144,
          "peakUsageUsed": 24330736,
          "name": "PS Eden Space",
          "peakUsageCommitted": 67108864,
          "usageUsed": 24330736,
          "type": "Heap memory",
          "usageCommitted": 67108864
      },
      {
          "peakUsageMax": 11010048,
          "usageMax": 11010048,
          "peakUsageUsed": 0,
          "name": "PS Survivor Space",
          "peakUsageCommitted": 11010048,
          "usageUsed": 0,
          "type": "Heap memory",
          "usageCommitted": 11010048
      },
      {
          "peakUsageMax": 2863661056,
          "usageMax": 2863661056,
          "peakUsageUsed": 0,
          "name": "PS Old Gen",
          "peakUsageCommitted": 179306496,
          "usageUsed": 0,
          "type": "Heap memory",
          "usageCommitted": 179306496
      }
  ],
  "processCpuLoad": 0.0008024004394748531,
  "systemCpuLoad": 0.23138430784607697,
  "processCpuTime": 496918000,
  "appId": null,
  "name": "24103@machine01",
  "host": "machine01",
  "processUuid": "3c2ec835-749d-45ea-a7ec-e4b9fe17c23a",
  "tag": "mytag",
  "gc": [
      {
          "collectionTime": 0,
          "name": "PS Scavenge",
          "collectionCount": 0
      },
      {
          "collectionTime": 0,
          "name": "PS MarkSweep",
          "collectionCount": 0
      }
  ]
}

分析

reporter说明
ConsoleOutputReporter默认的repoter,一般用于调试
FileOutputReporter基于文件的reporter,分布式环境下不适用,得设置outputDir
KafkaOutputReporter基于kafka的reporter,正式环境用的多,得设置brokerList,topicPrefix
GraphiteOutputReporter基于Graphite的reporter,需设置graphite.host等配置
RedisOutputReporter基于redis的reporter,构建命令 mvn -P redis clean package
InfluxDBOutputReporter基于InfluxDB的reporter,构建命令mvn -P influxdb clean package,需设置influxdb.host等配置
建议在生产环境下使用KafkaOutputReporter,操作灵活性高,可以结合clickhouse grafana进行指标展示

关于“Uber jvm profiler如何使用”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。

推荐阅读:
  1. Uber用Go重写Schemaless数据库的分片层分析
  2. Uber推出AI技术监测司机是否佩戴口罩

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

jvm

上一篇:SpringMVC执行过程是怎样的

下一篇:FileInputFormat如何导读getSplits

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》