[zz]Troubleshooting Memory Usage
程序员文章站
2022-07-14 14:12:19
...
http://rimuhosting.com/howto/memory.jsp
# create a memmon.sh script that tracks the current date, memory usage and running processes cat << EOF > /root/memmon.sh #!/bin/bash date; uptime free -m vmstat 1 5 ps auxf --width=200 if which iptables 2>&1 > /dev/null; then iptables -L | diff iptables_default - | awk '{print "IPTABLES: " $0}' iptables -L > iptables_default else echo "IPTABLES MISSING" fi dmesg | diff -u dmesg_default - | grep '^+' | awk '{print "DMESG:" $0}' dmesg > dmesg_default EOF chmod +x /root/memmon.sh # create a cronjob that runs every few minutes to log the memory usage echo '0-59/10 * * * * root /root/memmon.sh >> /root/memmon.txt' > /etc/cron.d/memmon /etc/init.d/cron* restart # create a logrotate entry so the log file does not get too large echo '/root/memmon.txt {}' > /etc/logrotate.d/memmon
推荐阅读
-
PHP通过内置函数memory_get_usage()获取内存使用情况,memorygetusage_PHP教程
-
用PHP函数memory_get_usage获取当前PHP内存消耗量以实现程序的性能优化
-
memory_get_usage()的结果为什么会变化非常大
-
PHP通过内置函数memory_get_usage()获取内存使用情况,memorygetusage_PHP教程
-
memory_get_usage 疑问
-
采用PHP函数memory_get_usage获取PHP内存清耗量的方法_PHP
-
采用PHP函数memory_get_usage获取PHP内存清耗量的方法
-
PHP管理内存函数 memory_get_usage()使用介绍_PHP教程
-
memory_get_usage获取当前PHP内存消耗量的例子
-
memory_limit跟memory_get_usage的关系