Page MenuHomePhabricator

Request increased build quota for toc Toolforge tool
Closed, ResolvedPublic

Description

Tool Name: toc
Reason:

My Toolforge bot is currently encountering the error message: "Unable to start, out of quota for cpu".

The tool generates topic lists, and due to increased usage and task complexity, the current CPU quota is no longer sufficient to ensure reliable operation.

I would like to kindly request an increase in the CPU build quota to help maintain stable execution and continued service to the community. Thank you very much for your time and consideration.

+--------------------------------------+----------------------+---------------------------------------+
|              Job name:               |      Job type:       |                Status:                |
+--------------------------------------+----------------------+---------------------------------------+
|          k8s-update.wikibot          | schedule: 2 17 * * * | Unable to start, out of quota for cpu |
|   k8s-20170915.topic-list.commons    |      continuous      | Unable to start, out of quota for cpu |
|      k8s-20170915.topic-list.en      |      continuous      |                Running                |
|      k8s-20170915.topic-list.ja      |      continuous      |                Running                |
|   k8s-20170915.topic-list.testwiki   |      continuous      |                Running                |
|  k8s-20170915.topic-list.wikibooks   |      continuous      | Unable to start, out of quota for cpu |
|   k8s-20170915.topic-list.wikinews   |      continuous      |                Running                |
|  k8s-20170915.topic-list.wikisource  |      continuous      |                Running                |
| k8s-20170915.topic-list.wikiversity  |      continuous      |                Running                |
|  k8s-20170915.topic-list.wiktionary  |      continuous      | Unable to start, out of quota for cpu |
|      k8s-20170915.topic-list.zh      |      continuous      |                Running                |
| k8s-20170915.topic-list.zh-classical |      continuous      |                Running                |
+--------------------------------------+----------------------+---------------------------------------+

Event Timeline

I checked the other tools and found that some of them need to increase quota:

signature-check
needs to increase CPU

mgp-cewbot
needs to increase memory to 32G

@Kanashimi Do you have an estimation of the extra CPU that you need? (double the current, 50% increase, 10CPUs, ...)

This will allow the robots to perform safely:

toc
16 CPUs

signature-check
12 CPUs

signature-check is a different tool? Can you open a task for it if so?
+1 on toc

signature-check is a different tool? Can you open a task for it if so?

Yes, they are different tools. also I need to add quota to a total of three tools: toc, signature-check, mgp-cewbot.

toc
16 CPUs

signature-check
12 CPUs

mgp-cewbot
needs to increase memory to 32G

can you try increasing the cpu limit of that job?

Sorry, I’m not quite sure I understand what you mean. Could you please let me know what I should do?

signature-check is a different tool? Can you open a task for it if so?

Yes, they are different tools. also I need to add quota to a total of three tools: toc, signature-check, mgp-cewbot.

toc
16 CPUs

signature-check
12 CPUs

mgp-cewbot
needs to increase memory to 32G

can you try increasing the cpu limit of that job?

Sorry, I’m not quite sure I understand what you mean. Could you please let me know what I should do?

Hello @Kanashimi , I am sorry we took long to respond. I think what David meant was that when you create a job in toolforge without specifying a cpu value (.e.g. toolforge jobs run my-job --command "..." --image my-image ---continuous), it uses a default cpu and memory value. If you need a job with more memory and cpu (but still within your tools resource quota) you should provide the options --cpu <value> and --mem <value>. You can check toolforge jobs run --help for help.
To see your current quota usage and limit see try toolforge jobs quota

@Raymond_Ndibe Thank you for the response. Although I didn't specify the number of CPUs, I checked the quota. It seems that the quota is not enough because of the number of tasks, not a problem of not specifying the number of CPUs.

@Raymond_Ndibe Thank you for the response. Although I didn't specify the number of CPUs, I checked the quota. It seems that the quota is not enough because of the number of tasks, not a problem of not specifying the number of CPUs.

Thanks @Kanashimi
I am looking into this

@dcaro I looked at the underlying resourcequota for this tool and yes, it seems like tool is already using up the allowed cpu requests (see spec.hard.requests.cpu and status.used.requests.cpu), and marely providing --cpu will likely not help. Can you take a closer look and +1 if you think so too?

kubectl get resourcequota tool-toc -n tool-toc -o yaml
apiVersion: v1
kind: ResourceQuota
metadata:
  ...
  name: tool-toc
  namespace: tool-toc
  ...
spec:
  hard:
    limits.cpu: "8"
    limits.memory: 32Gi
    requests.cpu: "4"
    requests.memory: 16Gi
    ...
status:
  hard:
    limits.cpu: "8"
    limits.memory: 32Gi
    requests.cpu: "4"
    requests.memory: 16Gi
    ...
  used:
    limits.cpu: "4"
    limits.memory: 16Gi
    requests.cpu: "4"
    requests.memory: "8589934592"
    ...

I see yes, the limit reached is of the requests, not the actual cpu used.

The current usage is way lower than the requested CPUs, I think that this can be sorted out partially by lowering the requested cpus for the jobs that don't need it. Note that when you request cpu, that cpu will be allocated, and not used for something else, so it's preferred if you request as much as you need but not more.

Looking at the panel https://grafana-rw.wmcloud.org/d/TJuKfnt4z/kubernetes-namespace?orgId=1&from=now-7d&to=now&timezone=browser&var-cluster=P8433460076D33992&var-namespace=tool-toc&forceLogin&viewPanel=panel-28

And the current usage:

tools-bastion-13 tools.toc 17:09:44 ~
kubectl top pod
NAME                                                    CPU(cores)   MEMORY(bytes)   
k8s-20170915.topic-list.en-8d8767855-sxtzn              3m           72Mi            
k8s-20170915.topic-list.ja-585db49867-grxmb             263m         302Mi           
k8s-20170915.topic-list.testwiki-58b8cdb776-dj27t       4m           50Mi            
k8s-20170915.topic-list.wikinews-bb7d64878-rdjkb        9m           58Mi            
k8s-20170915.topic-list.wikisource-99d8ccddb-jhrk6      4m           66Mi            
k8s-20170915.topic-list.wikiversity-595f6b5b8b-565ks    3m           59Mi            
k8s-20170915.topic-list.zh-bc5ff6589-r5767              4m           457Mi           
k8s-20170915.topic-list.zh-classical-6887f8fc57-ncssb   3m           50Mi

There's only one pod that gets over half the requested CPU, I'd recommend changing all the others to use half of the current request (that is change from 0.5 to 0.25), or even less, and that will free almost half of the quota.

You can also try to shrink the memory quota usage (defaults to 500Mi).

@Kanashimi sorry for insisting, but can you give it a go and report back if you were able to free some quota?

You can do something like:

  • toolforge jobs dump > jobs.yaml
  • Add the line cpu: 0.25 to the jobs that you want to shrink the quota for
  • toolforge jobs load jobs.yaml, that will update only the jobs that changed

I try cpu: 0.25 and it works. Thank you.

dcaro triaged this task as High priority.

@Kanashimi awesome :), I'll close this then, if you see that you still need more resources, we can have another look and increase the quota in another task.