I run a testing server for a software that depends on the massive usage of mqueues (POSIX messages queues). I increased limits to a reasonable level and got it working a long time ago. However, the number of tests (and their mqueues) keeps rising and the tests are starting to fail at creating new mqueues, although the limits don’t seem to be exhausted.
$ sudo mount -t mqueue none /mnt $ cat /proc/sys/fs/mqueue/queues_max # maximum mqueue count 65535 $ ls -1 /mnt | wc -l # current mqueue count 8445 $ ulimit -q # maximum bytes in mqueues 819200 $ du -s /mnt # current mqueues size 0 /mnt
#define EMFILE 24 /* Too many open files */
Therefore I checked the limit for open files but it seems to be not exhausted, too.
$ ulimit -n # file descriptors limit 1024 $ lsof -u $(whoami) | wc -l # currently open files 306
Are these checks correct? Is there anything more I should check?
I have looked at How to check ulimit usage but the usage checks seem to be specific to particular limits and mqueues are not mentioned there.
Since the behavior of mqueues has been changing over time due to bugs, my kernel version is
I built the kernel myself using the appropriate real-time patch with no further modifications. I have not switched the kernel recently (when the problem started to appear).