308
Depending on your familiarity with the code and how it works with production
workloads, knowing which data structures and objects to store in the different memory/
storage tiers may be simple. Should those data structures and objects be volatile or
persisted? To help with searching for potential candidates, tools such as VTune Profiler
can identify objects with the most last-level cache (LLC) misses. The intent is to identify
what data structures and objects the application uses most frequently and ensure they
are placed in the fastest media appropriate to their access patterns. For example, an
object that is written once but read many times is best placed in DRAM. An object that
is updated frequently that needs to be persisted should probably be moved to persistent
memory rather than traditional storage devices.
You must also be mindful of memory-capacity constraints. Tools such as VTune
Profiler can help determine approximately how many hot objects will fit into the
available DRAM. For the remaining objects that have fewer LLC misses or that are too
large to allocate from DRAM, you can put them in persistent memory. These steps will
ensure that your most accessed objects have the fastest path to the CPU (allocated in
DRAM), while the infrequently accessed objects will take advantage of the additional
persistent memory (as opposed to sitting out on a much slower storage devices).
Another consideration for optimizations is the load/store ratio for object accesses. If
your persistent memory hardware characteristics are such that load/read operations are
much faster than stores/writes, this should be taken into account. Objects with a high
load/store ratio should benefit from living in persistent memory.
There is no hard rule for what constitutes a frequent vs. infrequently accessed object.
Although behaviors are application dependent, these guidelines give a starting point for
choosing how to allocate objects in persistent memory. After completing this process,
start profiling and tuning the application to further improve the performance with
persistent memory.
Memory Access Optimization
The common techniques for optimizing cache performance on DRAM-only platforms
also apply to persistent memory platforms. Concepts like cache-miss penalties and
spatial/temporal data locality are important for performance. Many tools can collect
performance data for caches and memory. VTune Profiler has predefined metrics for
each level of the memory hierarchy, including Intel Optane DC persistent memory
shown in Figure 15-9.
Chapter 15 profiling and performanCe
Précédent

- 332/457

Suivant