Logstash: replacement of the Coralogix/Ruby output plugin with http output plugin requires x2 resources

According to the Coralogix they are going to drop support of their Coralogix/Ruby based plugin.

As the replacement it is proposed to use http output plugin. You can find the relevant details by navigating the URL below: Logstash - Coralogix

The behaviour of the system before integration: The messages are supplied to the Kafka topic with 50 partitions (input). As the output was used the Coralogix/Ruby plugin and in was able to handle the workload with the 10 instances of the same pipeline which used the Coralogix/Ruby based plugin.

The behavior of the system after the integration: 1.The successful case: Logstash pipeline can handle the workload of the production from the Kafka topic with 50 partitions with 20 pipelines (instead of 10 with Coralogix/Ruby) which in turn significantly increases the expences for this part of the infrastructure (ec2 c2.8xlarge - 992$ per month).

The solutuin works but its price is 2 times higher than the original one (Coralogix/Ruby) You can find the sample of the output configuration below.

I would like also to mention that for this setup the value of the pool_max = 50 by default

output {
        http {
            url => "${CORALOGIX_MAIN_API_URL}"
            http_method => "post"
            headers => ["private_key", "${CORALOGIX_MAIN_PRIVKEY}"]
                format => "json_batch"
                codec => "json"
                mapping => {
                    "applicationName" => "${ENVIRONMENT}"
                    "subsystemName" => "${SUBSYSTEM}"
                    "text" => "%%{[@metadata][event]}"
                }
                http_compression => true
                automatic_retries => 5
                retry_non_idempotent => false
                connect_timeout => 60
                keepalive => true
                pool_max => 50
        }
}

Attempt to optimise the expences In attempt to optimise the expences (decrease a number of pipelines from 20) I tried to increase the pool_max value to 300 during a set of probes and managed to handle the workload with a noticable lags for 4 or 5 hours, after this period I got a high Lag of non consumed messages and had to stop the test (13 pipelines were not able to handle the workload)

    output {
            http {
                url => "${CORALOGIX_MAIN_API_URL}"
                http_method => "post"
                headers => ["private_key", "${CORALOGIX_MAIN_PRIVKEY}"]
                    format => "json_batch"
                    codec => "json"
                    mapping => {
                        "applicationName" => "${ENVIRONMENT}"
                        "subsystemName" => "${SUBSYSTEM}"
                        "text" => "%%{[@metadata][event]}"
                    }
                    http_compression => true
                    automatic_retries => 5
                    retry_non_idempotent => false
                    connect_timeout => 60
                    keepalive => true
                    pool_max => 300
            }
    }

Question: Is this expected behavior for the http plugin? I mean the high number of logstash pipeline instances, supposedly equal or less equal to the number of the Kafka topic partitions? In my case Kafka topic partitions = 50 and 40 pipelines were able to cover the load instead of the 20 with Coralogix/Ruby. Is there any other/additional approach that could decrease a cost of this solution and a number of the logstash pipelines that handle the worload?

Thank you.

What is the pipeline configuration? Have you tried to increase the pipeline.batch.size?

Also, what is the average event rate and event size?

Per default the pipeline.batch.size is 125, try to increase this size to see if it increases the throughput.

Hello,

Thank you so much for your reply.

I did not know about these settings and
tried to apply adjustments only on a plugin level.

I see that the retention period is 2 days,
so I get the number of all messages and divided it by 2.

According to the calculation above the rate of the messages per day is
4167026334
The rate of the messages per hour is
50.000

I used the default value for the
pipeline.batch.size

I will try to increase it and in case if I succeed with this setup I will update this thread.

Those are not consistent. Four billion messages per day would be around 50,000 per second.

Hello @leandrojmp

Your suggestion was right.

After some tests it seems that I found the solution for the issue that I mentioned above.

The settings that should optimize the performance of the http output plugin should be done on Logstash level (logstasy.yml) and not on plugin level (the configuration file which uses http output plugin).

The 2 settings below helped to keep the same number of pipelines (10) and handle the production load:

pipeline.batch.size: 400
pipeline.batch.delay: 150

Both values by default have the smaller values which were not sifficient to handle the production load:

pipeline.batch.size: 125
pipeline.batch.delay: 50

You can read more about these values by navigating the URL:

https://www.elastic.co/guide/en/logstash/current/logstash-settings-file.html

Thank you for your attention to my question.
I hope that it could be also helpful to someone who which to optimize
the behavior of the http output plugin and logstash application in general.

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