Skip to content

[codex] limit FHEM upstream concurrency#99

Open
sidey79 wants to merge 9 commits into
mainfrom
feat/fhem-upstream-throttle
Open

[codex] limit FHEM upstream concurrency#99
sidey79 wants to merge 9 commits into
mainfrom
feat/fhem-upstream-throttle

Conversation

@sidey79

@sidey79 sidey79 commented Jun 20, 2026

Copy link
Copy Markdown
Owner

What changed

  • Limited Caddy's FHEM upstream connections via max_conns_per_host 20 in the shared fhem_transport block.

Why

  • Parallel image loads against FHEM were reproducing intermittent 401 responses from FHEM and occasional 502 dial timeouts from Caddy.
  • The tests showed the issue only under higher concurrency, so throttling the upstream is the first mitigation step.

Validation

  • Reproduced the issue with parallel curl requests.
  • Confirmed that the branch was pushed and is ready for a Portainer-based deployment test.

Notes

  • This is a mitigation, not the root-cause fix.
  • Next step is to rerun the load test after deploying this branch and compare the error rate.

@sidey79 sidey79 marked this pull request as ready for review June 23, 2026 17:50

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1b4b586880

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread caddy/Caddyfile Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: de5bb8031d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread caddy/Caddyfile Outdated
Comment thread caddy/Caddyfile Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 631eeace0d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread caddy/Caddyfile
try_files {path} /__fhem_backend/fhem{uri}
handle_path /__fhem_backend/* {
reverse_proxy https://fhem-fhem-1.network_backend_net:8088 {
transport http {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Apply the FHEM connection cap to image fallback

When an image is absent from /srv/fhem-www (or the new bind mount is unreadable), this newly added fallback still proxies the /fhem/images/* burst to fhem-fhem-1:8088 through its own inline transport http. Caddy documents max_conns_per_host as a transport http option that limits that transport's connections, but this transport neither imports fhem_transport nor sets the cap, so the exact fallback path for missing/custom images bypasses the 20-connection mitigation.

Useful? React with 👍 / 👎.

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.

1 participant