Coder Social home page Coder Social logo

Comments (18)

ruudk avatar ruudk commented on May 28, 2024

I'm using Supervisor and don't have any problems. I don't use the Symfony2 command but I directly call the bin/resque file like this:

[program:app:campfire]
directory=/home/myapp/current
command=php vendor/bcc/resque-bundle/BCC/ResqueBundle/bin/resque
numprocs=1
stdout_logfile=/home/myapp/shared/app/logs/workers/campfire.log
stderr_logfile_maxbytes=10MB
redirect_stderr=true
autostart=true
autorestart=true
environment=ENVIRONMENT='prod',QUEUE='campfire',PREFIX='app',BLOCKING=1,INTERVAL=5,APP_INCLUDE='/home/myapp/current/app/bootstrap.php.cache'
user=app
stopsignal=QUIT

from bccresquebundle.

t3chn0r avatar t3chn0r commented on May 28, 2024

Thanks @ruudk, I was able to get the scheduler running and I'm able now to start and stop it using supervisorctl. The weird thing was that the directory bin under ResqueBundle was not there, it seems like composer doesn't download that folder at all.

With that said, I'm now having problems with resque, when I try to start the service I get the following error...

PHP Stack trace:
PHP   1. {main}() .../vendor/bcc/resque-bundle/BCC/ResqueBundle/bin/resque:0
PHP Fatal error:  Class 'Resque_Log' not found in .../vendor/bcc/resque-bundle/BCC/ResqueBundle/bin/resque on line 43

Any ideas? I checked the entire bcc structure and I couldn't find that class. I wonder is composer is also failing to install other files from this bundle?

Regards,
t3chn0r

from bccresquebundle.

ruudk avatar ruudk commented on May 28, 2024

Did composer install chrisboulton/resque correctly? And what is your supervisorctl config?

On 15 dec. 2013, at 20:35, t3chn0r [email protected] wrote:

Thanks @ruudk, I was able to get the scheduler running and I'm able now to start and stop it using supervisorctl. The weird thing was that the directory bin under ResqueBundle was not there, it seems like composer doesn't download that folder at all.

With that said, I'm now having problems with resque, when I try to start the service I get the following error...

PHP Stack trace:
PHP 1. {main}() .../vendor/bcc/resque-bundle/BCC/ResqueBundle/bin/resque:0
PHP Fatal error: Class 'Resque_Log' not found in .../vendor/bcc/resque-bundle/BCC/ResqueBundle/bin/resque on line 43
Any ideas? I checked the entire bcc structure and I couldn't find that class. I wonder is composer is also failing to install other files from this bundle?

Regards,
t3chn0r


Reply to this email directly or view it on GitHub.

from bccresquebundle.

t3chn0r avatar t3chn0r commented on May 28, 2024

Well, it is installed but I guess it's not complete. The Resque_Log seems to be in that package in a file named Log.php but I don't have that file. Maybe it's related to this comment...

The supervisorctl config is exactly the same as yours but with different paths for my app...

What do you have in your composer.json? Do you also have all the packages or do you only have this bundle? And which version do you have? Or do you have dev-master?

Thanks a lot again for your help!

from bccresquebundle.

ruudk avatar ruudk commented on May 28, 2024

This is my composer file:

"chrisboulton/php-resque": "dev-master",
"chrisboulton/php-resque-scheduler": "dev-master",
"bcc/resque-bundle": "dev-master"

Do you see the vendor/chrisboulton directory?

from bccresquebundle.

t3chn0r avatar t3chn0r commented on May 28, 2024

Yes, that did it! I'm having another problem now but I reopened an old thread instead so we can get the issue solve. Thanks a lot @ruudk ! 👍

from bccresquebundle.

ruudk avatar ruudk commented on May 28, 2024

The problem is with the versioning of PHP-Resque. The last release was a year ago. If they release a new version, we can require that version so you only have to require bcc/resque-bundle. For now, you should do it this (ugly) way :(

from bccresquebundle.

epicwhale avatar epicwhale commented on May 28, 2024

@ruudk @t3chn0r

Correct me if I'm wrong here.. but for every worker I want to run and monitor with supervisord, I need to create a new [program:..] entry in the config file? And NOT use the --count=x parameter?

from bccresquebundle.

ruudk avatar ruudk commented on May 28, 2024

Yes. You can set num_procs with supervisord.

from bccresquebundle.

epicwhale avatar epicwhale commented on May 28, 2024

@ruudk thanks, got it working.

Please note, its numprocs (not num_procs). This worked for me.
numprocs=5 process_name=%(program_name)s_%(process_num)02d

from bccresquebundle.

ruudk avatar ruudk commented on May 28, 2024

Great!

from bccresquebundle.

epicwhale avatar epicwhale commented on May 28, 2024

@ruudk also, shouldn't the supervisor configuration have a stopsignal=QUIT.

Else won't stopping the process/group cause on-going jobs to be shut in an intermediate state?

from bccresquebundle.

ruudk avatar ruudk commented on May 28, 2024

I don't know, I run 10 workers in 1 group and when I stop the group it takes like 5 seconds to stop all the workers. So I think the default will be good already? Or am I wrong?

from bccresquebundle.

epicwhale avatar epicwhale commented on May 28, 2024

The php-resque documentation mentions that it supports SIGNALS just like the Ruby version

QUIT - Wait for job to finish processing then exit
TERM / INT - Immediately kill job then exit
USR1 - Immediately kill job but don't exit
USR2 - Pause worker, no new jobs will be processed
CONT - Resume worker.
https://github.com/chrisboulton/php-resque

I believe by default, supervisor uses the 'TERM' signal which means it will immediately kill the job? Isn't that undesirable? (vs QUIT which waits for on-going jobs to finish processing and then exits gracefully)

from bccresquebundle.

ruudk avatar ruudk commented on May 28, 2024

Could you please test it and let me know :)? If you are right then we should also update the docs and I should update my supervisord.conf :D

from bccresquebundle.

epicwhale avatar epicwhale commented on May 28, 2024

I still have to test it (not sure how to do it full-proof), but its a safe bet to believe it will work based on how people have been configuring Ruby's Resque with Supervisor. If you look at this article - http://ryanmckern.com/2013/10/finally-resque-supervisor-have-learned-to-get-along/ - there's a clear stopsignal=QUIT

from bccresquebundle.

ruudk avatar ruudk commented on May 28, 2024

Ok, I think you are correct. I updated my example above, and will also add this to the repo readme.

from bccresquebundle.

PATROMO avatar PATROMO commented on May 28, 2024

The solution is stopasgroup=true:

If true, the flag causes supervisor to send the stop signal to the whole process group and implies killasgroup is true. This is useful for programs, such as Flask in debug mode, that do not propagate stop signals to their children, leaving them orphaned.

from bccresquebundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.