Operations 6 min read

Boost Java Service Performance with MyPerf4J: A High‑Speed, Low‑Impact Monitoring Tool

MyPerf4J is an open‑source, high‑performance Java monitoring and statistics tool that uses a JavaAgent for zero‑intrusion, records up to ten million method calls per second with nanosecond precision, and provides real‑time metrics such as QPS, latency percentiles, memory and GC stats, making it ideal for both development and production environments.

Architecture Digest
Architecture Digest
Architecture Digest
Boost Java Service Performance with MyPerf4J: A High‑Speed, Low‑Impact Monitoring Tool

Background

When a company scales its application services, monolithic architectures become insufficient. Hundreds of engineers working on a single project lead to reduced development efficiency and limited visibility into service performance (e.g., QPS, latency percentiles, load balance, downstream dependencies).

MyPerf4J Overview

MyPerf4J is a high‑performance Java performance monitoring and statistics tool designed for high‑concurrency, low‑latency applications. It attaches to a Java process via a JavaAgent, requiring no code changes and providing zero‑intrusion monitoring.

Use Cases

Quickly locate performance bottlenecks in a development environment.

Continuously monitor performance indicators of Java applications in production.

Key Features

High Performance : Single‑thread recording supports up to 10 million responses per second, each record costing only 73 ns.

Zero Intrusion : Uses -javaagent to instrument the JVM without modifying application code.

Low Memory Footprint : Memory‑reuse design creates minimal temporary objects, avoiding GC impact.

High Precision : Measures response time in nanoseconds.

Real‑Time : Supports per‑second monitoring with a minimum interval of 1 second.

Supported Metrics

Method

RPS, Count, Avg, Min, Max, StdDev, TP50, TP90, TP95, TP99, TP999, TP9999, TP99999, TP100

Memory

HeapInit, HeapUsed, HeapCommitted, HeapMax, NonHeapInit, NonHeapUsed, NonHeapCommitted, NonHeapMax

JVM GC

CollectCount, CollectTime

JVM Class

Total, Loaded, Unloaded

Quick Start

Download the binary package:

https://github.com/LinShunKang/Objects/blob/master/zips/CN/MyPerf4J-ASM-3.3.0-SNAPSHOT.zip?raw=true

Steps:

Unzip MyPerf4J-ASM.zip.

Edit the extracted MyPerf4J.properties to set app_name, metrics.log.xxx, and filter.packages.include as needed.

Add the following JVM arguments when starting the application:

-javaagent:/path/to/MyPerf4J-ASM.jar
-DMyPerf4JPropFile=/path/to/MyPerf4J.properties

After startup, MyPerf4J writes method metrics to the configured log file, e.g., /path/to/log/method_metrics.log.

Uninstall

Remove the two JVM arguments from the startup command and restart the application.

-javaagent:/path/to/MyPerf4J-ASM.jar
-DMyPerf4JPropFile=/path/to/MyPerf4J.properties

Repository

Source code: https://github.com/LinShunKang/MyPerf4J

Illustrations

MyPerf4J overview
MyPerf4J overview
Service scaling challenges
Service scaling challenges
MyPerf4J metrics dashboard
MyPerf4J metrics dashboard
JavaMetricsPerformance Monitoringopen-sourceJavaAgent
Architecture Digest
Written by

Architecture Digest

Focusing on Java backend development, covering application architecture from top-tier internet companies (high availability, high performance, high stability), big data, machine learning, Java architecture, and other popular fields.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.