Похожие чаты

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 ответов

25 просмотров

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

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

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

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта