mysqld 多线程 用pstree -p 显示

http://blog.chinaunix.net/uid-22566367-id-3751084.html

http://blog.csdn.net/fly2nn/article/details/6980236

 

pstree -p 6762    :mysqld 多线程序,当一个请求来,就建立一个线程 (12244 ,15470) 为MYSQL登陆对应的服务线程,其他线程不变

进程的pid:
[root@localhost ~]# ps -ef | grep mysqld | grep -v "grep" | awk '{print $2}'
6762

查看进程的所有线程
[root@localhost ~]# ps -L 6762
  PID   LWP TTY      STAT   TIME COMMAND
 6762  6762 pts/1    Sl+    0:02 ./mysqld --debug
 6762  6763 pts/1    Sl+    0:00 ./mysqld --debug
 6762  6764 pts/1    Sl+    0:00 ./mysqld --debug
 6762  6765 pts/1    Sl+    0:00 ./mysqld --debug
 6762  6766 pts/1    Sl+    0:00 ./mysqld --debug
 6762  6767 pts/1    Sl+    0:00 ./mysqld --debug
 6762  6768 pts/1    Sl+    0:00 ./mysqld --debug
 6762  6769 pts/1    Sl+    0:00 ./mysqld --debug
 6762  6770 pts/1    Sl+    0:00 ./mysqld --debug
 6762 12244 pts/1    Sl+    0:00 ./mysqld --debug

查看所有子进程:
[root@localhost ~]# pstree -p 6762

mysqld(6762)─┬─{mysqld}(6763)
             ├─{mysqld}(6764)
             ├─{mysqld}(6765)
             ├─{mysqld}(6766)
             ├─{mysqld}(6767)
             ├─{mysqld}(6768)
             ├─{mysqld}(6769)
             ├─{mysqld}(6770)
             ├─{mysqld}(12244)

 

查看进程的当前状态:
[root@localhost ~]# cat /proc/12244/status
Name:   mysqld
State:  S (sleeping)
Tgid:   6762
Pid:    12244
PPid:   4383

 

 


            

 

转载于:https://www.cnblogs.com/zengkefu/p/4951422.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值