Elasticsearch Hight used CPU

Hello everybody,

I have a question about elasticsearch and logstash.

At the resource levels I find that elasticsearch and logtash use too much CPU and I wonder if like filebeat and its max_procs: it is possible to do the same with elasticsearch and logstash to limit the use of the cpu by heart

What is the output from the _cluster/stats API?

Here is the return of the command

{
  "_nodes" : {
    "total" : 1,
    "successful" : 1,
    "failed" : 0
  },
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "je_KxzTITQCb3FwNjpQtUw",
  "timestamp" : 1604493709402,
  "status" : "yellow",
  "indices" : {
    "count" : 29,
    "shards" : {
      "total" : 30,
      "primaries" : 30,
      "replication" : 0.0,
      "index" : {
        "shards" : {
          "min" : 1,
          "max" : 2,
          "avg" : 1.0344827586206897
        },
        "primaries" : {
          "min" : 1,
          "max" : 2,
          "avg" : 1.0344827586206897
        },
        "replication" : {
          "min" : 0.0,
          "max" : 0.0,
          "avg" : 0.0
        }
      }
    },
    "docs" : {
      "count" : 43794962,
      "deleted" : 8142
    },
    "store" : {
      "size_in_bytes" : 44321937455,
      "reserved_in_bytes" : 0
    },
    "fielddata" : {
      "memory_size_in_bytes" : 0,
      "evictions" : 0
    },
    "query_cache" : {
      "memory_size_in_bytes" : 143944,
      "total_count" : 17512,
      "hit_count" : 763,
      "miss_count" : 16749,
      "cache_size" : 16,
      "cache_count" : 132,
      "evictions" : 116
    },
    "completion" : {
      "size_in_bytes" : 0
    },
    "segments" : {
      "count" : 246,
      "memory_in_bytes" : 7303912,
      "terms_memory_in_bytes" : 6327848,
      "stored_fields_memory_in_bytes" : 613248,
      "term_vectors_memory_in_bytes" : 0,
      "norms_memory_in_bytes" : 13376,
      "points_memory_in_bytes" : 0,
      "doc_values_memory_in_bytes" : 349440,
      "index_writer_memory_in_bytes" : 48500056,
      "version_map_memory_in_bytes" : 0,
      "fixed_bit_set_memory_in_bytes" : 3520,
      "max_unsafe_auto_id_timestamp" : 1604448313395,
      "file_sizes" : { }
    },
    "mappings" : {
      "field_types" : [
        {
          "name" : "binary",
          "count" : 41,
          "index_count" : 6
        },
        {
          "name" : "boolean",
          "count" : 164,
          "index_count" : 15
        },
        {
          "name" : "byte",
          "count" : 1,
          "index_count" : 1
        },
        {
          "name" : "date",
          "count" : 299,
          "index_count" : 28
        },
        {
          "name" : "date_nanos",
          "count" : 1,
          "index_count" : 1
        },
        {
          "name" : "date_range",
          "count" : 1,
          "index_count" : 1
        },
        {
          "name" : "double",
          "count" : 16,
          "index_count" : 4
        },
        {
          "name" : "double_range",
          "count" : 1,
          "index_count" : 1
        },
        {
          "name" : "flattened",
          "count" : 36,
          "index_count" : 4
        },
        {
          "name" : "float",
          "count" : 13,
          "index_count" : 5
        },
        {
          "name" : "float_range",
          "count" : 1,
          "index_count" : 1
        },
        {
          "name" : "geo_point",
          "count" : 34,
          "index_count" : 13
        },
        {
          "name" : "geo_shape",
          "count" : 1,
          "index_count" : 1
        },
        {
          "name" : "half_float",
          "count" : 55,
          "index_count" : 10
        },
        {
          "name" : "integer",
          "count" : 122,
          "index_count" : 10
        },
        {
          "name" : "integer_range",
          "count" : 1,
          "index_count" : 1
        },
        {
          "name" : "ip",
          "count" : 52,
          "index_count" : 13
        },
        {
          "name" : "ip_range",
          "count" : 1,
          "index_count" : 1
        },
        {
          "name" : "keyword",
          "count" : 2724,
          "index_count" : 26
        },
        {
          "name" : "long",
          "count" : 301,
          "index_count" : 22
        },
        {
          "name" : "long_range",
          "count" : 1,
          "index_count" : 1
        },
        {
          "name" : "nested",
          "count" : 47,
          "index_count" : 7
        },
        {
          "name" : "object",
          "count" : 925,
          "index_count" : 27
        },
        {
          "name" : "shape",
          "count" : 1,
          "index_count" : 1
        },
        {
          "name" : "short",
          "count" : 1,
          "index_count" : 1
        },
        {
          "name" : "text",
          "count" : 1139,
          "index_count" : 24
        }
      ]
    },
    "analysis" : {
      "char_filter_types" : [ ],
      "tokenizer_types" : [ ],
      "filter_types" : [
        {
          "name" : "pattern_capture",
          "count" : 1,
          "index_count" : 1
        }
      ],
      "analyzer_types" : [
        {
          "name" : "custom",
          "count" : 1,
          "index_count" : 1
        }
      ],
      "built_in_char_filters" : [ ],
      "built_in_tokenizers" : [
        {
          "name" : "uax_url_email",
          "count" : 1,
          "index_count" : 1
        }
      ],
      "built_in_filters" : [
        {
          "name" : "lowercase",
          "count" : 1,
          "index_count" : 1
        },
        {
          "name" : "unique",
          "count" : 1,
          "index_count" : 1
        }
      ],
      "built_in_analyzers" : [ ]
    }
  },
  "nodes" : {
    "count" : {
      "total" : 1,
      "coordinating_only" : 0,
      "data" : 1,
      "ingest" : 1,
      "master" : 1,
      "ml" : 1,
      "remote_cluster_client" : 1,
      "transform" : 1,
      "voting_only" : 0
    },
    "versions" : [
      "7.9.1"
    ],
    "os" : {
      "available_processors" : 6,
      "allocated_processors" : 6,
      "names" : [
        {
          "name" : "Linux",
          "count" : 1
        }
      ],
      "pretty_names" : [
        {
          "pretty_name" : "Ubuntu 18.04.2 LTS",
          "count" : 1
        }
      ],
      "mem" : {
        "total_in_bytes" : 6249807872,
        "free_in_bytes" : 123023360,
        "used_in_bytes" : 6126784512,
        "free_percent" : 2,
        "used_percent" : 98
      }
    },
    "process" : {
      "cpu" : {
        "percent" : 16
      },
      "open_file_descriptors" : {
        "min" : 549,
        "max" : 549,
        "avg" : 549
      }
    },
    "jvm" : {
      "max_uptime_in_millis" : 169187290,
      "versions" : [
        {
          "version" : "14.0.1",
          "vm_name" : "OpenJDK 64-Bit Server VM",
          "vm_version" : "14.0.1+7",
          "vm_vendor" : "AdoptOpenJDK",
          "bundled_jdk" : true,
          "using_bundled_jdk" : true,
          "count" : 1
        }
      ],
      "mem" : {
        "heap_used_in_bytes" : 2133743608,
        "heap_max_in_bytes" : 3221225472
      },
      "threads" : 80
    },
    "fs" : {
      "total_in_bytes" : 189701390336,
      "free_in_bytes" : 131892387840,
      "available_in_bytes" : 122212044800
    },
    "plugins" : [ ],
    "network_types" : {
      "transport_types" : {
        "security4" : 1
      },
      "http_types" : {
        "security4" : 1
      }
    },
    "discovery_types" : {
      "zen" : 1
    },
    "packaging_types" : [
      {
        "flavor" : "default",
        "type" : "deb",
        "count" : 1
      }
    ],
    "ingest" : {
      "number_of_pipelines" : 14,
      "processor_stats" : {
        "conditional" : {
          "count" : 0,
          "failed" : 0,
          "current" : 0,
          "time_in_millis" : 0
        },
        "date" : {
          "count" : 0,
          "failed" : 0,
          "current" : 0,
          "time_in_millis" : 0
        },
        "date_index_name" : {
          "count" : 0,
          "failed" : 0,
          "current" : 0,
          "time_in_millis" : 0
        },
        "geoip" : {
          "count" : 0,
          "failed" : 0,
          "current" : 0,
          "time_in_millis" : 0
        },
        "grok" : {
          "count" : 0,
          "failed" : 0,
          "current" : 0,
          "time_in_millis" : 0
        },
        "gsub" : {
          "count" : 0,
          "failed" : 0,
          "current" : 0,
          "time_in_millis" : 0
        },
        "json" : {
          "count" : 0,
          "failed" : 0,
          "current" : 0,
          "time_in_millis" : 0
        },
        "remove" : {
          "count" : 0,
          "failed" : 0,
          "current" : 0,
          "time_in_millis" : 0
        },
        "rename" : {
          "count" : 0,
          "failed" : 0,
          "current" : 0,
          "time_in_millis" : 0
        },
        "script" : {
          "count" : 0,
          "failed" : 0,
          "current" : 0,
          "time_in_millis" : 0
        },
        "set" : {
          "count" : 0,
          "failed" : 0,
          "current" : 0,
          "time_in_millis" : 0
        }
      }
    }
  }
}

In the meantime the use of my CPU has decreased but just for my personal knowledge I would like to know if it is possible

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