Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add an option to configure subprocess pool size #273

Merged
merged 3 commits into from
Oct 1, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Fix a bug where Sentry requests were cached even though caches were disabled. ([#260](https://github.com/getsentry/symbolicator/pull/260))
- Publish Docker containers to DockerHub at `getsentry/symbolicator`. ([#271](https://github.com/getsentry/symbolicator/pull/271))
- Add `processing_pool_size` configuration option that allows to set the size of the processing pool. ([#273](https://github.com/getsentry/symbolicator/pull/273))

## 0.2.0

Expand Down
2 changes: 2 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ metrics:
`true`.
- `connect_to_reserved_ips`: Allow reserved IP addresses for requests to
sources. See [Security](#security). Defaults to `false`.
- `processing_pool_size`: The number of subprocesses in Symbolicator's internal
processing pool. Defaults to the total number of logical CPUs on the machine.
- `caches`: Fine-tune cache expiry.
All time units can be either a time expression like `1s`. Units
can be `s`, `seconds`, `m`, `minutes`, `h`, `hours`, `d`, `days`,
Expand Down
4 changes: 2 additions & 2 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ impl ServiceState {
SymCacheActor::new(caches.symcaches, objects.clone(), cpu_threadpool.clone());
let cficaches =
CfiCacheActor::new(caches.cficaches, objects.clone(), cpu_threadpool.clone());
let spawnpool =
procspawn::Pool::new(num_cpus::get()).context("failed to create process pool")?;
let spawnpool = procspawn::Pool::new(config.processing_pool_size)
.context("failed to create process pool")?;

let symbolication = SymbolicationActor::new(
objects.clone(),
Expand Down
4 changes: 4 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ pub struct Config {

/// Allow reserved IP addresses for requests to sources.
pub connect_to_reserved_ips: bool,

/// Size of internal processing pool.
pub processing_pool_size: usize,
}

impl Config {
Expand Down Expand Up @@ -293,6 +296,7 @@ impl Default for Config {
symstore_proxy: true,
sources: Arc::new(vec![]),
connect_to_reserved_ips: false,
processing_pool_size: num_cpus::get(),
}
}
}
Expand Down