node_exporter
node_exporter copied to clipboard
Add System V semaphores and shared memory metrics
What did you expect to see?
Same metrics as:
# ipcs -u
------ Messages Status --------
allocated queues = 0
used headers = 0
used space = 0 bytes
------ Shared Memory Status --------
segments allocated 1117
pages allocated 1535
pages resident 1535
pages swapped 0
Swap performance: 0 attempts 0 successes
------ Semaphore Status --------
used arrays = 1006
allocated semaphores = 1006
i. e. semctl(IPC_INFO, ...):
IPC_INFO (Linux-specific)
Return information about system-wide semaphore limits and parameters in the structure pointed to by arg.__buf. This structure is of type seminfo, defined in
<sys/sem.h> if the _GNU_SOURCE feature test macro is defined:
struct seminfo {
int semmap; /* Number of entries in semaphore
map; unused within kernel */
int semmni; /* Maximum number of semaphore sets */
int semmns; /* Maximum number of semaphores in all
semaphore sets */
int semmnu; /* System-wide maximum number of undo
structures; unused within kernel */
int semmsl; /* Maximum number of semaphores in a
set */
int semopm; /* Maximum number of operations for
semop(2) */
int semume; /* Maximum number of undo entries per
process; unused within kernel */
int semusz; /* Size of struct sem_undo */
int semvmx; /* Maximum semaphore value */
int semaem; /* Max. value that can be recorded for
semaphore adjustment (SEM_UNDO) */
};
The semmsl, semmns, semopm, and semmni settings can be changed via /proc/sys/kernel/sem; see proc(5) for details.
We need this because Apache is consuming a lot of semaphores on some servers.
What did you see instead?
nothing
Great idea, I did a quick check but it looks like semctl() isn't implemented by Go syscal_linux(etc).
Should be easy enough to add to x/sys/unix.
We're looking to get some of the message queue IPC stats. Would that be covered as part of this issue, or should I create a new issue that is specifically for message queue stats?
@gtaylor Doesn't look like this issue here has much traction, so whatever works best for you. IPC Queue stats seem useful! Preferably the actual logic should go into the procfs lib (or even x/sys/unix, not sure about the scope though)
I am fairly new to Grafana-Prometheus and exporters. Is this enhancement available yet? I too stumbled upon the same requirement today and could not find semaphores and shared memory stats being exported.
Afaik, nothing has changed since my last comment. So to get there:
- Add the syscall to x/sys/unix
- Add the parsing for procfs
- Add the collector here
Hi,
Would there be somewhere else to get "ipcs -u" inside node_exporter?