dongtu1357 2018-04-17 08:39
浏览 44

Symfony Beanstalkd失去了连接oracle

I have a problem with beanstalkd on a symfony(3.4) project.

I have a symfony command used to analyse informations, the analyser is in a while true to keep the command running 24/7.

$pheanstalk = new Pheanstalk('127.0.0.1');

while (true) {
   $pheanstalk->watch($worker);
   $queue = $pheanstalk->statsTube($worker);
   if ($queue['current-jobs-ready'] > 0) {
      analyseInformations();
   else {
      //get the most charged worker...
   }

The problem that after X minutes, 5, 10 or 15, the command return exception : ORA-03135 Connection Lost

The dba said that the problem come from the symfony project and not the oracle database, i have missed anything with the beanstalkd connection ?

Beanstalkd have a timeout connection to the database ? Anything to do with the pool connection symfony ?

In the project we use doctrine dbal to make request to the database.

The exception message :

111:29:01 ERROR [console] Error thrown while running command "analyser". Message: "An exception occurred while executing 'SELECT XXX FROM XXX:

ORA-03113: end-of-file on communication channel ID de processus : 20624 ID de session : 154, Numéro de série : 6639"

Thank you

  • 写回答

1条回答 默认 最新

  • douxiajia6720 2018-04-17 22:02
    关注

    PHP isn't particularly well suited to long-running processes. I've run tens of millions of jobs through Beanstalkd, and hundreds of millions through other queuing systems, and will generally run the loop for some number of iterations (from 5 or 10 to several hundred or more), and then exit the script to have it clean up, and restart.

    You can have whatever kicks off the script also arrange to restart it, init, upstart, supervisord or a shell script that is started from something like that.

    I tend to prefer a shell script, because then I can return a specific value from the script, which is checked by the bash script, and then it can be acted upon. For one value, I can immediately restart (as planned), or pause for a moment, or if it's a another value, it may have been an unplanned exit, which would pause for a few seconds and log the issue.

    评论

报告相同问题?

悬赏问题

  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP