B Capacity Planning

Size distributed session storage from measured session graphs, concurrency, backups and operational reserve.

To find the number of cache servers that you will need, you must first calculate the application's heap requirements and the cache server's available tenured generation.

  1. Calculate your application's total heap requirements.

    When trying to determine the number of cache servers that you will need for your application, a good starting point is to determine your application's total heap requirements. The total heap requirement can be calculated as the number of sessions that you will run, multiplied by the average number of cached objects per session, multiplied by average number of bytes per cached object. Because you typically make one backup copy per cache entry, multiply the total by 2. Written as an equation, this becomes:

    Total_Heap_Requirement = 2 * (Number_of_Sessions) * (Average_Number_of_Cached_Objects per Session) * (Average_Number_of_Bytes per Cached_Object)
    

    The units of measure for Total_Heap_Requirement are bytes. The Average_Number_of_Bytes per Cached_Object, means the number of bytes in the serialized byte stream of primary copies only. Note that this equation does not address unserialized object size. Space requirements for backup copies are accounted for separately.

  2. Calculate the available tenured generation in a cache server JVM.

    The available tenured generation is a function of the maximum heap size allocation and other user-specified JVM heap-sizing parameters. Another factor in the available tenured generation is the percentage of the heap that is available for storage. Typically, 66% is used as the maximum percentage of the heap available for storage, but this figure might be too low for your system. Make it a variable:

    Percent_of_Heap_Available_for_Storage = 0.66
    
    Available_Tenured_Generation = (Maximum_Heap_Size) * (Percent_of_Heap_Available_for_Storage)
    
  3. Calculate the number of cache servers that will be needed.

    To calculate the number of cache servers that will be needed, divide the total heap requirement by the available tenured generation.

    Number_of_Cache_Servers = (Total_Heap_Requirement / Available_Tenured_Generation)

The formulas below are historical illustrations with simplifying assumptions. Use Sizing Modern Session Storage to choose current deployment capacity; neither the two-copy factor nor the 0.66 heap fraction is a required default.

Sizing Modern Session Storage

Use workload measurements and failure reserve instead of fixed heap fractions or one session-size average.

Measure actual serialized session graphs, attribute update rates, backups and local front/overflow caches. Include application framework state, indexes, service queues, serialization buffers and JVM/native overhead.

  • Start from a representative distribution of session sizes and concurrency, not only the mean. Measure p95/p99 large attributes and short bursts.
  • Account for the configured number of primary/backup copies, storage-member failure/redistribution reserve and the selected backing-map implementation. The historical factor of two assumes one primary plus one backup; it is not universal.
  • Measure the selected Java 21 collector and heap/native use under session creation, updates, failover and reaper catch-up. A fixed 66 percent heap-storage fraction is an illustrative older sizing assumption, not a modern collector requirement.
  • Set alerts for cache/overflow growth, GC pauses, allocation, network, storage and reaper backlog. Re-test the largest expected outage/catch-up window.
  • Avoid eviction as a substitute for an intentional session lifetime policy. Validate the user-visible behavior of any configured memory ceiling or serialization fallback.

For service/storage resource tuning use Performance Tuning.