Skip to content

Commit

Permalink
feat: manually define thread count
Browse files Browse the repository at this point in the history
  • Loading branch information
zleyyij committed Aug 29, 2024
1 parent cc42662 commit ed8df52
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ This API provides a backend for fetching information about hardware.
Current information fetched includes:
- CPU info (Intel ARK, AMD Product Database)
- USB info (VID/PID mapping)
- PCIe info (VID/PID/SUBSYS mapping)

## Project layout
The code is organized into 4 separate crates:
- `parsing`: The code for parsing the raw databases into Rust abstractions.
- `databases`: The interfaces for fast lookup from those databases.
- `handlers`: The HTTP endpoint code
- `server`: The binary and runtime specific details

## Building
Building this project requires installing the rust toolchain.
Expand Down
3 changes: 2 additions & 1 deletion server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ struct Args {

static LOGGER: SimpleLogger = SimpleLogger;

#[tokio::main]
// The production VM is heavily limited by logical cpu cores, and Tokio blocks till completion by default
#[tokio::main(flavor = "multi_thread", worker_threads = 10)]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// initialize logging
let cli_args = Args::parse();
Expand Down

0 comments on commit ed8df52

Please sign in to comment.