Page MenuHomePhabricator

Units in Toolforge's "webservice" command
Open, Needs TriagePublic

Description

Now the new 2020 Kubernetes cluster, webservice takes arguments for requested CPU and memory limits. Today I had a heckuva time debugging a simple misunderstanding:

webservice --cpu 1 --mem 2 python2 restart

I had assumed --mem was in floating point gigabytes, not a string value. I only found this thanks to folks on IRC and kubectl describe rs

At the very least I hope we can enhance these flag descriptions that show up with webservice -h:

-m MEMORY, --mem MEMORY
                      Set higher Kubernetes memory limit (new cluster only)
-c CPU, --cpu CPU     Set a higher Kubernetes cpu limit (new cluster only)

Specify the expected format, e.g., 2000Mi for memory, "2" for CPU.

Also, not sure if this is related, but my kube config appears to contain the following, which kind of looks like a crossed default?

Requests:
  cpu:        500m

Half a gig is the default memory, not the default CPU. Might be unrelated or I'm reading it wrong, just thought I'd mention.

Thanks!

Event Timeline

Ah, that makes sense. Maybe the help strings can describe that format, the default, and/or link over to that page?