We’re using Amazon Elastic Beanstalk with a Clojure-based collector.
We used to have an M1.small instance but since the number of tracking events have been growing it was replaced with an M4.large EC2 instance.
This current instance has 450 Mbps bandwidth and also Enhanced Networking by default, also has 8GB RAM and 2 vCPUs.
The action taken by the collector seems relatively simple: log the event, in case of click action, redirect to the indicated URL, in case of open action, serve a pixel.
The problem? We’re facing a huge bottleneck.
We’ve compiled some benchmarks that can illustrate the huge TTFB (Time To First Byte) when clicking on a tracking URL:
A few follow-up questions to see if we can get to the bottom of this:
What Trackers are you using?
Are you using GET or POST requests? If POST how many are being bundled?
With the m4.large server what type of EBS volume have you attached? Standard, gp2, io1?
Is the latency something you are seeing in the Elastic Beanstalk UI or are these time measurements at your host? Does sending the request via cURL at the CLI result in the same roundtrip time?
We’re using Pixel Tracker, currently tracking pixels and clicks (example below)
GET
100GB gp2
Benchmarks were collected via HTTP (location Portugal, EBS AZ Ireland) the response rate were collected at EBS using /status. Either via cURL or HTTP the results has very similar TTFB.
Take a look: trck.eu-west-1.elasticbeanstalk.com. Currently with ±5 req/sec the latency isn’t fully experienced since we opted to disable the tracking of most events.
At the moment only m4.large is used that consists in 1 instance with 8GB RAM, 2 vCPUs, dedicated 450 Mbps bandwidth.
Sending requests to the endpoint you have supplied above resolves in just a few milliseconds so not sure where the issue might be.
Is the traffic pattern from the pixel tracker very spiky? Are you sending sudden influxes of data to the collector? If you do manage to overwhelm the server then response times can rise quite sharply.
At the moment only m4.large is used that consists in 1 instance with 8GB RAM, 2 vCPUs, dedicated 450 Mbps bandwidth.
I was asking more for the Elastic Beanstalk configuration. How much ram have you allocated to the Clojure Collector server itself?