Reputation: 61
Is there a way to check if I reached a limit/kernel limit of any kind of buffer in Linux?
Like one command that tell you :
openfile limit reached
max net connection reached
net buffer full
inodes full
memory buffer full
All the other weird buffers that could be getting full in a server just like vmstat -z in FreeBSD.
P.S.: I know I can look at the logs, but if I have tons of lines it's a slow process.
Upvotes: 2
Views: 1604
Reputation: 782166
The details depend on the specific limit. In general, you'll get an error from a system call when it tries to exceed a limit. For instance, open()
will return -1
and set errno
to EMFILE
when if you can't open a file because of the openfile limit.
If you run out of heap memory, malloc()
will return NULL
to indicate that it can't allocate any more memory.
Since this is a programming site, I assumed you wanted to know how to do this in application programs. I have a feeling you're actually asking how to monitor the system in general for this, which is off-topic for SO -- sysadmin.com would be a better place.
Upvotes: 2