Skip to content

Introduce Optimizer settings#34

Merged
andig merged 2 commits into
evcc-io:mainfrom
lfloeer:feature/optimizer-settings
Oct 12, 2025
Merged

Introduce Optimizer settings#34
andig merged 2 commits into
evcc-io:mainfrom
lfloeer:feature/optimizer-settings

Conversation

@lfloeer
Copy link
Copy Markdown
Contributor

@lfloeer lfloeer commented Oct 12, 2025

Uses PyDantic Settings to make the optimizer configurable in terms of threads and time.

By setting the environment variable OPTIMIZER_NUM_THREADS or OPTIMIZER_TIME_LIMIT, you can set these values from the environment.

After this is merged, it might make sense to run either

  • --num-workers 4 and OPTIMIZER_NUM_THREADS=2
  • --num-workers 8 and OPTIMIZER_NUM_THREADS=1

This might lead to longer times to solve the optimizations but should lead to a steady usage of at most 8 cores even under heavy load.

The default gunicorn timeout is 30 seconds, so OPTIMIZER_TIME_LIMIT=30 might make sense to set as well.

@andig andig merged commit a9a4cd6 into evcc-io:main Oct 12, 2025
2 checks passed
@andig
Copy link
Copy Markdown
Member

andig commented Oct 12, 2025

Great PR, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants