logstash-input-mongodb
logstash-input-mongodb copied to clipboard
CPU usage performance problem
When I use the plugin the CPU reaches 100 percent. The MongoDB database has approximately 500,000 documents in the collection. The configuration I have is the following:
input {
mongodb {
uri => 'mongodb://User:[email protected]:27017/production?ssl=false'
placeholder_db_dir => '/opt/logstash-mongodb/'
placeholder_db_name => 'logstash_sqlite.db'
collection => 'col_info'
generateId => true
batch_size => 30
tags => "mongodb"
}
}
filter {
if "mongodb" in [tags] {
mutate{
rename => ["_id", "Obj_id"]
convert => { "phone_number" => "string" }
}
}
}
output {
if "mongodb" in [tags] {
elasticsearch {
index => "db-mongodb-%{+YYYY.MM}"
document_id => "%{Obj_id}"
hosts => "localhost:9200"
}
}
}
What could be the problem?