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

Sensu is an open source monitoring event pipeline. Try it today.

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.

Sensu: workflow automation for monitoring. Learn more—download the whitepaper.

Topics:
java ,concurency ,web dev

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}