TM1 Parallel Interaction and Multithreading Explained
Before I get started on this subject I must put down a disclaimer that I don’t actually know the exact workings of TM1 especially in regards to Parallel Interaction. I’m relying on research conducted on the subject used in developing Daptech Keystone (Another In-Memory Cube Structured Database).
For reference I’ve used the three basic setups for an Application (These aren’t the only three).
- Single Threaded
- Multithreaded (Using Locks for Synchronization)
- Multithreaded (Using data structures which support Lockless Concurrency)
These can be loosely related to TM1 like so:
- TM1 8.4 and below – Single Threaded
- TM1 9.0 to 9.5 – Multithreaded (Using Locks)
- TM1 9.5 and above – Multithreaded (Lockless)
When the first TM1 version came out which supported Multithreading we heard the crowd roar “It’s slower and it uses more memory!” and even now with what I assume to be a Lockless model (Parallel Interaction) we hear the same. So let me explain what is happening here and in which way the new multithreaded environment is faster.
Take a moment to digest the chart above. The first thing you’ll notice is that without any kind of multithreading (aka Single Threaded) the processing time increases in a linear fashion with the user load.
Lesson 1: Stripping aside all caching and performance enhancing techniques, Two users performing the same action in a single threaded environment will take twice as long as one user would. (Pretty straight forward huh?)
Now take a closer look at the multithreaded lines. You’ll see that they handle multiple users better (in that the trend is no longer so steep), but you can also see that they incur a base processing time penalty in servicing even a single user.
Lesson 2: Multithreading typically incurs its own cost to processing, but unlike the cost of Single Threaded Actions this cost does not (often) increase with additional user load.
With any mechanism, the algorithms are not as straight forward as I have made them appear here. Specific methodologies or Bad Coding can incur their own additional performance degradation.
I would love to hear from IBM on this one as to how close to the mark I’ve hit.
Class dismissed – any questions?