Skip to content

Conversation

@samdark
Copy link
Contributor

@samdark samdark commented May 13, 2025

  1. Added example of setting timeouts to "Using Classic Mode" page.
  2. Added example of enabling metrics to "Metrics" page.

Congrats on joining PHP 🎉

samdark and others added 3 commits May 25, 2025 15:12
@samdark
Copy link
Contributor Author

samdark commented May 27, 2025

@dunglas I think there will be no more adjustments to this pull request.

Queued connections will wait indefinitely until a PHP thread is available to serve them. To prevent that, you can use the `max_wait_time` [configuration](config.md#caddyfile-config) to limit how long a request may wait for a free PHP thread before being rejected.
Additionally, you can set a reasonable [write timeout in Caddy](https://caddyserver.com/docs/caddyfile/options#timeouts).

Here is how to do it using environment variables:
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should just provide the Caddyfile snippet? Environment variables are only available with Docker images and aren't supported by default if you use a custom Caddyfile.

WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Personally, I'm using docker-compose and not supplying a custom Caddyfile with the image. I believe many people are doing it similarly.

Choose a reason for hiding this comment

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

I just happened to see this. The conversation here has stopped for about a month, how is the progress?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we should either provide two examples everywhere (since docker-compose syntax is hard to grasp based on Caddyfile) or use different config styles as I did in this PR to show how to use both by example.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dunglas thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

As environnement variables are just injected in the Caddyfile, and that all FrankenPHP builds (Docker, static, Homebrew, deb, RPM...) support Caddyfile, but not always environmentally vars, I would use Caddyfile examples everywhere, and add additional examples (as GitHub markdown tips for instance) using environnement variables to do the same thing if needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, duplicating examples everywhere for different envs? Alright. Anyone who can help me with adding Caddyfile ones? Never used it :(

Copy link
Contributor

Choose a reason for hiding this comment

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

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.

6 participants