Is it better to set up puma workers or just add more pods to my rails app on kubernetes?

1/17/2018

For a rails app on production is it a good practice, besides the autoscaler, to set up some puma workers? or is it better just to have more running pods?

-- Steven Barragán
kubernetes
puma
ruby-on-rails

1 Answer

1/19/2018

For my experience, it is better to have an higher number of smaller (in terms or resource occupation) pods rather then a smaller number of bigger pods.

The reason why I came to this thinking are:

1) a smaller pod is quicker to spawn up and to be moved around by kube controller;

2) the failure of a pod instance is less impacting on the system overall performance (because there's an higher number of other replicas running);

3) a bigger pod could require the cluster autoscaler to spawn up a new node more frequently (it requires more resources to be available on a node in order to be scheduled).

That's my thought, I'd love to have other opinions though.

-- whites11
Source: StackOverflow