Elasticsearch Optimization for Performance

---

version: "3.4"
services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.3.2
    environment:
      - cluster.name=x-cloud
      - http.cors.enabled=true
      - http.cors.allow-origin=*
      - http.max_content_length=500mb 
      - ES_JAVA_OPTS=-Xms31g -Xmx31g
      - TAKE_FILE_OWNERSHIP=true
      - "discovery.zen.ping.unicast.hosts=elasticsearch,elasticsearch2,elasticsearch3"
      - "discovery.zen.minimum_master_nodes=2"
    volumes:
      - esdata1:/usr/share/elasticsearch/data
    ports:
      - target: 9200
        published: 9200
        protocol: tcp
        mode: host
    deploy:
      endpoint_mode: dnsrr
      mode: 'global'
      update_config:
        parallelism: 2
        delay: 10s
      restart_policy:
        condition: on-failure
      placement:
        constraints:
          - node.labels.name == pamela
    restart: always
    networks:
      x-net:
        aliases:
         - elasticsearch
  elasticsearch2:
    image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.3.2
    environment:
      - cluster.name=x-cloud
      - http.cors.enabled=true
      - http.cors.allow-origin=*
      - http.max_content_length=500mb 
      - ES_JAVA_OPTS=-Xms31g -Xmx31g
      - TAKE_FILE_OWNERSHIP=true
      - "discovery.zen.ping.unicast.hosts=elasticsearch,elasticsearch2,elasticsearch3"
      - "discovery.zen.minimum_master_nodes=2"
    volumes:
      - esdata2:/usr/share/elasticsearch/data
    deploy:
      endpoint_mode: dnsrr
      update_config:
        parallelism: 2
        delay: 10s
      restart_policy:
        condition: on-failure
      placement:
        constraints:
          - node.labels.name == florence
    networks:
      x-net:
        aliases:
         - elasticsearch2
  elasticsearch3:
    image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.3.2
    environment:
      - cluster.name=x-cloud
      - http.cors.enabled=true
      - http.cors.allow-origin=*
      - http.max_content_length=500mb
      - ES_JAVA_OPTS=-Xms31g -Xmx31g
      - TAKE_FILE_OWNERSHIP=true
      - "discovery.zen.ping.unicast.hosts=elasticsearch,elasticsearch2,elasticsearch3"
      - "discovery.zen.minimum_master_nodes=2"
    volumes:
      - esdata3:/usr/share/elasticsearch/data
    deploy:
      endpoint_mode: dnsrr
      update_config:
        parallelism: 2
        delay: 10s
      restart_policy:
        condition: on-failure
      placement:
        constraints:
          - node.labels.name == sakina
    networks:
      x-net:
        aliases:
         - elasticsearch3
networks:
  x-net:
    external:
      name: x-net
volumes:
  esdata1:
    driver: local
  esdata2:
    driver: local
  esdata3:
    driver: local

I am testing the above configuration on three machines. NUM_OF_SHARDS=2 & NUM_OF_REPLICAS=2. The search performance is brilliant, but indexing performance has been really slow. Is there something I can do to improve performance (without removing replicas).
30s

i.e I have set the refresh_interval to 30s and notice it's a bit more performant. Is there anything else I am missing ?

I do have a single node cluster (same config above) that performs well, but I suspect clustering is making the nodes do more work.

Thanks in advance for any help

What is the specification of the hardware this cluster is running on? What type of storage do you have backing in (local SSD, local spinning disk, SAN...)? What level of indexing and querying are you seeing?

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