java - 有哪些 Java 实用程序可用于对机器的 CPU、内存、磁盘和网络 I/O 性能进行基准测试?

标签 java performance jvm benchmarking utilities

我需要解释为什么我的应用程序在远程位置表现不佳。安装分析器对我来说会很不方便。我怀疑机器配置不当,但我需要一些简单的方法来证明标准应用程序在他们的机器上受到影响,从而免除我的申请并将重点转移到他们的系统管理员身上。

理想情况下,我想建议他们安装一个简单的 Java 应用程序来测试主机环境的性能。如果它能返回一些 CPU、磁盘、网络等规范,那就完美了。

我希望在网上找到这样的东西,但到目前为止我的搜索一直没有成功。

最佳答案

就“简单的 Java 应用程序”而言,我以前做过类似的事情。我的工作重点是分析 Java VM(虚拟机 - “JVM”),而不是测试特定 Java 应用程序的性能。重点是测试托管操作系统的功能 - 练习:

  • 中央处理器
  • 内存
  • 操作系统
  • 如果进行了虚拟化,则为服务器 VM(而非 JVM)本身 - 包括上述所有组件的虚拟化组件和物理组件。
  • 在很大程度上忽略了外部因素,例如磁盘和网络。

我为此寻找的解决方案包括:

SciMark is a composite Java benchmark measuring the performance of numerical codes occurring in scientific and engineering applications. It consists of five computational kernels: FFT, Gauss-Seidel relaxation, Sparse matrix-multiply, Monte Carlo integration, and dense LU factorization.

These kernels are chosen to provide an indication of how well the underlying JVM/JITs perform on applications utilizing these types of algorithms. The problems sizes are purposely chosen to be small in order to isolate the effects of memory hierarchy and focus on internal JVM/JIT and CPU issues. A larger version of the benchmark (SciMark 2.0 LARGE) addresses performance of the memory subsystem with out-of-cache problem sizes.

It measures several computational kernels and reports a composite score in approximate Mflops (Millions of floating point operations per second).

虽然有些过时(2004 年),但 SciMark 似乎仍然非常有效。

每次测试运行大约需要 30 秒才能执行。

SPECjvm2008 (Java Virtual Machine Benchmark) is a benchmark suite for measuring the performance of a Java Runtime Environment (JRE), containing several real life applications and benchmarks focusing on core java functionality. The suite focuses on the performance of the JRE executing a single application; it reflects the performance of the hardware processor and memory subsystem, but has low dependence on file I/O and includes no network I/O across machines. The SPECjvm2008 workload mimics a variety of common general purpose application computations. These characteristics reflect the intent that this benchmark will be applicable to measuring basic Java performance on a wide variety of both client and server systems.

SPEC also finds user experience of Java important, and the suite therefore includes startup benchmarks and has a required run category called base, which must be run without any tuning of the JVM to improve the out of the box performance.

SPECjvm2008 Benchmark Highlights

  • Leverages real life applications (like derby, sunflow, and javac) and area-focused benchmarks (like xml, serialization, crypto, and scimark).
  • Also measures the performance of the operating system and hardware in the context of executing the JRE.

与 SciMark 不同,SPECjvm2008 需要更长的时间才能完全执行套件 - taking just over 2 hours .


为了测试网络,我会使用类似 iperf 的东西, 适用于 Linux/Windows/etc.

对于测试磁盘性能,这背后有一整套科学,在不知道你使用的是什么操作系统的情况下,我无法给你一个具体的答案。但是,例如,如果您使用的是 Linux,我会查看 this .

关于java - 有哪些 Java 实用程序可用于对机器的 CPU、内存、磁盘和网络 I/O 性能进行基准测试?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12406259/

相关文章:

java - 将 1 个字符串元素转换为整数

java - 我如何理解 Thread.interrupt()?

Java 表达式树

java - QueryDSL 和 Hibernate 搜索 isNull 和 isNotNull 查询

java - 按键时的 JTable 编辑

database - 随机选择尚未在连接表中的实体

java - 使用曼哈顿距离计算多点之间的最短路径

java - 为什么 if (variable1 % variable2 == 0) 效率低下?

java - Java 平台的描述和运行代码是否存在一系列老的安全问题?

java - 为什么使用 ImageIcon 而不是 Image?