Как я могу заставить apache ignite использовать все ЦП для SQL-запроса? - PullRequest
0 голосов
/ 24 октября 2019

Я делаю Стресс-тестирование SQL для Apache Ingite 2.7.6 на одном узле. Я не могу сделать процессор сервера до 100%, он всегда остается стабильным, когда чашка достигает 80%, независимо от того, сколько запросов выДобавлять. Конфигурация:

<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">
   <!--
                Alter configuration below as needed.
   -->
<bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
   <property name="clientMode" value="false"/>
   <!-- Explicitly enable peer class loading. -->
   <property name="peerClassLoadingEnabled" value="true"/>
     <!-- Consistent globally unique node identifier which survives node restarts. -->
     <!-- Configure internal thread pool. -->
      <property name="discoverySpi"> 
            <bean id="discoverySpi" class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">

               <!-- Initial local port to listen to. -->
           <property name="localPort" value="47500"/>  
           <!-- Changing local port range. This is an optional action. -->
           <property name="localPortRange" value="1"/>  

           <!-- Setting up IP finder for this cluster -->
           <property name="ipFinder">        
               <bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder">
                   <property name="addresses">
                       <list>
                           <value>10.101.1.41</value>
                       </list>
                   </property>
               </bean>
           </property>
           </bean>
      </property>

     <property name="longQueryWarningTimeout" value="20"/>
     <property name="queryThreadPoolSize" value="16"/>
   <property name="publicThreadPoolSize" value="16"/>
   <property name="systemThreadPoolSize" value="16"/>
   <property name="serviceThreadPoolSize" value="16"/>
   <property name="stripedPoolSize" value="16"/>
    <property name="dataStreamerThreadPoolSize" value="16"/>
    <!-- property name="rebalanceThreadPoolSize" value="1"/ -->
   <property name="authenticationEnabled" value="true"/>

    <property name="clientConnectorConfiguration">
       <bean class="org.apache.ignite.configuration.ClientConnectorConfiguration">
           <property name="host" value="10.101.1.41"/>
           <property name="port" value="12800"/>
           <property name="portRange" value="1000"/>
           <property name="maxOpenCursorsPerConnection" value="2000"/>
                 <property name="socketSendBufferSize" value="65536"/>
                 <property name="socketReceiveBufferSize" value="131072"/>
                 <property name="threadPoolSize" value="16"/>
                   </bean>
   </property>
       <property name="consistentId" value="TEST1"/>
       <property name="dataStorageConfiguration">
           <bean class="org.apache.ignite.configuration.DataStorageConfiguration">
               <property name="walSegmentSize" value="#{1L * 1024 * 1024 * 1024}"/>
          <property name="writeThrottlingEnabled" value="true"/>
                 <property name="concurrencyLevel" value="8"/>
                 <property name="pageSize" value="8192"/>
                   <property name="walCompactionEnabled" value="true" />
         <property name="walCompactionLevel" value="6" />

               <!-- Redefining the default region's settings -->
               <property name="defaultDataRegionConfiguration">
                   <bean class="org.apache.ignite.configuration.DataRegionConfiguration">
                               <property name="name" value="20GB_Region"/>
                           <property name="initialSize" value="#{500L * 1024 * 1024}"/>
                       <property name="maxSize" value="#{10L * 1024 * 1024 * 1024}"/>
                       <property name="persistenceEnabled" value="true"/>
                      <property name="checkpointPageBufferSize"  value="#{4 * 1024 * 1024 * 1024}"/>   
                      <property name="evictionThreshold" value="0.95" />
                       <property name="metricsEnabled" value="true"/>
                       <property name="metricsRateTimeInterval" value="10000"/>
                       <property name="metricsSubIntervalCount" value="1024"/>   
                   </bean>
               </property>
               <!-- <property name="storagePath" value="D:\\Test\\db" /> -->
               <property name="storagePath" value="/home/igniteTT/ignite/data/db" />
               <!-- <property name="walPath" value="D:\\Test\\db\\wal" /> -->
               <property name="walPath" value="/home/igniteTT/ignite/data/wal" />
               <!-- <property name="walArchivePath" value="D:\\Test\\db\\wal\\archive" /> -->
               <property name="walArchivePath" value="/home/igniteTT/ignite/data/archive" />
                <property name="walMode" value="LOG_ONLY"/>
           </bean>
       </property>

   <property name="odbcConfiguration">
     <bean class="org.apache.ignite.configuration.OdbcConfiguration">
                 <property name="maxOpenCursors" value="512"/>
                 <property name="threadPoolSize" value="16"/>  
     </bean>
   </property>

   <property name="cacheConfiguration">
      <list>
              <bean class="org.apache.ignite.configuration.CacheConfiguration">
                     <property name="name" value="PUBLIC"/>
                     <property name="cacheMode" value="PARTITIONED"/>
                     <property name="atomicityMode" value="TRANSACTIONAL"/>
                     <property name="writeSynchronizationMode" value="FULL_ASYNC"/>

                    <property name="onheapCacheEnabled" value="true"/>
                          <property name="evictionPolicy">
                               <!-- LRU eviction policy. -->
                               <bean class="org.apache.ignite.cache.eviction.lru.LruEvictionPolicy">
                                 <property name="maxSize" value="1000000"/>
                               </bean>
                          </property>
                   <property name="sqlOnheapCacheEnabled" value="true"/>
                   <property name="queryParallelism" value="16"/>
                   <property name="maxQueryIteratorsCount" value="4096"/>
                    <property name="maxConcurrentAsyncOperations" value="1000"/>
                   <property name="queryDetailMetricsSize" value="0"/>
                 <property name="rebalanceMode" value="SYNC"/>
                 <property name="rebalanceBatchSize" value="#{2 * 1024 * 1024}"/>
                 <!-- Set throttle interval. -->
                 <property name="rebalanceThrottle" value="100"/>
                 <property name="dataRegionName" value="20GB_Region"/>

                     <property name="queryEntities">
                       <list>
                         <bean class="org.apache.ignite.cache.QueryEntity">
                           <property name="keyType" value="java.lang.Long"/>
                           <property name="keyFieldName" value="BAL_ID"/>
                           <property name="valueType" value="BAL"/>
                           <property name="fields">
                             <map>
                               <entry key="BAL_ID" value="java.lang.Long"/>
                               <entry key="ACCT_ID" value="java.lang.Integer"/>
                               <entry key="ACCT_RES_ID" value="java.lang.Integer"/>
                             <entry key="EFF_DATE" value="java.sql.Timestamp"/>
                             <entry key="EXP_DATE" value="java.sql.Timestamp"/>
                             <entry key="UPDATE_DATE" value="java.sql.Timestamp"/>
                               <entry key="GROSS_BAL" value="java.lang.Long"/>       
                               <entry key="RESERVE_BAL" value="java.lang.Long"/>
                               <entry key="CONSUME_BAL" value="java.lang.Long"/>
                               <entry key="RATING_BAL" value="java.lang.Long"/>
                               <entry key="BILLING_BAL" value="java.lang.Long"/>
                               <entry key="LAST_BAL" value="java.lang.Long"/>
                               <entry key="INIT_BAL" value="java.lang.Long"/>
                               <entry key="CEIL_LIMIT" value="java.lang.Long"/>
                               <entry key="DAILY_CEIL_LIMIT" value="java.lang.Long"/>
                               <entry key="VAR_CEIL_LIMIT" value="java.lang.Long"/>
                               <entry key="FLOOR_LIMIT" value="java.lang.Long"/>
                               <entry key="DAILY_FLOOR_LIMIT" value="java.lang.Long"/>
                               <entry key="VAR_CELL_LIMIT" value="java.lang.Long"/>
                               <entry key="PRIORITY" value="java.lang.Integer"/>
                               <entry key="BAL_USED"  value="java.lang.Integer"/>
                               <entry key="RESERVE_IN" value="java.lang.Long"/>
                               <entry key="RESERVE_PS"  value="java.lang.Long"/>
                               <entry key="LAST_RECHARGE" value="java.lang.Long"/>
                               <entry key="SUBS_ID"  value="java.lang.Long"/>
                               <entry key="IS_USED" value="java.lang.Long"/>
                               <entry key="RATIO"  value="java.lang.Long"/>
                             </map>
                           </property>

                           <property name="indexes">
                               <list>
                                   <bean class="org.apache.ignite.cache.QueryIndex">
                                       <constructor-arg value="BAL_ID"/>
                                   </bean>
                               </list>
                           </property>
                         </bean>
                       </list>
                     </property>
           </bean>
      </list>
   </property>
 <property name="communicationSpi">
   <bean class="org.apache.ignite.spi.communication.tcp.TcpCommunicationSpi">
       <property name="localPort" value="48100"/>
       <property name="ackSendThreshold" value="512"/>
     <property name="slowClientQueueLimit" value="50000000"/>
   </bean>
 </property>
