FPM improve listen queue status info
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- C
- Star
- 40.4k
- Fork
- 8.1k
- Merge trung bình
- 2 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 96
Mô tả
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.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách truy vết cách FPM hiện lấy các giá trị hàng đợi lắng nghe thông qua tcp_info, sau đó so sánh cách tiếp cận netlink sock_diag của Linux với các tùy chọn SO_LISTENQLIMIT, SO_LISTENQLEN và SO_LISTENINCQLEN của FreeBSD. Hoàn thành có nghĩa là có trạng thái hàng đợi lắng nghe chính xác cho các socket inet và socket miền Unix mà không yêu cầu dependency libnl bắt buộc.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- c
- Lĩnh vực
- networking
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 30/100