Handling Large Traffic In Short Period Of Time

Handling Large Traffic In Short Period Of Time
Problem In the previous post about Probability in migration new services to prevent traffic flood , I try to apply Probability to solve problem. This post explains more about how I handle large-n-heavy traffics in short period of time. Btw, I called it’s heavy because it needs cpu and memory resize image on cloud (download original image => load to memory => transform format => resize). So if I spin 2, or 4, or even 10 servers to handle this workload, these are some cons: Devops Costs : you have to know to manage large of VMs and put it behind Load Balancer Timing Costs : manual scaling take time (certainly) Resource Costs : you have to pay for idle time Complexity Costs : your system will be a mess Solution All challenges your met mainly because you have to have many servers, so solution is
Read more →

Probability in migration new services to prevent traffic flood

Problem I have a imgproxy server instance to resize cloud image on-demand using signed url then saving response cache to disk. To the day I want to move to another domain point to another server instance, then I remember the last time I changed immediately to new domain, my websites lost many images because it needs to resize all the images in a short period of time (my server is crash). So this time, I need another strategy :) Probability First try : random (looks okay) $is_new = rand(1, 4) == 1; $domain = $is_new ? 'new_domain' : 'old_domain'; This strategy looks okay but it has loophole when you have high traffic websites.
Read more →

#TIL : Improve apt package manager speed by changing source list mirrors

I learned on 2019-04-03 about apt, devops, packagemanager
Read more →

#TIL : Run shell command in all hosts

I learned on 2019-02-18 about ansible, devops
Read more →

#TIL : Build lightweight image by using multistage

I learned on 2018-02-23 about devops, docker
Read more →

#TIL : Ansible running host pattern

I learned on 2018-01-22 about ansible, devops
Read more →

#TIL : Reduce init time MySQL docker image

I learned on 2017-11-22 about ci, devops, docker
Read more →

#TIL : Using netcat to wait a TCP service

I learned on 2017-10-13 about ci, devops, netcat
Read more →

#TIL : Free sandbox server for development

I learned on 2017-08-04 about devops, free, heroku
Read more →

#TIL : Checking forced push conflicts on source code in auto testing

I learned on 2017-05-19 about testing, bash, devops, automated
Read more →

Kick start Docker environment on ubuntu

Kick start Docker environment on Ubuntu in production
Read more →

Kick start a LEMP stack on Ubuntu 16.04

Kick start a LEMP stack on Ubuntu 16.04 in production
Read more →

How to reload gracefully supervisor program

It’s creepy when supervisor kills all processes of programs and starts them again.
Read more →