Home  >  Article  >  Backend Development  >  yii2 - 请教下php使用队列问题

yii2 - 请教下php使用队列问题

WBOY
WBOYOriginal
2016-06-06 20:22:561311browse

我目前app后台使用的是yii2写的, 做推送的时候使用的是 beanstalkd队列

在本地开发的时候 监听队列进程从没有挂过
php yii worker or ./yii worker

不过本地的终端 从没有关过

我之前在opensuse上开发, 后期换到win10都没问题

不过放到服务器上 worker 就各种挂, 基本上一推送就挂, 最初是怀疑, 推送日志输出到终端的问题, 就把输出内容 输出到缓冲区了, 结果还是挂, 在后来就是 把内容重定向, ./yii worker > push.log& 也没解决这问题,

所以请教各位前辈, 有没有借鉴的经验

回复内容:

我目前app后台使用的是yii2写的, 做推送的时候使用的是 beanstalkd队列

在本地开发的时候 监听队列进程从没有挂过
php yii worker or ./yii worker

不过本地的终端 从没有关过

我之前在opensuse上开发, 后期换到win10都没问题

不过放到服务器上 worker 就各种挂, 基本上一推送就挂, 最初是怀疑, 推送日志输出到终端的问题, 就把输出内容 输出到缓冲区了, 结果还是挂, 在后来就是 把内容重定向, ./yii worker > push.log& 也没解决这问题,

所以请教各位前辈, 有没有借鉴的经验

./yii worker > push.log 2>&1 &
标准错误也重定向一下。

再不行,看看脚本会不会碰到exit die之类的;

再不行,用 valgrind php yii worker 试试,看看是不是PHP本身或者扩展出现段错误

如果断开连接要加nohup

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn