php / php/php-src

FPM improve listen queue status info

Abierto
#9,943 3 comentarios 5 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Feature SAPI: fpm
Lenguaje dominante
C
Estrellas
40.4k
Forks
8.2k
Merge medio
2 d 13 h
PR fusionados (30 d)
96

Descripción

Description

Currently tcp_info structure is used to get information about listen queue that is then shown in FPM status. It uses tcpi_unacked (or __tcpi_unacked on FreeBSD or NetBSD) for current listen queue status value and tcpi_sacked (or __tcpi_sacked on FreeBSD or NetBSD) which is used for max listen queue and listen queue length. The queue length is however just approximation (at least on Linux) expecting that maximum is reached which is often not the case on modern Linux kernl (one of the example is a bug #76323). In addition this works only for inet socket but doesn't work for unix domain socket as mentioned in bug #80739.

The solution for this on Linux is to use netlink with sock_diag. It brings some challenges (like keeping inode number for the socket) but provides the required info and more. We could consider using libnl but that might not be a good idea as it would require an explicit non default dependency so it might not be always available (e.g. when FPM is compiled without it).

The FreeBSD should probably prefer the SO_LISTENQLIMIT, SO_LISTENQLEN and SO_LISTENINCQLEN (for UDS) to get the required info as those options are specifically meant to be used for this and tcp_info is quite undocumented there. It also can provide the info for unix domain socket as mentioned.

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza trazando cómo FPM obtiene actualmente los valores de la cola de escucha mediante tcp_info y, después, compara el enfoque de Linux basado en netlink sock_diag con las opciones SO_LISTENQLIMIT, SO_LISTENQLEN y SO_LISTENINCQLEN de FreeBSD. Se considerará terminado cuando el estado de la cola de escucha sea preciso para sockets inet y de dominio Unix sin requerir una dependencia obligatoria de libnl.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
c
Área
networking
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
30/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.