Java 运行并行Spring批处理分区的线程数量减少

Java 运行并行Spring批处理分区的线程数量减少,java,spring,spring-batch,Java,Spring,Spring Batch,我在Windows中实现了Spring批处理本地步骤分区,网格大小为15,corepoolsize和maxPoolsize为10,因此当我执行它时,有10个线程并行执行(数据大小为100万条记录,它在50秒内完成,8 GB RAM配置) 我想用更多的数据执行jar,所以我们在linux上用1000万个相同配置的数据(网格大小15,池大小10)执行jar,但只从一个线程开始,然后过了一段时间,它就启动了另外两个线程,以此类推。linux机器的服务器配置超过100GB的RAM(数据大小为1000万,

我在Windows中实现了Spring批处理本地步骤分区,网格大小为15,corepoolsize和maxPoolsize为10,因此当我执行它时,有10个线程并行执行(数据大小为100万条记录,它在50秒内完成,8 GB RAM配置)

我想用更多的数据执行jar,所以我们在linux上用1000万个相同配置的数据(网格大小15,池大小10)执行jar,但只从一个线程开始,然后过了一段时间,它就启动了另外两个线程,以此类推。linux机器的服务器配置超过100GB的RAM(数据大小为1000万,大约需要16分钟才能完成,我觉得速度非常慢)。理想情况下,根据我的配置,10个线程应该并行运行,我感到困惑

xml配置为:

<batch:step id="step6">
    <batch:partition step="loadFlatFiles" partitioner="multiFileResourcePartitioner">
                <batch:handler grid-size="15" task-executor="loadCustomerTaskExecutor" />
    </batch:partition>
</batch:step>

<bean id="loadCustomerTaskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
<property name="corePoolSize" value="10" />
<property name="maxPoolSize" value="10" />
<property name="allowCoreThreadTimeOut" value="true" />
</bean>

<batch:step id="loadFlatFiles">
  <batch:tasklet>
      <batch:chunk reader="masterFileItemReader" writer="masterFileWriter" processor="itemProcessor" commit-interval="5000" skip-limit="1000000" >
          <batch:skippable-exception-classes>
            <batch:include class="org.springframework.batch.item.file.FlatFileParseException"/>
          </batch:skippable-exception-classes>
          <batch:listeners>
            <batch:listener ref="recordSkipListener"/>
        </batch:listeners>
    </batch:chunk>
  </batch:tasklet>
</batch:step>

<bean id="recordSkipListener" class="com.cdi.batch.listener.RecordSkipListener" scope="step">
</bean>

<bean id="multiFileResourcePartitioner" class="com.cdi.batch.partitioner.MultiFileResourcePartitioner"
scope="step">
<property name="keyName" value="fileResource" />
<property name="fileName" value="fileName" />
<property name="directory" value="file:${input.files.location}" />
</bean>

有人面临同样的问题吗?我想知道为什么会这样

更新:用于将我正在使用的作业相关元数据存储在内存中

<!-- stored job-meta in memory -->
<bean id="jobRepository"
    class="org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean">
    <property name="transactionManager" ref="transactionManager" />
</bean>


代码是使用Java 6和Spring batch 3实现的。

这似乎是Linux JVM或某些配置的问题。用于在您的服务器上运行批处理的JVM版本是什么?此链接有助于理解线程数量少且启动速度慢的原因,感谢您的链接。。我会调查这个。。。顺便说一句,我在linux上使用JDK 6。在谷歌搜索时,我发现在linux上可以设置最大线程限制(在操作系统级别)。您可以尝试在服务器中找出此限制的值,并要求更多。