High CPU and Memory Usage

Hi,

I've setup Elasticsearch and Kibana on Docker. For testing purpose, I've used "eCommerce Dashboard" example from Kibana(which has one index and almost 5,000 documents.). My Ubuntu server shows me Elasticsearch uses arange 20% to 200% CPU and 25% to 75% memory.

We've used Elasticsearch and like it. If it's possible, we'd like to stick with Elasticsearch and not searching another solution. Since it's a Java application, it might use memory but I do not think it use that much for only one index and 5,000 documents.

System (It's a virtualbox server.)

  • Ubuntu Server 20.04
  • 2 CPU
  • 4 GB Ram
  • 50 GB HDD

Versions

  • Elasticsearch 7.11.1
  • Kibana 7.11.1
  • Docker 19.03

Tests

  • When I open Kibana dashboard, its CPU usage increases between 100-250%
  • When it's stable(There is no operation, no write/queriying), it uses 50% memory and 5-50% CPU
  • I've deleted all indices and dashboards but Elasticsearch uses stabil 2-20% CPU and 30-35% RAM. It doesn't make sense...

Health Check

ip         heap.percent ram.percent cpu load_1m load_5m load_15m node.role  master name
172.19.0.2           45          80  18    0.71    0.67     0.54 cdhilmrstw *      hex-es-node1
{
  "cluster_name" : "hex-es-cluster1",
  "status" : "green",
  "timed_out" : false,
  "number_of_nodes" : 1,
  "number_of_data_nodes" : 1,
  "active_primary_shards" : 7,
  "active_shards" : 7,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 0,
  "delayed_unassigned_shards" : 0,
  "number_of_pending_tasks" : 0,
  "number_of_in_flight_fetch" : 0,
  "task_max_waiting_in_queue_millis" : 0,
  "active_shards_percent_as_number" : 100.0
}

Docker Compose File

  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.11.1
    container_name: elasticsearch-server
    ports:
      - 9200:9200
      - 9300:9300
    environment:
      cluster.name: "hex-es-cluster1"
      node.name: "hex-es-node1"
      discovery.type: single-node
      xpack.security.enabled: "false"
    networks:
      - monitoring-network
    volumes:
      - elasticsearch-data:/usr/share/elasticsearch/data
  kibana:
    image: docker.elastic.co/kibana/kibana:7.11.1
    container_name: kibana-server
    ports:
      - 5601:5601
    environment:
      ELASTICSEARCH_HOSTS: http://elasticsearch-server:9200
    networks:
      - monitoring-network
    depends_on:
      - elasticsearch

Some monitoring would probably be helpful here — it's built into the Elasticsearch and Kibana. In the Kibana menu, you have a heart-like icon where you can enable monitoring (additional docs: Collecting monitoring data using legacy collectors | Elasticsearch Reference [7.11] | Elastic).

If you enable that and share the results, we should be able to get a better idea what is going on with the cluster and where it's actually spending CPU and memory.

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