php / php/frankenphp

interface to collect necessary stats for building a k8s readiness probe.

Open
#1,122 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
11.3k
Forks
488
Avg merge
4d 10h
Merged PRs (30d)
11

Description

Describe you feature request

Is your feature request related to a problem? Please describe.
I am very new to frankenphp so could certainly have missed something in the docs that allow me to do this.

I am trying to deploy frankenphp to k8s. I would like to sanely configure readiness probes to keep instances from getting overloaded with requests. I think this would predominantly come down to having 2 key metrics:

  • how many of the workers are currently handling a request
  • how many requests are queued up waiting for workers

Additional metrics may be good:

  • avg delay before queued requests are dispatched?

Describe the solution you'd like
I would like to have some sort of interface (http, cli that can be invoked, etc) which would export the above and perhaps more. I would then write a script to be executed which would retrieve that info, allow for some threshold of queued requests waiting for a thread, and if above the threshold k8s would stop sending traffic to that instance until things settle a bit.

Ideally the metrics would exclude any requests that are for non-php workers (ie: static files, etc).

Perhaps the caddy admin port already has some of this data?

Describe alternatives you've considered
I can have an endpoint in my app, but that seems less than ideal as each check would itself take up a thread/worker.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests; start by tracing the existing PHP worker handling and checking whether the Caddy admin port exposes relevant data. Done means providing an interface that reports active workers and queued requests for PHP work, with enough information to support a Kubernetes readiness probe.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes, php
Domain
backend, devops, observability
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.