patternkubernetesMinor
How much memory/cpu to allocate per pod?
Viewed 0 times
muchperallocatememoryhowcpupod
Problem
This is a question that's been bothering us quite a while.
How can you determine how much to allocate per pod?
What if I don't know the program, maybe it needs a lot of memory at peak times.
What are some general strategies to finding out how much to allocate? cpu/memory
How can you determine how much to allocate per pod?
What if I don't know the program, maybe it needs a lot of memory at peak times.
What are some general strategies to finding out how much to allocate? cpu/memory
Solution
It's a severe problem to solve if you don't know the performance characteristics of the process you are containerising. There are a couple of approaches you could take that will get you an answer, although you will need to monitor it carefully in production and an adjust the resource limits as required.
Whichever approach you take, you will need to make sure that you have a proper monitoring and dashboarding solution working so that you can actually analyse the behaviour of the containers under load and adjust accordingly.
- Approach #1: Educated Guess - take a look around at what other people have done to host a specific process, GitHub is an excellent resource for finding Dockerfiles and their associated Helm Charts. Equally, if someone has done some tests for Virtual Machine sizing, you may be able to derive an answer that is acceptable in the short term.
- Approach #2: Testing - my personal preference is to test the component in question:
- The Apache Bench is excellent for quick performance tests against HTTP(S) endpoints
- Tools such as the MySQL Benchmark tool allow you to test MySQL, many applications have dedicated benchmarking tools.
- If the software is more complicated you can use tools such as Artillery or Gattling to create a performance test suite that you can use to slam the container and find out how it performs.
Whichever approach you take, you will need to make sure that you have a proper monitoring and dashboarding solution working so that you can actually analyse the behaviour of the containers under load and adjust accordingly.
Context
StackExchange DevOps Q#9595, answer score: 3
Revisions (0)
No revisions yet.