</bean>
</beans>

, а метрики сервера

[16:16:20,931][INFO][grid-timeout-worker-#39][IgniteKernal] 
Metrics for local node (to disable set 'metricsLogFrequency' to 0)
    ^-- Node [id=6ba8f92a, uptime=00:06:00.051]
    ^-- H/N/C [hosts=1, nodes=1, CPUs=8]
    ^-- CPU [cur=73.4%, avg=8.9%, GC=1.5%]
    ^-- PageMemory [pages=90]
    ^-- Heap [used=2878MB, free=59.4%, comm=3300MB]
    ^-- Off-heap [used=0MB, free=99.99%, comm=10540MB]
    ^--   sysMemPlc region [used=0MB, free=99.96%, comm=100MB]
    ^--   metastoreMemPlc region [used=0MB, free=99.92%, comm=100MB]
    ^--   20GB_Region region [used=0MB, free=99.99%, comm=10240MB]
    ^--   TxLog region [used=0MB, free=100%, comm=100MB]
    ^-- Ignite persistence [used=0MB]
    ^--   sysMemPlc region [used=0MB]
    ^--   metastoreMemPlc region [used=unknown]
    ^--   20GB_Region region [used=0MB]
    ^--   TxLog region [used=0MB]
    ^-- Outbound messages queue [size=0]
    ^-- Public thread pool [active=0, idle=0, qSize=0]
    ^-- System thread pool [active=0, idle=6, qSize=0]

. Существуют ли какие-либо конфигурации, контролирующие максимальное использование процессора? Помощь высоко ценится,

1 Ответ

1 голос
/ 24 октября 2019

Я не думаю, что вы должны ожидать 100% загрузки ЦП при работе с постоянством, но я рекомендую увеличить queryParallelism для кешей ваших таблиц SQL до примерно 16. Это должно распараллелить работу с индексами. Также может помочь увеличение других пулов потоков (больше 16, как показано).

...