How to limit number of requests

Did you ever need to limit requests coming to your endpoints? Say, your maximum design capacity is near 10k requests/second, and you don’t want to probe your service on higher rates. I choose to use RateLimiter - small class from Guava. The init process aren’t so huge, just couple of lines: RateLimiter rateLimiter = RateLimiter.create(10); // 10 requests/second Then, just...

Better application deployment. Monitoring your application with Graphite/Grafana

Intro In the previous part I explained how to use Terraform, Ansible, Docker and Spring Boot to deploy applications in the cloud. Today I’d like to introduce something, which will work as a monitoring tool, inside our infrastructure. If you follow my blog posts, you should remember a post about Spring and Dropwizard Module - there I explained how you...

watch - useful unix command I've never heard of

I use ImageMagick for resizing images in one of the projects, and I needed a command to monitor folder changes in a temporary folder. So I found watch: watch -d -n 0.3 'ls -l | grep ivanursul' This command check every 0.3 seconds for current folder, and find all files, created by user ivanursul Links Linux Watch

Better application deployment with DigitalOcean, Terraform, Ansible and Docker. Connecting Terraform with Ansible.

Just creating instances in the cloud is an intermediate result. Yes, you know don’t need to create them manually, but it’s not a target. We need to configure them somehow, deploy logic, restart, etc. That’s why this article is about describing how to work with Terraform instances - using Ansible tool. What do you need to do before starting Create...

Better application deployment with DigitalOcean, Terraform, Ansible and Docker. DNS Records

As we are creating our instances on the fly, using Terraform declarative scripts, we can also need to create dns domains and records. Let’s say, you have two environments: dev and prod, and you you want to have your backend application stored under dev.api.myapp.com and prod.api.myapp.com. Luckily, terraform allows to do such things Required steps Digitalocean account Ready and bought...