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 September 2022
JProfiler
|
Get rid of your performance problems and memory leaks!
|
JProfiler
|
Get rid of your performance problems and memory leaks!
|
|
|
Back to newsletter 262 contents
https://medium.com/@hari.bodicherla/throttling-service-algorithms-explained-f5f14c13a752
Throttling service algorithms explained (Page last updated August 2022, Added 2022-09-28, Author hari krishna bodicherla, Publisher Medium). Tips:
- Most large tech companies enforce some form of API throttling to ensure service availability and to fight DDOS attacks.
- Common Algorithms for (per-user) throttling are: Leaking Bucket - a FIFO queue holds requests and whenever the queue is full new requests are dropped; Token Bucket - a fixed size bucket holds tokens filled at a fixed rate, requests need a token to proceed, requests unable to get a ticket are dropped; Fixed Window counter - allow N number of calls per time period; Sliding Window log - drop requests when the sliding window is full, holding timestamps in a log; Sliding window counter - CurrentRequestCount = RequestsCurrentWindow + RequestsPreviousWindow * PercentageOfOverlap, if the CurrentRequestCount is below the threshold, accept the request, otherwise drop it.
https://medium.com/javarevisited/five-api-performance-optimization-tricks-that-every-java-developer-must-know-75324ee1d244
Five API Performance Optimization Tricks that Every Java Developer Must Know (Page last updated August 2022, Added 2022-09-28, Author Lance_Ly, Publisher Javarevisited). Tips:
- Parallelize executions that are long running, especially calls to external services.
- Keep transactions as short as possible, especially avoid long running transactions as they lock out other requests.
- Ensure that large collections of data are indexed to access and update efficiently.
- Return data using paging where chunks of the data are returned one at a time as requested, so unread data is not provided.
- Cache for faster responses where that is needed.
https://www.youtube.com/watch?v=N5WbXprLoVM
Five most useful profiling techniques to use with modern Java apps (Page last updated July 2022, Added 2022-09-28, Author Laurentiu Spilca, Publisher Voxxed). Tips:
- Monitor SQL queries to identify inefficient communication between the app and the DBMS - visualvm has a JDBC profiler plugin, and p6spy is another technology that lets you do that easily.
- Profile the application to find the execution bottlenecks and optimize these away.
- Call graphs can be a useful tool to track activity through application execution and understand the overall time sent in the application flow of execution.
- Analyze your app's memory usage using a memory profiler (most profilers have one, eg visualvm) - look for memory leaks and high allocation rates.
- Use sampling profiling before bytecode profiling, as sampling has a much lower overhead and often gives you enough information to optimize - except for reactive apps.
- Bottlenecks that have execution time significantly larger than CPU time, are spending their time waiting.
Jack Shirazi
Back to newsletter 262 contents
Last Updated: 2024-12-27
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/newtips262.shtml
RSS Feed: http://www.JavaPerformanceTuning.com/newsletters.rss
Trouble with this page? Please contact us