SQL Query Performance

classic Classic list List threaded Threaded
2 messages Options
javadevmtl javadevmtl
Reply | Threaded
Open this post in threaded view
|

SQL Query Performance

Running 1.3.0

I start my cache as follows...

IgniteConfiguration igniteCfg = new IgniteConfiguration();
igniteCfg.setMarshaller(new OptimizedMarshaller(true));
igniteCfg.setPeerClassLoadingEnabled(false);
                                                       
CacheConfiguration<Long, Trx> myCfg = new CacheConfiguration<>("cache");
myCfg.setCacheMode(CacheMode.PARTITIONED);
myCfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);
myCfg.setMemoryMode(CacheMemoryMode.OFFHEAP_TIERED);
myCfg.setOffHeapMaxMemory(64 * 1024L * 1024L * 1024L);
myCfg.setIndexedTypes(Long.class, com.xxx.model.Trx.class);
myCfg.setStartSize(50 * 1024 * 1024);
myCfg.setBackups(0);
                                                       

ignite = Ignition.start(igniteCfg);
cache = ignite.getOrCreateCache(myCfg).withAsync();

Then in my web request handler...

Trx trx = new Trx();
// set the the properties...

cache.put(trx.getId(), trx);
cache.future().listen(putFut -> {

        String sql = "SELECT someField FROM Trx WHERE myField = ?";
                                                               
        QueryCursor<List<?>> cursor = cache.query(new SqlFieldsQuery(sql).setArgs(trx.getMyField()));

        String res = "" + cursor.getAll();

        // Get back to vertx context
        context.runOnContext((v) -> {
                myHandler.reply(new JsonObject().put("result", res));
        });
});

The put give us about 9K puts per seconf from 0-10 million records with average put latency of 4ms (this include network time)

Once I add the query it starts off at 3K request per second and slowly decreases with average response time of 45ms (includes network time)




vkulichenko vkulichenko
Reply | Threaded
Open this post in threaded view
|

Re: SQL Query Performance

This thread was accidentally splitted into two parts and continues here: http://apache-ignite-users.70518.x6.nabble.com/Re-Query-performance-td1009.html