Teiid MemoryBuffer: memory management and swap
jduke123 Nov 2, 2015 4:28 AMHi everyone,
I'll start with explaining the scenario.
I need to fill a target DB (postgresql9.4) with data coming from different sources.
DV is installed on a RHEL7. I am using the 8.7.1 version.
I need to move data on day schedule, thus the total amount of data may not be particularly a problem.
What it concernes me is the worst case scenario in which I need to align all table, and it needs to be done in the fastest way possible.
I invoke Virtual Procedures for moving data. Basically each one is an insert query from a select in a time frame.
I have assigned to DV JVM up to 8G.
Other parameters that I have changed are written below (fisrt configuration, second configuration)
### Memory Management
buffer-service-max-reserve-kb : -1 6291456
buffer-service-max-processing-kb : -1 204800
buffer-service-max-file-size : 2048 32
### Scalability
buffer-service-processor-batch-size : 256 1024
buffer-service-max-storage-object-size : 8388608 16777216
### Disk Usage
buffer-service-max-buffer-space : 500 500
The 500MB for disk space derives from the size of the partition where I have installed DV.
I can increase the size of the partition but I would like to do that if it is the only way for my scenario.
I tried whith default teiid-cache definition and the configuration below:
<cache-container name="teiid-cache" default-cache="resultset">
<local-cache name="resultset-repl" batching="true">
<locking isolation="READ_COMMITTED"/>
<transaction mode="NON_XA"/>
<eviction strategy="LRU" max-entries="204800"/>
<expiration lifespan="7200000"/>
</local-cache>
<local-cache name="resultset" batching="true">
<locking isolation="READ_COMMITTED"/>
<transaction mode="NON_XA"/>
<eviction strategy="LRU" max-entries="20480"/>
<expiration lifespan="720000"/>
</local-cache>
<local-cache name="preparedplan" batching="true">
<locking isolation="READ_COMMITTED"/>
<eviction strategy="LIRS" max-entries="5120"/>
<expiration lifespan="28800"/>
</local-cache>
</cache-container>
I tested with 12 active plans.
In all configurations I reached a point where the buffer get to the top of disk memory and it starts to abort exceeding plans.
From documentation I have not yet understood:
1. when teiid-buffer decides to swap?
2. how it decides the amount of RAM to use?
3. does the teiid-cache is involved in this kind of transaction?
4. is there a way to pause or queue exceeding plans insted of aborting them?
Thank you,
AC