ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Valentin Kulichenko <valentin.kuliche...@gmail.com>
Subject Re: Can't seem to get off-heap memory working right...
Date Thu, 30 Jul 2015 06:22:10 GMT
Correction. It should be:

cache = ignite.getOrCreateCache(myCfg);

(cache name is already specified in configuration)

-Val

On Wed, Jul 29, 2015 at 11:11 PM, Yakov Zhdanov <yzhdanov@apache.org> wrote:

> You created cache configuration, but do not use it. This makes all your
> entries stored onheap.
>
> Pls do:
> cache = ignite.getOrCreateCache("cache", myCfg);
>
> --Yakov
>
> 2015-07-30 4:55 GMT+03:00 javadevmtl <java.dev.mtl@gmail.com>:
>
>> Using Ignite 1.3.0 with Java 1.8_45 on Ubuntu 14.04
>>
>> Writing a micro service using vertx.io. I can't seem to get the
>> performance
>>
>> right with off_heap memory.
>>
>> I have the following cache....
>>
>> private static IgniteCache<String, HashSet&lt;String>> cache;
>>
>> And it's configured as follows during application startup...
>>
>> IgniteConfiguration igniteCfg = new IgniteConfiguration();
>> igniteCfg.setMarshaller(new OptimizedMarshaller(true));
>>
>> CacheConfiguration<String, HashSet&lt;String>> myCfg = new
>> CacheConfiguration<>("cache");
>> myCfg.setCacheMode(CacheMode.PARTITIONED);
>> myCfg.setAtomicityMode(CacheAtomicityMode.ATOMIC);
>> myCfg.setMemoryMode(CacheMemoryMode.OFFHEAP_TIERED);
>> myCfg.setOffHeapMaxMemory(16 * 1024L * 1024L * 1024L);
>> myCfg.setBackups(0);
>>
>> ignite = Ignition.start(igniteCfg);
>> cache = ignite.getOrCreateCache("cache");
>>
>> Inside my "web/http" handler I have...
>>
>> String key = body.getString("key");
>> String value = body.getString("value");
>> HashSet<String> values = cache.get(key);
>>
>> if(values == null)
>> {
>>         values = new HashSet<String>();
>> }
>>
>> values.add(value);
>> cache.put(key, values);
>> myWebHandler.reply(new JsonObject().put(key, values.size()));
>>
>>
>> I start my application with -Xmx1g.
>> At about 2 million records the application becomes extremely slow. I.e: It
>> goes from 12K requests/sec to not even 30 requests/sec.
>>
>> If I start with -Xmx2g then I can go to about double the records (4
>> million)
>> before it gets unresponsive.
>> -Xmx3g can go to 6 million and so on...
>>
>> So it doesn't seem that off-heap is used. I'm I configuring something
>> wrong?
>> Or is off-heap used but it's that much slower?
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://apache-ignite-users.70518.x6.nabble.com/Can-t-seem-to-get-off-heap-memory-working-right-tp759.html
>> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>>
>
>

Mime
View raw message