Skip to content

Instantly share code, notes, and snippets.

@bixu
Last active December 20, 2015 21:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bixu/6195826 to your computer and use it in GitHub Desktop.
Save bixu/6195826 to your computer and use it in GitHub Desktop.
## Dedicated 32-core compute nodes
4994a399-ff31-4a85-91c0-80bc5501dfb2 Memory size: 32768 Megabytes caps:4:cpucaps_zone_4:baseline 482 cpu_alloc:32 zone.cpu-shares privileged 256 - none -
12b5afe2-dc4a-4578-b70b-d0a9731f23fd Memory size: 32768 Megabytes caps:4:cpucaps_zone_4:baseline 482 cpu_alloc:32 zone.cpu-shares privileged 256 - none -
669e78bf-23fb-4187-9a23-203099f81488 Memory size: 32768 Megabytes caps:5:cpucaps_zone_5:baseline 482 cpu_alloc:32 zone.cpu-shares privileged 256 - none -
25f3a19b-a0b8-4968-a69b-1d425d07a945 Memory size: 32768 Megabytes caps:5:cpucaps_zone_5:baseline 482 cpu_alloc:32 zone.cpu-shares privileged 256 - none -
bb6838d3-40d4-4fcf-be1a-4f9d4b531365 Memory size: 32768 Megabytes caps:6:cpucaps_zone_6:baseline 482 cpu_alloc:32 zone.cpu-shares privileged 256 - none -
e7e99079-fb23-467d-9139-606c50b9b803 Memory size: 32768 Megabytes caps:6:cpucaps_zone_6:baseline 482 cpu_alloc:32 zone.cpu-shares privileged 256 - none -
2226eff3-ce6c-4cad-bce9-968c7c6ec702 Memory size: 32768 Megabytes caps:6:cpucaps_zone_6:baseline 482 cpu_alloc:32 zone.cpu-shares privileged 256 - none -
11b73cbd-fd47-463b-884f-68fdd4978b8e Memory size: 32768 Megabytes caps:6:cpucaps_zone_6:baseline 482 cpu_alloc:32 zone.cpu-shares privileged 256 - none -
## g3 8GB highcpu instances on 32-core compute nodes
148fe2f4-bb66-44a1-a09f-02c6fd41badf Memory size: 8192 Megabytes caps:3:cpucaps_zone_3:baseline 120 cpu_alloc:9 zone.cpu-shares privileged 64 - none -
5765e395-291a-49b8-b01f-a95101f15ce9 Memory size: 8192 Megabytes caps:3:cpucaps_zone_3:baseline 120 cpu_alloc:9 zone.cpu-shares privileged 64 - none -
d3008063-15cb-4fba-84ad-f044012105c3 Memory size: 8192 Megabytes caps:3:cpucaps_zone_3:baseline 120 cpu_alloc:9 zone.cpu-shares privileged 64 - none -
5d3b094f-f6db-4921-a258-b56cb80262c8 Memory size: 8192 Megabytes caps:3:cpucaps_zone_3:baseline 120 cpu_alloc:9 zone.cpu-shares privileged 64 - none -
## g2 8GB instances
e53d67b1-04dc-477d-b98e-065e2d4aa46f Memory size: 8192 Megabytes caps:58:cpucaps_zone_58:baseline 241 cpu_alloc:12 zone.cpu-shares privileged 8192 - none -
2b28d09d-f123-4a4e-a1b3-10161f62b3b7 Memory size: 8192 Megabytes caps:59:cpucaps_zone_59:baseline 241 cpu_alloc:12 zone.cpu-shares privileged 8192 - none -
16a31d33-3bc5-4600-b0c5-b6f79c571d91 Memory size: 8192 Megabytes caps:60:cpucaps_zone_60:baseline 241 cpu_alloc:12 zone.cpu-shares privileged 8192 - none -
4158332a-87b0-409e-b7f3-a4c751c23910 Memory size: 8192 Megabytes caps:61:cpucaps_zone_61:baseline 241 cpu_alloc:12 zone.cpu-shares privileged 8192 - none -
## Based on the confusing stats above, we are calculating cpu allocation (vCPU) this way:
SM_CPU_COUNT=$(psrinfo | wc -l)
EFFECTIVE_CPU=$(kstat -p | grep cpucaps_zone | grep effective| awk '{ print $2 }')
SM_CPU_ALLOCATION=$((${EFFECTIVE_CPU} / 100))
if [[ $SM_CPU_ALLOCATION -gt $SM_CPU_COUNT ]]; then
SM_CPU_ALLOCATION=$SM_CPU_COUNT
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment