# python获取系统cpu数量

获取系统CPU数量可以使用

```
import multiprocessing
multiprocessing.cpu_count()
```

这个模块现在已经从2.6 backport到2.5，应该可以通用

* [Python multiprocessing.cpu\_count() returns '1' on 4-core Nvidia Jetson TK1](http://stackoverflow.com/questions/31344582/python-multiprocessing-cpu-count-returns-1-on-4-core-nvidia-jetson-tk1)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://huataihuang.gitbook.io/cloud-atlas-draft/develop/python/startup/get_cpu_count.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
