简体   繁体   English

将芹菜与金字塔和mod_wsgi一起使用

[英]using celery with pyramid and mod_wsgi

I've been able to deploy a test application by using pyramid with pserve and running pceleryd (I just send an email without blocking while it is sent). 通过使用带有pserve的金字塔并运行pceleryd,我已经能够部署测试应用程序(我只是发送电子邮件而不会在发送时阻止)。

But there's one point that I don't understand: I want to run my application with mod_wsgi, and I don't understand if I can can do it without having to run pceleryd from a shell, but if I can do something in the virtualhost configuration. 但是有一点我不理解:我想使用mod_wsgi运行我的应用程序,而且我不知道是否可以不必从shell运行pceleryd就能做到这一点,但是我是否可以在virtualhost中做点什么组态。

Is it possible? 可能吗? How? 怎么样?

There are technically ways you could use Apache/mod_wsgi to manage a process distinct from that handling web requests, but the pain point is that Celery will want to fork off further worker processes. 从技术上讲,您可以使用Apache / mod_wsgi来管理与处理Web请求不同的进程,但是痛苦的是Celery将希望分派进一步的工作进程。 Forking further processes from a process managed by Apache can cause problems at times and so is not recommended. 从Apache管理的进程派生进一步的进程有时会引起问题,因此不建议这样做。

You are thus better of starting up Celery process separately. 因此,最好单独启动Celery进程。 One option is to use supervisord to start it up and manage it. 一种选择是使用超级用户来启动和管理它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM