# Elasticsearch settings for indexing

**URL:** <https://discuss.elastic.co/t/elasticsearch-settings-for-indexing/119073>\
**Category:** Elasticsearch\
**Created:** [February 8, 2018, 2:52pm UTC](https://discuss.elastic.co/t/elasticsearch-settings-for-indexing/119073 "2018-02-08T14:52:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ivankorobchuk](https://avatars.discourse-cdn.com/v4/letter/i/82dd89/32.png) [@ivankorobchuk](https://discuss.elastic.co/u/ivankorobchuk)\
**Post date:** [February 8, 2018, 2:52pm UTC](https://discuss.elastic.co/t/elasticsearch-settings-for-indexing/119073/1 "2018-02-08T14:52:38Z")

</div>

hi. What are the correct settings of jvm.options and elasticsearch.yml for big data indexing in one sitting? I've got 32G memory and 8 cores. 1 core is used for 100%. In jvm.options settings I have:  
Xms20g  
-Xmx20g  
but indexing speed doesn't increase. What is the problem? How to set everything correctly? Maybe some settings are missing?

jvm.options

```
    ## JVM configuration

################################################################
## IMPORTANT: JVM heap size
################################################################
##
## You should always set the min and max JVM heap
## size to the same value. For example, to set
## the heap to 4 GB, set:
##
## -Xms4g
## -Xmx4g
##
## See https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html
## for more information
##
################################################################

# Xms represents the initial size of total heap space
# Xmx represents the maximum size of total heap space

-Xms15g
-Xmx15g

################################################################
## Expert settings
################################################################
##
## All settings below this section are considered
## expert settings. Don't tamper with them unless
## you understand what you are doing
##
################################################################

## GC configuration
-XX:+UseConcMarkSweepGC
-XX:CMSInitiatingOccupancyFraction=75
-XX:+UseCMSInitiatingOccupancyOnly

## optimizations

# pre-touch memory pages used by the JVM during initialization
-XX:+AlwaysPreTouch

## basic

# force the server VM
-server

# explicitly set the stack size
-Xss1m

# set to headless, just in case
-Djava.awt.headless=true

# ensure UTF-8 encoding by default (e.g. filenames)
-Dfile.encoding=UTF-8

# use our provided JNA always versus the system one
-Djna.nosys=true

# turn off a JDK optimization that throws away stack traces for common
# exceptions because stack traces are important for debugging
-XX:-OmitStackTraceInFastThrow

# flags to configure Netty
-Dio.netty.noUnsafe=true
-Dio.netty.noKeySetOptimization=true
-Dio.netty.recycler.maxCapacityPerThread=0

# log4j 2
-Dlog4j.shutdownHookEnabled=false
-Dlog4j2.disable.jmx=true

## heap dumps

# generate a heap dump when an allocation from the Java heap fails
# heap dumps are created in the working directory of the JVM
-XX:+HeapDumpOnOutOfMemoryError

# specify an alternative path for heap dumps
# ensure the directory exists and has sufficient space
-XX:HeapDumpPath=/var/lib/elasticsearch

## GC logging

#-XX:+PrintGCDetails
#-XX:+PrintGCTimeStamps
#-XX:+PrintGCDateStamps
#-XX:+PrintClassHistogram
#-XX:+PrintTenuringDistribution
#-XX:+PrintGCApplicationStoppedTime

# log GC status to a file with time stamps
# ensure the directory exists
#-Xloggc:${loggc}

# By default, the GC log file will not rotate.
# By uncommenting the lines below, the GC log file
# will be rotated every 128MB at most 32 times.
#-XX:+UseGCLogFileRotation
#-XX:NumberOfGCLogFiles=32
#-XX:GCLogFileSize=128M

Index settings
{
  "test": {
    "settings": {
      "index": {
        "refresh_interval": "36000s",
        "number_of_shards": "5",
        "provided_name": "test",
        "creation_date": "1518012102101",
        "number_of_replicas": "1"
      }
    }
  }
}
```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 8, 2018, 4:10pm UTC](https://discuss.elastic.co/t/elasticsearch-settings-for-indexing/119073/2 "2018-02-08T16:10:17Z")

</div>

Please format your code using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) and not the citation button. It will make your post more readable.

Or use markdown style like:

````
```
CODE
```

````

Please edit your post.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 8, 2018, 4:10pm UTC](https://discuss.elastic.co/t/elasticsearch-settings-for-indexing/119073/3 "2018-03-08T16:10:20Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
