一个 asp.net core 站点,之前运行在Linux 服务器上,运行一段时间后有时站点会挂掉,在日志中记录很多“EMFILE too many open files”的错误: Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException: Error -24 EMFILE too many open files 后来将这个 asp.net 站点部署到 Windows 服务器的 IIS 上.运行一段时间后,发现其中一台
查看最大线程数: cat /proc/sys/kernel/threads-max ulimit User limits - limit the use of system-wide resources. Syntaxulimit [-acdfHlmnpsStuv] [limit] Options -S Change and report the soft limit associated with a resource. -H Change and report the hard limit
1.cat /proc/${pid}/status 2.pstree -p ${pid} 3.top -p ${pid} 再按H,或者直接输入 top -bH -d 3 -p ${pid} top -H手册中说:-H : Threads toggle加上这个选项启动top,top一行显示一个线程.否则,它一行显示一个进程. 4.ps xH手册中说:H Show threads as if they were processes这样可以查看所有存在的线程. 5.ps -mp <PID>手册中说