Похожие чаты

Hey Guys, Recently I'm working on a service with Go,

now I want to give some limited resources (CPU) for the service, just not allowing using all the resources on the system, I'm using KinD on my local but It's not working at all for me.

I'm using linux as well,
and the configuration that I'm using:

apiVersion: apps/v1
kind: Deployment
metadata:
name: name-pod
namespace: name-system
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: name
template:
metadata:
labels:
app: name
spec:
containers:
- name: name-api
resources:
limits:
cpu: "2000m"
requests:
cpu: "1000m"

the result of my program still using 8 threads, but It should be 2 instead of 8.

2021/12/31 06:08:18 starting service CPU[8]

the example of code:

I'm using automaxprocs library:

if _, err := maxprocs.Set(); err != nil {
fmt.Println("maxprocs: %w", err)
os.Exit(1)
}

g := runtime.GOMAXPROCS(0)

log.Printf("starting service CPU[%d] \n", g)

Could you help me? what's wrong with my process?

2 ответов

19 просмотров

No that's cpu time limit not #cores. I think you gotta go through admission controller. Let me see, got interested in this

I was wrong (partially). Use this format

Похожие вопросы

Обсуждают сегодня

Всем привет, написал код ниже, но он выдает сегфолт, в чем причина? #include <stdio.h> #include <stdlib.h> #include <string.h> struct product { char *name; float price; };...
buzz базз
32
Хотел бы спросить у знающих, правильную ли я выбрал книгу для начала изучения ассемблера Юрова В.И ? Или есть более лучшие книги для начала обучения?
Botsman
25
Добрый день, не подскажите, если в OC-V3 поменять страндартную директорию /storage/ на /storage2/ - не будет сильно много проблем ?
Max Dubovsky
32
Conversation at a festival with a non-crpto person (not a normie by any stretch, though): * person: tell me about crypto, me: ok, the original idea is p2p sound money for the...
molecular#123 🐓
25
Книга Юрова В.И пойдёт для обучения?
Botsman
24
$params = [ 'formid' => 'feedbackForm', 'formTpl' => '@CODE: <form class="form-validate" data-id="ajax_form"> <fieldset class="margin-bottom-md"> ...
Pathologic
1
> Примечательно, что новый владелец удаляет из GitHub любые жалобы, указывающие на подозрительную активность или смену владельца, и, видимо, рассчитывает на то, что пользовате...
Alex Sherbakov
1
I bought some PHA tokens on Kucoin, which is the best wallet to store and easy to use?
AMR
19
'frakturBold' => ['𝖆', '𝖇', '𝖈', '𝖉', '𝖊', '𝖋', '𝖌', '𝖍', '𝖎', '𝖏', '𝖐', '𝖑', '𝖒', '𝖓', '𝖔', '𝖕', '𝖖', '𝖗', '𝖘', '𝖙', '𝖚', '𝖛', '𝖜', '𝖝', '𝖞', '𝖟', '𝕬', '𝕭', '𝕮', '𝕯'...
Roma
4
Подскажите пожалуйста, а я могу вот такую штуку использовать? rpc, только реализованное в реббите https://www.rabbitmq.com/tutorials/tutorial-six-php ( или https://habr.com/ru...
Artyom
11
Карта сайта