Java Performance Tuning
Java(TM) - see bottom of page
Our valued sponsors who help make this site possible
JProfiler: Get rid of your performance problems and memory leaks!
Training online: Concurrency, Threading, GC, Advanced Java and more ...
Tips March 2021
JProfiler
|
Get rid of your performance problems and memory leaks!
|
JProfiler
|
Get rid of your performance problems and memory leaks!
|
|
|
Back to newsletter 244 contents
https://medium.com/expedia-group-tech/traffic-shedding-rate-limiting-backpressure-oh-my-21f95c403b29?source=friends_link&sk=283c3469e0a796006db210b605a95c5c
Traffic Shedding, Rate Limiting, Backpressure, Oh My! How to stop your service from getting overloaded (Page last updated March 2021, Added 2021-03-29, Author Jack Shirazi, Publisher Expedia). Tips:
- There are three options to handle as much traffic as possible, which can be used in combination: scale (adding sufficient additional capacity to handle the traffic increase); overprovision (already having sufficient additional capacity to handle any traffic increase); queue (temporarily holding requests somewhere and processing when resources are available).
- There are three options to avoid overloading, which are in order of sophistication: traffic shedding (dropping requests); rate limiting (throttling, sending an error when request rate exceeds a limit); backpressure (rate limiting on the server with the client adjusting request rate to match the limit).
https://www.theserverside.com/feature/Use-this-Java-performance-tuning-guide-to-optimize-your-JVM
Use this Java performance tuning guide to optimize your JVM (Page last updated February 2021, Added 2021-03-29, Author Cameron McKenzie, Publisher theserverside). Tips:
- First establish that your underlying system is capable of achieving performance targets before trying to tune your Java application. For example TCP.org has useful established benchmarks.
- Your target should not be trying to squeeze the most out of every clock-cycle tick. Instead, you should have business related performance targets. Typically the longest acceptable response time or how many transactions per second should be processed.
- Well-stated, quantitative targets should be established for: latency (eg stateless response times will average 50 ms, stateful response times will average 500 ms), throughput (eg 500 transactions per second), responsiveness (eg page load times less than two seconds), stability (eg failover occurs in less than five seconds), jitteryness (eg 99% of transactions happen in less than 40 milliseconds).
- Most Java performance problems can be attributed to one of the following four shared resources: CPU, memory, I/O operations, threads. Pay special attention to the following metrics: CPU utilization, system context switching, physical memory utilization, heap consumption over time, network bandwidth used, disk I/O latency, database locks, SQL latency, garbage collection frequency, garbage collection pause time, thread contentions, thread pauses, thread locks.
- The most common Java performance optimizations: use faster database queries; identify and fix memory leaks; optimize garbage collection routines; resolve thread locks and concurrency issues; fix inefficient code in the application; and use the correct collection class for list processing.
https://nipafx.dev/java-unix-domain-sockets/
Code-First Unix Domain Socket Tutorial (Page last updated March 2021, Added 2021-03-29, Author Nicolai Parlog, Publisher nipafx.dev). Tips:
- Java's socket channel / server-socket channel API can use Unix domain sockets (since Java 16) for faster and more secure inter-process communication on the same host
- The Unix domain socket file needs to have the correct permissions for the program for all instances of the program (ie for all users who launch the program).
- Obtain a UnixDomainSocketAddress (eg using the static of() method), and open using ServerSocketChannel/SocketChannel.open(StandardProtocolFamily.UNIX) then bind() to the address. Finally the server should ServerSocketChannel.accept() and the client should SocketChannel.connect(). The resulting IO is executed the same way as for other sockets.
- Unix domain sockets have faster setup times and higher data throughput than TCP/IP loopback connections. They also have better security (because standard file-based access control is used).
Jack Shirazi
Back to newsletter 244 contents
Last Updated: 2024-11-29
Copyright © 2000-2024 Fasterj.com. All Rights Reserved.
All trademarks and registered trademarks appearing on JavaPerformanceTuning.com are the property of their respective owners.
Java is a trademark or registered trademark of Oracle Corporation in the United States and other countries. JavaPerformanceTuning.com is not connected to Oracle Corporation and is not sponsored by Oracle Corporation.
URL: http://www.JavaPerformanceTuning.com/news/newtips244.shtml
RSS Feed: http://www.JavaPerformanceTuning.com/newsletters.rss
Trouble with this page? Please contact us