memory footprint of teiid representation of records relative to rdbms
rupeshsingh01 Jul 28, 2015 8:55 AMHi all,
I am trying to evaluate the memory footprints of teiid embedded runtime representation of data from a rdbms source. It will help in capacity planning.
I am doing as below:
public static void main(String[] args) throws Exception {
TeiidEmbeddedStopIt teiidEmbedded = new TeiidEmbeddedStopIt();
DataSource ds = EmbeddedHelper.newDataSource("org.h2.Driver", "jdbc:h2:tcp://localhost/~/test", "sa", null);
memory("PROGRAM STARTED ");
EmbeddedServer server = new EmbeddedServer();
H2ExecutionFactory executionFactory = new H2ExecutionFactory() ;
executionFactory.setSupportsDirectQueryProcedure(true);
executionFactory.start();
server.addTranslator("translator-h2", executionFactory);
server.addConnectionFactory("java:/example-ds", ds);
EmbeddedConfiguration config = new EmbeddedConfiguration();
config.setTransactionManager(EmbeddedHelper.getTransactionManager());
server.start(config);
memory("TEEID SERVER STARTED ");
server.deployVDB(new FileInputStream(new File("xxxx")));
memory("TEEID VDB DEPLOYED ");
teiidEmbedded.queryHoldings(server);
}
public void queryHoldings(EmbeddedServer server ) throws Exception{
long start = System.currentTimeMillis();
memory("getting connection etc");
MyDataSource source = new MyDataSource(server);
JdbcTemplate template = new JdbcTemplate(source);
memory("QUERY to be performed ");
List<Map<String, Object>> listOfMap = template.queryForList("select * from HoldingsData");
memory("QUERY PERFORMED ");
System.out.println("Time Taken in retrieving data = " + (System.currentTimeMillis()-start));
System.out.println("no of records retrieved = " +listOfMap.size());
System.out.println("records retrieved = " +listOfMap);
counter++;
System.out.println("counter = "+counter);
}
memory unit is MB | memory used when TEIID server started | consumed memory in TEIID Embedded Runtime(after VDB deployment) | size of runtime when query on vdb to be performed | size of runtime when query on vdb performed | size of data in database | memory representation of data in TEIID Runtime |
case 1 (with joins) | 22 | 24 | 23 | 24 | 0.00125 | 1 |
case 2 (without join) | 22 | 24 | 23 | 88 | 1.1388 | 65 |
case1: | Note: 41 records are retrieved from database using simple joins among 4 tables. Each record is around 32 bytes. | |||||
32*41=1312 bytes = 0.00125122 MB | ||||||
case 2: | 199028 object (each of size 6 bytes) |
inconsistent results are coming.
Can anyone tell the memory representation of data in TEIID Runtime ? Is there any other way to evaluate it? it would help in capacity planning. Any suggestion/pointer is welcome.