为什么我看不到mod

编程入门 行业动态 更新时间:2024-10-25 00:36:27
本文介绍了为什么我看不到mod_wsgi的进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个配置如下的wsgi应用程序:

I have a wsgi application configured as follows:

WSGIApplicationGroup %{GLOBAL} WSGIDaemonProcess myapp user=myuser threads=10 maximum-requests=10000 WSGIScriptAlias / /usr/local/myapp/wsgi.py WSGIProcessGroup myapp

我希望看到我的应用程序正在运行的进程...但是使用ps aux或pstree时,我看不到任何子进程:

I expected to see running processes for my app... but with ps aux or pstree I see no child processes:

init─┬─apache2─┬─apache2 │ ├─2*[apache2───26*[{apache2}]] │ ├─apache2───14*[{apache2}] │ ├─apache2───12*[{apache2}] │ └─apache2───16*[{apache2}]

我的wsgi是否在守护程序模式下执行?如何检查python进程的运行状况?

Is my wsgi executing in daemon mode? How can I inspect the health of my python process?

我正在尝试调试我的wsgi python应用程序,该应用程序在同时请求大量连接时(例如:从单个网页发出30个连续的ajax请求)而挂起(有时会出现内存错误).

I'm trying to debug my wsgi python application which hangs (sometimes with a memory fault) when a lot of connections are requested at the same time (say: 30 consecutive ajax requests from a single web page).

推荐答案

为了完整起见,我在扩展Mikko Ohtamaa的评论.

For the sake of completeness I am expanding on the comment by Mikko Ohtamaa.

mod_wsgi进程名称确实采用了父进程的名称,例如. /usr/sbin/apache2 -k start取决于发行版等.

The mod_wsgi process name indeed takes the name of the parent process, something like eg. /usr/sbin/apache2 -k start depending on distros etc.

使用display-name选项使我们可以设置其他进程名称:

Using the display-name option allows us to set a different process name:

为使用ps命令列出进程的守护进程定义一个不同的名称.如果值为%{GROUP},则名称将为(wsgi:group),其中组用守护进程组的名称替换.

Defines a different name to show for the daemon process when using the ps command to list processes. If the value is %{GROUP} then the name will be (wsgi:group) where group is replaced with the name of the daemon process group.

请注意,只能显示执行值的argv0最初占用的字符数.超出此限制的任何内容都将被截断.

Note that only as many characters of the supplied value can be displayed as were originally taken up by argv0 of the executing process. Anything in excess of this will be truncated.

此功能可能无法在所有平台上都起作用.通常,它还需要具有BSD传统的ps程序.因此,在某些版本的Solaris UNIX上,/usr/bin/ps程序不起作用,而/usr/ucb/ps则起作用.其他可以显示此值的程序包括htop.

This feature may not work as described on all platforms. Typically it also requires a ps program with BSD heritage. Thus on some versions of Solaris UNIX the /usr/bin/ps program doesn’t work, but /usr/ucb/ps does. Other programs which can display this value include htop.

参考.

示例:

WSGIDaemonProcess myapp user=myuser threads=10 maximum-requests=10000 display-name=django-myapp WSGIScriptAlias / /usr/local/myapp/wsgi.py WSGIProcessGroup myapp

然后:

ps aux | grep django-myapp

更多推荐

为什么我看不到mod

本文发布于:2023-10-16 05:25:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1496632.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:我看   mod

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!