Solicite CPU, memória e GPU
Defina limites de recursos para que os pods sejam agendados corretamente.
Solicite CPU, memória e GPU é uma aula grátis de MLOps Academy no CoddyKit. Esta é a aula 2 de 4. Você pode ler a aula completa abaixo gratuitamente — depois pratica ao vivo no navegador com um editor de código integrado e um tutor de IA 24/7. Faz parte do caminho de aprendizado de MLOps Academy, e seu progresso é sincronizado entre a web e o app CoddyKit. O curso de MLOps Academy inclui 4 aulas no total.
Partes desta aula ainda não foram traduzidas e aparecem em inglês.
The Scheduler Needs Numbers
Kubernetes places Pods onto nodes that have room. To decide, the scheduler needs you to declare how much CPU and memory each model Pod will use.
Requests vs Limits
A request is the amount guaranteed and used for scheduling. A limit is the ceiling a container may not cross. You almost always set both.
CPU Is Measured in Millicores
CPU is counted in millicores: 1000m equals one full core. Asking for 500m means your model Pod is promised half of one CPU core.
resources:
requests:
cpu: "500m"
memory: "512Mi"
limits:
cpu: "1"
memory: "1Gi"Memory Uses Mi and Gi
Memory is set in mebibytes or gibibytes, like 512Mi or 2Gi. Size it to your model plus its runtime, with a little headroom on top.
Too Low and the Pod Stays Pending
If no node can satisfy your requests, the Pod sits in Pending forever. Big GPU models often wait simply because nothing free is large enough.
OOMKilled When You Exceed Memory
Cross your memory limit and the kernel kills the container with an OOMKilled status. Right-sizing limits keeps your model server from being reaped mid-request. 💥
CPU Limits Throttle, Not Kill
Unlike memory, breaching a CPU limit does not kill the Pod. The container is just throttled, so latency climbs instead of the process dying.
GPUs Are Requested as Limits
GPUs are an extended resource. You ask for them only under limits with nvidia.com/gpu, and the value must be a whole number, never a fraction.
resources:
limits:
nvidia.com/gpu: 1A GPU Is Not Time-Shared
One GPU request grabs the entire device for that Pod by default. Two Pods cannot casually share a card without special MIG or time-slicing setup.
The Device Plugin Makes GPUs Visible
Nodes only advertise GPUs after the NVIDIA device plugin runs on them. No plugin, no nvidia.com/gpu resource, and your GPU Pod stays Pending.
Right-Sizing Saves Money
Over-requesting wastes whole nodes; under-requesting risks evictions. Watching real usage and tuning requests is how you keep serving both stable and cheap.
Quick Check
What happens when a container exceeds its memory limit?
Recap
Declare requests and limits for CPU and memory, ask for whole GPUs under limits, and right-size from real usage to keep model Pods healthy. ✅
Perguntas Frequentes
A aula “Solicite CPU, memória e GPU” é grátis?
Sim — o texto completo de “Solicite CPU, memória e GPU” é grátis para ler aqui na web. Para praticá-la interativamente (um editor de código integrado e um tutor de IA 24/7) e desbloquear o restante do curso de MLOps Academy, atualize para CoddyKit PRO. O curso de MLOps Academy inclui 4 aulas no total.
O que vou aprender em “Solicite CPU, memória e GPU”?
Defina limites de recursos para que os pods sejam agendados corretamente. Você pratica MLOps Academy com código prático que executa diretamente no navegador, e um tutor de IA 24/7 responde suas dúvidas enquanto trabalha na aula.
Preciso ter experiência prévia para começar MLOps Academy?
Nenhuma experiência prévia é necessária. MLOps Academy no CoddyKit é estruturado para alunos iniciantes até avançados, então você pode começar aqui ou desde o início e aprender no seu ritmo. Esta é a aula 2 de 4.
Quanto tempo leva a aula “Solicite CPU, memória e GPU”?
A maioria das aulas CoddyKit leva cerca de 5–10 minutos. Cada uma é compacta e interativa, então você faz progresso constante e retoma exatamente de onde parou entre web e app.
Posso escrever e executar código nesta aula de MLOps Academy?
Sim. Cada aula de MLOps Academy inclui um editor de código integrado, então você escreve e executa código real direto no navegador e recebe feedback de IA instantaneamente — nenhuma configuração local necessária.
Todas as aulas deste curso
- Pods, implantações e serviços para modelos
- Solicite CPU, memória e GPU
- Configure com ConfigMaps e Secrets
- Execute o treinamento como um trabalho do Kubernetes