Hi,

In default WAL mode each cache put() is fsynced to the disk, which causes a
major performance penalty.
You can do either: batch your updates using putAll or using a data streamer.

BTW, how do you insert data to postgres?

2017-10-04 14:32 GMT+03:00 Dmitry Pryakhin <dmitry.pryak...@nextmail.ru>:

> Dear colleagues,
>
> I consider using Ignite, and now do some testing. Cache performance test
> has
> shown ridiculously low performance. Same test was done against PostgreSQL
> on
> the same computer, with much better result. Now I'm trying to figure out if
> it's supposed to work that way, or maybe I've done something wrong. Could
> anyone verify my tesging approach and configuration? Details are below.
>
>
> Task: insert 10000 items; keys and values are strings.
>
> Environment: Intel, Windows, Oracle JRE 1.8.
>
> Configuration 1: Ignite 2.2, 1 server node and 1 client node deployed on
> the
> same computer, both have default configuration. In-memory cache.
> Average execution time = 1.95 sec.
>
> Configuration 2: Ignite 2.2, 1 server node and 1 client node, deployed on
> the same computer. A persistent cache was set up in the server
> configuration
> file.
> Best execution time = 510 sec.
>
> Configuration 3: PosgtreSQL, deployed on the same computer as the client.
> Average execution time = 3 sec.
>
> Server configuration file for configuration 2:
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans";
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>        xsi:schemaLocation="
>        http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd";>
>
>     <bean id="grid.cfg"
> class="org.apache.ignite.configuration.IgniteConfiguration">
>           <property name="persistentStoreConfiguration">
>             <bean
> class="org.apache.ignite.configuration.PersistentStoreConfiguration"/>
>           </property>
>           <property name="cacheConfiguration">
>                 <bean class="org.apache.ignite.configuration.
> CacheConfiguration">
>                         <property name="name" value="CacheOne"/>
>                 </bean>
>           </property>
>     </bean>
> </beans>
>
>
> Client code:
>
> public class PopulateMap {
>         private static final char[] LETTERS = {'a', 'b', 'c', 'd', 'e',
> 'f', 'g',
> 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'x',
> 'y', 'z'};
>         private static final int L_SIZE = LETTERS.length;
>
>         public static void main(String argv[]) throws Exception {
>                 Ignition.setClientMode(true);
>
>                 int idx0 = 0, idx1 = 0, idx2 = 0;
>                 StringBuilder bf = new StringBuilder();
>
>                 try (Ignite ignite = Ignition.start("default-config.xml"))
> {
>                         ignite.active(true);
>
>                         CacheConfiguration<String, String> cacheConf = new
> CacheConfiguration<>("CacheOne");
>                         Cache<String, String> cache =
> ignite.getOrCreateCache(cacheConf);
>                         cache.clear();
>
>                         long start = System.currentTimeMillis();
>
>                         for (int i = 1; i <= 10000; i++) {
>                                 bf.setLength(0);
>                                 bf.append(LETTERS[idx0]).
> append(LETTERS[idx1]).append(LETTERS[idx2]);
>
>                                 if (++idx2 == L_SIZE) {
>                                         idx2 = 0;
>                                         if (++idx1 == L_SIZE) {
>                                                 idx1 = 0;
>                                                 if (++idx0 == L_SIZE) {
>                                                         idx0 = 0;
>                                                 }
>                                         }
>                                 }
>
>                                 cache.put(String.valueOf(i),
> bf.toString());
>                         }
>                         long end = System.currentTimeMillis();
>                         System.out.println("=== Execution time is " + (end
> - start) + " ms.");
>                 }
>         }
> }
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Reply via email to