很久没有更新博客了,说下系统环境:
uname -a Linux REDHAT6 2.6.32-279.el6.x86_64 #1 SMP Wed Jun 13 18:24:36 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux
tomcat的java进程号1243
[root@REDHAT6 proc]# ps -eL|head -1 PID LWP TTY TIME CMD [root@REDHAT6 proc]# ps -eL|grep java 1243 1243 pts/0 00:00:00 java 1243 1244 pts/0 00:00:01 java 1243 1245 pts/0 00:00:32 java 1243 1246 pts/0 00:00:00 java 1243 1247 pts/0 00:00:00 java 1243 1248 pts/0 00:00:00 java 1243 1249 pts/0 00:00:03 java 1243 1250 pts/0 00:00:04 java 1243 1251 pts/0 00:00:00 java 1243 1252 pts/0 00:00:08 java 1243 1253 pts/0 00:00:00 java 1243 1259 pts/0 00:00:00 java
cd /proc
[root@REDHAT6 proc]# ls -d [0-9]* 1 1058 11 1158 12 1212 1395 16 2 23 25 27 293 31 35 381 40 44 52 692 729 733 9 10 1068 1111 1166 1207 1243 14 17 20 24 250 28 294 32 36 383 41 49 53 693 730 772 1014 1069 1128 1174 1209 1265 1462 18 21 242 251 29 3 33 37 39 42 5 6 7 731 8 1021 1097 1136 1189 1210 13 15 19 22 243 26 292 30 34 38 4 43 50 687 728 732 83 我们会发现根本看不到1244,1245等pid,别急, [root@REDHAT6 proc]# ls 1244 attr clear_refs cwd fdinfo maps mountstats oom_score root smaps status autogroup cmdline environ io mem net oom_score_adj sched stack syscall auxv coredump_filter exe limits mountinfo numa_maps pagemap schedstat stat task cgroup cpuset fd loginuid mounts oom_adj personality sessionid statm wchan [root@REDHAT6 proc]# ll 1244/exe lrwxrwxrwx 1 root root 0 11月 6 11:27 1244/exe -> /usr/local/jdk1.6.0_45/bin/java
看到了吧,虽然看不到1244,但是显示的内容其实就是1243的内容,本质上1244就是LWP进程号。
同时我们也可以理解,linux下最大进程数限制同时也对线程起了作用。如果要增大最大线程数,那就要增大最大进程数。
[root@REDHAT6 proc]# cat /etc/security/limits.d/90-nproc.conf # Default limit for number of user‘s processes to prevent # accidental fork bombs. # See rhbz #432903 for reasoning. * soft nproc 1024
本文出自 “君子博学而日参省乎己..” 博客,请务必保留此出处http://linuxgp.blog.51cto.com/1708668/1572996
原文地址:http://linuxgp.blog.51cto.com/1708668/1572996