postgres用户的ulimit设置设置了合理的限制.我们没有达到最高限度.
/ var / log / messages中没有错误.
错误:
BETA -bash-4.2# sudo su - postgressu: /bin/bash: Resource temporarily unavailable
设置:
BETA -bash-4.2# ps -auxww | grep -i postgr | wc -l503BETA -bash-4.2# lsof | grep -i postgr | wc -l35225BETA -bash-4.2#
适用于postgres流程的Ulimit.
BETA -bash-4.2# cat /proc/26230/limits limit Soft limit Hard limit Units Max cpu time unlimited unlimited seconds Max file size unlimited unlimited bytes Max data size unlimited unlimited bytes Max stack size 8388608 unlimited bytes Max core file size 0 unlimited bytes Max resIDent set unlimited unlimited bytes Max processes 256580 256580 processes Max open files 1024 4096 files Max locked memory 65536 65536 bytes Max address space unlimited unlimited bytes Max file locks unlimited unlimited locks Max pending signals 256580 256580 signals Max msgqueue size 819200 819200 bytes Max nice priority 0 0 Max realtime priority 0 0 Max realtime timeout unlimited unlimited us
用netstat
BETA -bash-4.2# netstat -plan | grep -i post | grep ESTABliSHED | wc -l496BETA -bash-4.2#
Ulimit设置
BETA -bash-4.2# cat /etc/security/limits.d/postgres_limits.conf # limits settings for postgrespostgres soft nofile 4096postgres hard nofile 4096postgres soft nproc 400postgres hard nproc 400
在我重新开始postgres之后,我能够进入.
postgres用户的资源工具.
BETA -bash-4.2# netstat -plan | grep -i post | grep ESTABliSHED | wc -l1BETA -bash-4.2# BETA -bash-4.2# lsof | grep -i postgr | wc -l309BETA -bash-4.2# ps -auxww | grep -i postgr | wc -l8BETA -bash-4.2#解决方法 只是重新启动postgres不是一个长期的解决方案,你将再次达到极限,除非你在服务器上有物理资源限制,如内存.在发布期间,postgres用户打开的进程数(nproc)为503,估计打开文件数(nofile)为35225,而你的postgres_limits.conf显示你已经将nproc设置为400而nofile设置为仅4096.在您的数据上,您将需要增加这两个参数. 总结
以上是内存溢出为你收集整理的linux – su:/ bin / bash:资源暂时不可用全部内容,希望文章能够帮你解决linux – su:/ bin / bash:资源暂时不可用所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)