It takes 2 mins to indexing a single doc


I am using monstache for connecting elastic to mongodb.
Here is my monstache command:

monstache -elasticsearch-url "http://localhost:9200" -mongo-url 'mongodb+srv://XXXX' monstache -direct-read-namespace portaldb.candidate -verbose -resume false -replay false -stats

And this is index.I have created it just to test system:

curl -X PUT "localhost:9200/portaldb.candidate" -H 'Content-Type: application/json' -d'
"settings" : {
    "number_of_shards" : 90,
"number_of_replicas" : 0,
"refresh_interval" : "30s",
"analysis": {
  	"analyzer": {
   	 "my_analyzer": {
    	  "tokenizer": "my_tokenizer"
  	"tokenizer": {
   	 "my_tokenizer": {
   	   "type": "standard",
    	  "max_token_length": 10
"mappings" : {
    "properties" : {
        "generalInfo.fullName" : { "type" : "text" },
    "" : {"type":"text"},
        "generalInfo.surname" : {"type":"text"}


Elastic uses 4g of memory and indices.memory.index_buffer_size is 30%.
I am running server on local machine which has 16gb ddr4 ram and i7 processor on it.

How do you know it takes 2 minutes?

Either running this:

curl localhost:9200/_cat/indices?v

or checking docs on Kibana.

How do you know if it's Elasticsearch or the client you are using?

I am running elasticsearch on localhost:9200

Ok but you are saying things are slow. You've mentioned you are sitting there waiting for the doc to show up, which isn't entirely scientific.

How do you know if it's Elasticsearch or the client?
What version of Elasticsearch are you using?
Do you have Monitoring enabled?

Thanks for replies.

I do not understand what do you mean by "elasticsearch or client".
Elasticsearch version is 7.2
I have enabled monitoring now.

I mean how do you not know that the monstache command takes 2 minutes to get the document and send it to Elasticsearch?

I am checking doc counts on index and also double check in discover tab in Kibana. It reads whole document not just the fields I set and it takes lots of time to read a single one.

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