Linux-Nginx-关闭进程
当然就仅仅是介绍一条命令了,就这么简单。
nginx默认创建一个工作进程
root 2713 1 0 07:56 ? 00:00:00 nginx: master process ../sbin/nginx
nobody 2714 2713 0 07:56 ? 00:00:00 nginx: worker process
改动worker_processes=10。来创建多个进程
#user nobody;
worker_processes 10;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
pid logs/nginx.pid;
events {
worker_connections 1024;
}
fuhui@ubuntu:/usr/local/nginx$ ps -ef | grep 'nginx'
root 2713 1 0 07:56 ? 00:00:00 nginx: master process ../sbin/nginx
nobody 2747 2713 0 08:00 ?
00:00:00 nginx: worker process
nobody 2748 2713 0 08:00 ? 00:00:00 nginx: worker process
nobody 2749 2713 0 08:00 ? 00:00:00 nginx: worker process
nobody 2750 2713 0 08:00 ? 00:00:00 nginx: worker process
nobody 2751 2713 0 08:00 ?
00:00:00 nginx: worker process
nobody 2752 2713 0 08:00 ? 00:00:00 nginx: worker process
nobody 2753 2713 0 08:00 ?
00:00:00 nginx: worker process
nobody 2754 2713 0 08:00 ?
00:00:00 nginx: worker process
nobody 2755 2713 0 08:00 ?
00:00:00 nginx: worker process
nobody 2756 2713 0 08:00 ? 00:00:00 nginx: worker process
fuhui 2852 2332 0 08:29 pts/6 00:00:00 grep --color=auto nginx
错误的运行方式
fuhui@ubuntu:/usr/local/nginx$ sudo ps -ef | grep 'nginx' | awk '{kill -9 $2}'
正确的运行方式
fuhui@ubuntu:/usr/local/nginx$ sudo kill ` ps -ef | grep 'nginx' | awk '{print $2}' `
To kill all Nginx Processes
kill $(ps aux | grep '[n]ginx' | awk '{print $2}')
使用“跟$()效果是一样的
Linux-Nginx-关闭进程的更多相关文章
- Linux查看关闭进程
ps:进程的静态列表(Process status) - PID:进程号,每个进程独一无二的标识符(关闭进程需要使用) - TTY:终端所属,表明进程产生于哪一个终端,对于多用户使用的Linux服务器 ...
- linux kill 关闭进程命令
杀死进程最安全的方法是单纯使用kill命令,不加修饰符,不带标志. 首先使用ps -ef命令确定要杀死进程的PID,然后输入以下命令: # kill -pid 注释:标准的kill命令通常都能达到目的 ...
- linux批量关闭进程
ps aux | grep gunicorn_api | awk '{print $2}' | xargs kill -9 gunicorn 换成你的关键字即可.
- linux nginx启动 重启 关闭命令
启动操作 nginx -c /usr/local/nginx/conf/nginx.conf -c参数指定了要加载的nginx配置文件路径 停止操作停止操作是通过向nginx进程发送信号来进行的 步骤 ...
- linux 下python进程查看及关闭
查看进程 ps -ef |grep python 关闭进程 kill -9 26879 其中26879为进程号. linux下后台执行某个python脚本 nohup python -u xxx.py ...
- Linux系统Tomcat进程使用shutdown无法关闭进程
问题场景: 若在应用中启动了用户线程,在Linux系统Tomcat进程使用shutdown无法关闭进程. 解决方案: #1.在catalina.sh文件中添加CATALINA_PID [root@lo ...
- linux 查看端口占用情况并关闭进程
首先要搞清楚 linux 查看进程和查看端口是两个概念,一般来讲进程会有多个,而固定端口只会有一个. 1.查看进程 ,通常在使用 ps 命令后 用管道连接(ps -ef|grep xxx ) 查 ...
- LNMP(linux+nginx+mysql+php)服务器环境配置
一.简介 Nginx是俄罗斯人编写的十分轻量级的HTTP服务器,Nginx,它的发音为 “engine X”, 是一个高性能的HTTP和反向代理服务器,同时也是一个IMAP/POP3/SMTP 代理服 ...
- linux+nginx+mysql+php
LNMP(linux+nginx+mysql+php)服务器环境配置 一.简介 Nginx是俄罗斯人编写的十分轻量级的HTTP服务器,Nginx,它的发音为 “engine X”, 是一个高性能的 ...
- Nginx的进程模型及高可用方案(OpenResty)
1. Nginx 进程模型简介 Nginx默认采用多进程工作方式,Nginx启动后,会运行一个master进程和多个worker进程.其中master充当整个进程组与用户的交互接口,同时对进程进行监护 ...
随机推荐
- 【BZOJ 1036】【ZJOI 2008】树的统计Count
http://www.lydsy.com/JudgeOnline/problem.php?id=1036 复习了一下好写好调的lct模板啦啦啦--- #include<cstdio> #i ...
- 【计算几何】【圆反演】hdu6097 Mindis
给你一个中心在原点的圆,再给你俩在圆内且到原点距离相等的点P,Q,让你在圆上求一点D,最小化DP+DQ. http://blog.csdn.net/qq_34845082/article/detail ...
- 【tarjan+缩点】POJ1236[IOI1996]-Network of Schools
[题意] 见:http://blog.csdn.net/ascii991/article/details/7466278 [思路] 缩点+tarjan,思路也可以到上面的博客去看.(吐槽:这道题其实我 ...
- 2016. 4.10 NOI codevs 动态规划练习
1.codevs1040 统计单词个数 1040 统计单词个数 2001年NOIP全国联赛提高组 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold 题目描述 De ...
- [转]Hibernate中Session的get和load
hibernate中Session接口提供的get()和load()方法都是用来获取一个实体对象,在使用方式和查询性能上有一些区别.测试版本:hibernate 4.2.0. get Session接 ...
- 关于JS的This指针
下面讨论一个执行上下文的最后一个属性——this指针的概念. This指针 A this value is a special object which is related with the exe ...
- ConstraintLayout导读
ConstraintLayout是Android Studio 2.2中主要的新增功能之一,也是Google在去年的I/O大会上重点宣传的一个功能,可以把ConstraintLayout看成是一个更高 ...
- MDD:使用模型驱动开发方式进行快速开发(多图预警)
相信很多人跟我一样,不喜欢数据展示.列表分页.数据的增.删.改.查,这种简单又烦琐的搬砖活. 所以网上出现很多开源的代码生成工具,在多年前我也写过,根据模版生成简单的View.Action.Servi ...
- HDU 4632 Palindrome subsequence (2013多校4 1001 DP)
Palindrome subsequence Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/65535 K (Java/ ...
- HDU 3360 National Treasures(二分匹配,最小点覆盖)
National Treasures Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Other ...