Java performance will not scale directly with the number of threads. For example, for most JVMs some aspects of garbage collection are single-threaded, so only one CPU will be used during GC pauses. Various plugins use mutexes to protect shared resources that can only be accessed in a thread-safe manner by one thread at a time.
It is also possible for logstash to be limited by the throughput of the inputs it is reading from or the outputs it is writing to.
To investigate the effect of increasing the number of worker threads properly you would need to start collecting thread dumps and see what the additional threads are doing. If they are doing work then throughput will probably continue scaling. If they are sitting on mutexes then no additional work will get done (but CPU may increase -- in this case increased CPU usage is bad, not good).
Try to maximize throughput (events per minute), not CPU usage.
It is a very general Java performance analysis problem, not really a logstash question.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.