Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a log file that logs information when the values set in /etc/security/limits.conf are exceeded?

If the values are too tight in the above file the clients using the website hosted on the server sees errors such as [FATAL] failed to allocate memory . But I wont be intimidated about it. So is there a log?

If not is there a way to make it log when the values are exceeded?

share|improve this question
up vote 3 down vote accepted

limits.conf is a too blunt an instrument for what you are trying to do.

cgroups will set limits and provide accounting for you, but the documentation is a little obtuse!

share|improve this answer

Is there a log file that logs information when the values set in /etc/security/limits.conf are exceeded?


All those values go at last to process resource limits (man setrlimit) and when they met there's no universal mechanism to issue an warning to be logged.

share|improve this answer

if your issue is about memory allocation failed you could also use this script to monitor percentage of free memory left

# you can adjust 0.20 meaning 20% to percentage of memory free you want 
output=$(free | grep "Swap" | awk '{if (($4/$2) < 0.20) print "memory low"}')
if [[ "$output" != "" ]]; then
    echo "..." | mail -s "Memory low on <host>" <monitoring email>

save it to script file (ex. and add to crontab it will send email and write log file when detect free memory low as conditioned)

# Ex. monitor every 3 min.
*/3 * * * * /home/user/ >> /home/user/memmon.log
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.