Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 210563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:01:00+00:00 2026-05-11T18:01:00+00:00

I am just learning how to use Terracotta after discovering it about a month

  • 0

I am just learning how to use Terracotta after discovering it about a month ago. It is a very cool technology.

Basically what I am trying to do:

My root (System of Record) is a ConcurrentHashMap.

The main Instrumented Class is a “JavaBean” with 30 or so fields that I want to exist in the HashMap.

There will be about 20000 of these JavaBeans that exist in the Hashmap.

Each bean has (at least) 5 fields that will be updated every 5 seconds.

(The reason I am using Terracotta for this is because these JavaBeans need to be accessible across JVMs and nodes.)

Anyone with more experience than me with TC have any tips? Performance is key.

Any examples other similar applications?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T18:01:00+00:00Added an answer on May 11, 2026 at 6:01 pm

    You might find that batching several changes under one lock scope will perform better. Each synchronized block/method forms a write transaction (assuming you use a write lock) that must be sent to the server (and possibly back out to other nodes). By changing a bunch of fields, possibly on a bunch of objects under one lock, you reduce the overhead of creating a transaction. Something to play with at least.

    Partitioning is also a key way to improve performance. Changes only need to be sent to nodes that are actually using an object. So if you can partition which nodes usually touch specific objects that reduces the number of changes that have to be sent around the cluster, which improves performance.

    unnutz’s suggestions about using CHM or CSM are good ones. CHM allows greater concurrency (as each internal segment can be locked and used concurrently) – make sure to experiment with larger segment counts too. CSM has effectively one lock per entry so has effectively N partitions in an N-sized table. That can greatly reduce lock contention (at the cost of managing more internal lock objects). Changes coming soon for CSM will make the lock mgmt cost much lower.

    Generally we find a good strategy is:

    1. Build a performance test (should be multi-threaded and multi-node and similar to your app (or your actual app!)
    2. Tune objects – look at your clustered object graph in the dev-console to find objects that don’t need to be clustered at all – sometimes this happens accidentally (remove or cut the cluster with a transient field). Sometimes you might be clustering a Date where a long would do. Small change but that’s one object per map entry and that might make a difference.
    3. Tune locks – use the lock profiler in the dev-console to find hot locks or locks that are too narrow or too wide. The clustered stats recorder can help look at transaction size as well.
    4. Tune GC and DGC – tune JVM garbage collection, then tune Terracotta distributed GC by turning on changing the frequency of young gen gc.
    5. Tune TC server – lots of very detailed tunings to do here, but usually not worth it till the stuff above is tuned.

    Feel free to ask on the Terracotta forums as well – all of engineering, field engineering, product mgmt watch those and answer there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am just learning vhdl, and am trying to use a 3-input nand gate.
I'm just learning CSS fluid layouts & responsive design, and I'm trying to use
I am just learning about what a web service is and how to use
I've just started learning how to use the Entity Framework to write a very
I'm just learning about F# and plan to use it for my next project.
I'm just learning how to use the C4 framework and trying to add gestures
I'm just learning about AsyncTask and want to use it as a separate class,
I am just learning to use Services, and am sort of stuck. I have
I'm just learning to use lazy sequences in Clojure, and I'm not sure what
I'm just learning how to use iterators over vectors, and I'm having some trouble

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.