Analyse request distribution with ELK

Now that I finally got the ELK stack running and collecting the logs from my two “Auction-Service”-instances, it is time to check whether Docker swarms load balancer really does distribute the requests.

The first thing to do is to start up my cluster which includes the IRATA stack and the ELK stack.

And of course I need some load on the Auction-Service. For that I simply use a simple Unit test which seems sufficient for proving the work load distribution.

After some seconds all the log entries should in the elastic search index.

I opted to use elastic search’s aggregations to create a query for request distribution. To be more precise I will use the terms aggregation which will yield the number of documents (meaning log entries) that have been stored for each host. Which in this case means service instance.

The query looks like this:

The term to use is the host name of the service instances submitted by the beat that collected the log. This query produces the following result:

I highlighted the important lines. The keys are the actual host names and the doc_count is the number of log messages. So we can actually see that the requests are getting more or less distributed.

Mission accomplished :-)

Well, this simple query proves that the whole setup is actually doing what it is supposed to do:

  • Docker Swarm works for setting up an application stack
  • Requests are distributed between service instances
  • Redis serves well as a service for storing states
  • Log message collection works and analysis is possible

But of course things just got started. Next will be thing like deploying the services to Kubernetes and creating an actual front end for IRATA.


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">