Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

3 Lessons Learned From the Locking Statistics of a Typical Web Application

DZone's Guide to

3 Lessons Learned From the Locking Statistics of a Typical Web Application

Locking stats of web apps can teach us many lessons. Here are three essential takeaways.

· Performance Zone
Free Resource

Transform incident management with machine learning and analytics to help you maintain optimal performance and availability while keeping pace with the growing demands of digital business with this eBook, brought to you in partnership with BMC.

The following statistics were sampled by vmlens tracing archiva, a spring web application from apache.

Lesson 1: Almost All Synchronization Locks are Only Used by One Thread

99,99 percent of all locks are only used by one thread. This observation led sun to the “Biased Locking” optimization for this case, see Synchronization in Java SE 6. Please note the logarithmic scale:

lock_statistic

This means if you want to improve the performance of your web application, you should focus on those 0.01 percent of locks.

Lesson 2: The Amount of Synchronization Locks Grows Linear With the Number of Concurrent Accesses

lock_count_to_access

This shows that the different parts of the application have a similar synchronization behaviour. I will collect statistics for other types of applications, to see if they behave similarly.

Lesson 3: The Amount of Data Races Grows Linear With the Number of Concurrent Accesses

data_race_to_access

Similar to lesson 2, this shows that the different parts of the application also have synchronization problems. To make sure that your web application does not behave as the typical web application, use vmlens to get rid of race conditions.

Evolve your approach to Application Performance Monitoring by adopting five best practices that are outlined and explored in this e-book, brought to you in partnership with BMC.

Topics:
java ,concurency ,web dev

Published at DZone with permission of Thomas Krieger, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}