# Cpu unit eEinumkKMGTP meanings

**URL:** <https://discuss.kubernetes.io/t/cpu-unit-eeinumkkmgtp-meanings/19586>\
**Category:** General Discussions\
**Created:** [April 8, 2022, 6:23am UTC](https://discuss.kubernetes.io/t/cpu-unit-eeinumkkmgtp-meanings/19586 "2022-04-08T06:23:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![zjf](https://avatars.discourse-cdn.com/v4/letter/z/f04885/32.png) [@zjf](https://discuss.kubernetes.io/u/zjf)\
**Post date:** [April 8, 2022, 6:23am UTC](https://discuss.kubernetes.io/t/cpu-unit-eeinumkkmgtp-meanings/19586/1 "2022-04-08T06:23:56Z")

</div>

When I create ResourceQuota ,it reported error:

```auto
Error from server (BadRequest): ResourceQuota in version "v1" cannot be handled as a ResourceQuota: v1.ResourceQuota.Spec: v1.ResourceQuotaSpec.Hard: unmarshalerDecoder: quantities must match the regular expression '^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$', error found in #10 byte of ...|:"1000abc","memory":|..., bigger context ...|espace":"default"},"spec":{"hard":{"cpu":"1000abc","memory":"200Gi","pods":"10"},"scopeSelector":{"m|...

```

I found that cpu and memory have unit limits. I would like to ask you, what does “eEinumkKMGTP” mean?

### Cluster information:

Kubernetes version:  
Cloud being used: (put bare-metal if not on a public cloud)  
Installation method:  
Host OS:  
CNI and version:  
CRI and version:

You can format your yaml by highlighting it and pressing Ctrl-Shift-C, it will make your output easier to read.

---

<div class="post-metadata">

**Author:** ![mrbobbytables](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/mrbobbytables/32/7_2.png) [@mrbobbytables](https://discuss.kubernetes.io/u/mrbobbytables)\
**Post date:** [April 8, 2022, 1:08pm UTC](https://discuss.kubernetes.io/t/cpu-unit-eeinumkkmgtp-meanings/19586/2 "2022-04-08T13:08:50Z")

</div>

It’s part of a [regular expression](https://en.wikipedia.org/wiki/Regular_expression) it means it’ll match any one of those characters.

---

<div class="post-metadata">

**Author:** ![zjf](https://avatars.discourse-cdn.com/v4/letter/z/f04885/32.png) [@zjf](https://discuss.kubernetes.io/u/zjf)\
**Post date:** [April 11, 2022, 1:47am UTC](https://discuss.kubernetes.io/t/cpu-unit-eeinumkkmgtp-meanings/19586/4 "2022-04-11T01:47:44Z")

</div>

Sorry, I may not be able to express clearly, I know the meaning of this error, but what I am not clear about is what each letter in the string “eEinumkKMGTP” means, I only know the meaning of a few of them, such as ‘n’ for is nano-cores, m stands for milli-cores, what do the others mean?

---

<div class="post-metadata">

**Author:** ![thockin](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/thockin/32/2457_2.png) [@thockin](https://discuss.kubernetes.io/u/thockin)\
**Post date:** [April 11, 2022, 4:33am UTC](https://discuss.kubernetes.io/t/cpu-unit-eeinumkkmgtp-meanings/19586/5 "2022-04-11T04:33:37Z")

</div>

E and e are scientific notation for decimal exponents (e.g. 5e3 = 5000)

m is milli (thousandths 10^-3)

K is kilo (10^3)  
M is mega (10^6)  
G is giga (10^9)  
T is tera (10^12)  
P is peta (10^15)

Ki is kilo (2^10)  
Mi is mega (2^20)  
Gi is giga (2^30)  
Ti is tera (2^40)  
Pi is peta (2^50)

---

<div class="post-metadata">

**Author:** ![zjf](https://avatars.discourse-cdn.com/v4/letter/z/f04885/32.png) [@zjf](https://discuss.kubernetes.io/u/zjf)\
**Post date:** [April 11, 2022, 5:29am UTC](https://discuss.kubernetes.io/t/cpu-unit-eeinumkkmgtp-meanings/19586/6 "2022-04-11T05:29:14Z")

</div>

> [@zjf](#):
>
> inumk

Thanks a lot, and what do ‘i’ and ‘k’ stand for?

---

<div class="post-metadata">

**Author:** ![zjf](https://avatars.discourse-cdn.com/v4/letter/z/f04885/32.png) [@zjf](https://discuss.kubernetes.io/u/zjf)\
**Post date:** [April 11, 2022, 5:35am UTC](https://discuss.kubernetes.io/t/cpu-unit-eeinumkkmgtp-meanings/19586/7 "2022-04-11T05:35:12Z")

</div>

> [@thockin](#):
>
> Ki is kilo (2^10)  
> Mi is mega (2^20)  
> Gi is giga (2^30)  
> Ti is tera (2^40)  
> Pi is peta (2^50)

I know that ‘Ki’ and ‘Mi’ are used in memory, and the same is used in cpu?

---

<div class="post-metadata">

**Author:** ![thockin](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/thockin/32/2457_2.png) [@thockin](https://discuss.kubernetes.io/u/thockin)\
**Post date:** [April 11, 2022, 7:32pm UTC](https://discuss.kubernetes.io/t/cpu-unit-eeinumkkmgtp-meanings/19586/8 "2022-04-11T19:32:10Z")

</div>

The unit of `cpu` is whole cores, so things like milli make sense, but things like kilo or mega do not (unless you have a 1024 core machine!!)

The unit of `memory` is bytes, so things like mega and giga make sense, but milli does not.

The API field here is a map from string to “quantity” so both are syntactically able to use all scalars - you can ask for a mega-core or a milli-byte, but neither will do anything useful. 🙂
