Coder Social home page Coder Social logo

fresque's People

Contributors

apankov avatar bar avatar cyrilmazur avatar jnmik avatar joeholdcroft avatar mglinski avatar pwhelan avatar ruudk avatar wa0x6e avatar wildsurfer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fresque's Issues

PHP Warning at the end of 'fresque test'

In Fresque.php:1136

$this->runtime['type'] = 'regular';

adds a string to the config, but the test function in Fresque.php:1038 is expecting an array. String values should there be handled differently or excluded.

Test it with:
fresque -c my_config.ini

Workers not starting

I have installed Fresque using composer. I run the test with command
fresque test
and it showed the output that setup is ready. But when I try to start workers using
fresque -n 5
it shows Done message. But when i see stats, it tells that there is no active worker. When I try to stop workers, it tells that there is no active workers. Can you please tell me what can be the issue?

Worker info not updated

Hi kamisama,

I ran into this scenario >>

  1. From the fresque logs, I see these entries :
    [2013-10-05T16:27:31+00:00] Exiting...
    [2013-10-05T16:27:31+00:00] CONT received; resuming job processing
    [2013-10-05T16:27:31+00:00] Exiting...
    [2013-10-05T16:27:31+00:00] CONT received; resuming job processing
    [2013-10-05T16:27:31+00:00] Exiting...
    [2013-10-05T16:27:31+00:00] CONT received; resuming job processing
    [2013-10-05T16:27:31+00:00] Exiting...
    [2013-10-05T16:27:31+00:00] CONT received; resuming job processing
    [2013-10-05T16:27:31+00:00] Exiting...
    [2013-10-05T16:27:31+00:00] CONT received; resuming job processing
    [2013-10-05T16:27:31+00:00] Exiting...
    [2013-10-05T16:27:31+00:00] CONT received; resuming job processing
    [2013-10-05T16:27:31+00:00] Exiting...
    [2013-10-05T16:27:31+00:00] CONT received; resuming job processing
    [2013-10-05T16:27:31+00:00] Exiting...
    [2013-10-05T16:27:31+00:00] CONT received; resuming job processing
  2. When I run "ps -ef", I don't use any worker process running.
  3. When I run "fresque stats", it lists down the previously listed workers.
  4. I tried to run "fresque stop", yet the worker info is still registered there.

Any idea how to solve this?

Memory Problem free();

I have problem while using this library ? why this is happening

var/www/html/social-project/vendor/fresque/fresque# *** Error in `php': free(): invalid next size (fast): 0x0000564fe3ad5be0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f882c55e7e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7f882c56737a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f882c56b53c]
php(cleanup_ps_args+0x91)[0x564fe36d5971]
php(main+0x3c4)[0x564fe34b8704]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f882c507830]
php(_start+0x29)[0x564fe34b88f9]
======= Memory map: ========
564fe33d4000-564fe3784000 r-xp 00000000 fd:01 59250                      /usr/bin/php7.0
564fe3984000-564fe39fd000 r--p 003b0000 fd:01 59250                      /usr/bin/php7.0
564fe39fd000-564fe3a0d000 rw-p 00429000 fd:01 59250                      /usr/bin/php7.0
564fe3a0d000-564fe3a29000 rw-p 00000000 00:00 0
564fe3ac3000-564fe3c90000 rw-p 00000000 00:00 0                          [heap]
7f8824000000-7f8824021000 rw-p 00000000 00:00 0
7f8824021000-7f8828000000 ---p 00000000 00:00 0
7f8829cc5000-7f8829cdb000 r-xp 00000000 fd:01 1964                       /lib/x86_64-linux-gnu/libgcc_s.so.1
7f8829cdb000-7f8829eda000 ---p 00016000 fd:01 1964                       /lib/x86_64-linux-gnu/libgcc_s.so.1
7f8829eda000-7f8829edb000 rw-p 00015000 fd:01 1964                       /lib/x86_64-linux-gnu/libgcc_s.so.1
7f8829edb000-7f882a04d000 r-xp 00000000 fd:01 25730                      /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7f882a04d000-7f882a24d000 ---p 00172000 fd:01 25730                      /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7f882a24d000-7f882a257000 r--p 00172000 fd:01 25730                      /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7f882a257000-7f882a259000 rw-p 0017c000 fd:01 25730                      /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7f882a259000-7f882a25d000 rw-p 00000000 00:00 0
7f882a25d000-7f882bb13000 r-xp 00000000 fd:01 25930                      /usr/lib/x86_64-linux-gnu/libicudata.so.55.1
7f882bb13000-7f882bd12000 ---p 018b6000 fd:01 25930                      /usr/lib/x86_64-linux-gnu/libicudata.so.55.1
7f882bd12000-7f882bd13000 r--p 018b5000 fd:01 25930                      /usr/lib/x86_64-linux-gnu/libicudata.so.55.1
7f882bd13000-7f882bd14000 rw-p 018b6000 fd:01 25930                      /usr/lib/x86_64-linux-gnu/libicudata.so.55.1
7f882bd14000-7f882bd35000 r-xp 00000000 fd:01 2003                       /lib/x86_64-linux-gnu/liblzma.so.5.0.0
7f882bd35000-7f882bf34000 ---p 00021000 fd:01 2003                       /lib/x86_64-linux-gnu/liblzma.so.5.0.0
7f882bf34000-7f882bf35000 r--p 00020000 fd:01 2003                       /lib/x86_64-linux-gnu/liblzma.so.5.0.0
7f882bf35000-7f882bf36000 rw-p 00021000 fd:01 2003                       /lib/x86_64-linux-gnu/liblzma.so.5.0.0
7f882bf36000-7f882c0b5000 r-xp 00000000 fd:01 25932                      /usr/lib/x86_64-linux-gnu/libicuuc.so.55.1
7f882c0b5000-7f882c2b5000 ---p 0017f000 fd:01 25932                      /usr/lib/x86_64-linux-gnu/libicuuc.so.55.1
7f882c2b5000-7f882c2c5000 r--p 0017f000 fd:01 25932                      /usr/lib/x86_64-linux-gnu/libicuuc.so.55.1
7f882c2c5000-7f882c2c6000 rw-p 0018f000 fd:01 25932                      /usr/lib/x86_64-linux-gnu/libicuuc.so.55.1
7f882c2c6000-7f882c2ca000 rw-p 00000000 00:00 0
7f882c2ca000-7f882c2e2000 r-xp 00000000 fd:01 1971                       /lib/x86_64-linux-gnu/libpthread-2.23.so
7f882c2e2000-7f882c4e1000 ---p 00018000 fd:01 1971                       /lib/x86_64-linux-gnu/libpthread-2.23.so
7f882c4e1000-7f882c4e2000 r--p 00017000 fd:01 1971                       /lib/x86_64-linux-gnu/libpthread-2.23.so
7f882c4e2000-7f882c4e3000 rw-p 00018000 fd:01 1971                       /lib/x86_64-linux-gnu/libpthread-2.23.so
7f882c4e3000-7f882c4e7000 rw-p 00000000 00:00 0
7f882c4e7000-7f882c6a7000 r-xp 00000000 fd:01 1994                       /lib/x86_64-linux-gnu/libc-2.23.so
7f882c6a7000-7f882c8a7000 ---p 001c0000 fd:01 1994                       /lib/x86_64-linux-gnu/libc-2.23.so
7f882c8a7000-7f882c8ab000 r--p 001c0000 fd:01 1994                       /lib/x86_64-linux-gnu/libc-2.23.so
7f882c8ab000-7f882c8ad000 rw-p 001c4000 fd:01 1994                       /lib/x86_64-linux-gnu/libc-2.23.so
7f882c8ad000-7f882c8b1000 rw-p 00000000 00:00 0
7f882c8b1000-7f882cacb000 r-xp 00000000 fd:01 2113                       /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
7f882cacb000-7f882ccca000 ---p 0021a000 fd:01 2113                       /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
7f882ccca000-7f882cce6000 r--p 00219000 fd:01 2113                       /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
7f882cce6000-7f882ccf2000 rw-p 00235000 fd:01 2113                       /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
7f882ccf2000-7f882ccf5000 rw-p 00000000 00:00 0
7f882ccf5000-7f882cd53000 r-xp 00000000 fd:01 2114                       /lib/x86_64-linux-gnu/libssl.so.1.0.0
7f882cd53000-7f882cf53000 ---p 0005e000 fd:01 2114                       /lib/x86_64-linux-gnu/libssl.so.1.0.0
7f882cf53000-7f882cf57000 r--p 0005e000 fd:01 2114                       /lib/x86_64-linux-gnu/libssl.so.1.0.0
7f882cf57000-7f882cf5e000 rw-p 00062000 fd:01 2114                       /lib/x86_64-linux-gnu/libssl.so.1.0.0
7f882cf5e000-7f882d10f000 r-xp 00000000 fd:01 25943                      /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.3
7f882d10f000-7f882d30e000 ---p 001b1000 fd:01 25943                      /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.3
7f882d30e000-7f882d316000 r--p 001b0000 fd:01 25943                      /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.3
7f882d316000-7f882d318000 rw-p 001b8000 fd:01 25943                      /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.3
7f882d318000-7f882d319000 rw-p 00000000 00:00 0
7f882d319000-7f882d31c000 r-xp 00000000 fd:01 1977                       /lib/x86_64-linux-gnu/libdl-2.23.so
7f882d31c000-7f882d51b000 ---p 00003000 fd:01 1977                       /lib/x86_64-linux-gnu/libdl-2.23.so
7f882d51b000-7f882d51c000 r--p 00002000 fd:01 1977                       /lib/x86_64-linux-gnu/libdl-2.23.so
7f882d51c000-7f882d51d000 rw-p 00003000 fd:01 1977                       /lib/x86_64-linux-gnu/libdl-2.23.so
7f882d51d000-7f882d625000 r-xp 00000000 fd:01 1989                       /lib/x86_64-linux-gnu/libm-2.23.so
7f882d625000-7f882d824000 ---p 00108000 fd:01 1989                       /lib/x86_64-linux-gnu/libm-2.23.so
7f882d824000-7f882d825000 r--p 00107000 fd:01 1989                       /lib/x86_64-linux-gnu/libm-2.23.so
7f882d825000-7f882d826000 rw-p 00108000 fd:01 1989                       /lib/x86_64-linux-gnu/libm-2.23.so
7f882d826000-7f882d894000 r-xp 00000000 fd:01 2062                       /lib/x86_64-linux-gnu/libpcre.so.3.13.2
7f882d894000-7f882da94000 ---p 0006e000 fd:01 2062                       /lib/x86_64-linux-gnu/libpcre.so.3.13.2
7f882da94000-7f882da95000 r--p 0006e000 fd:01 2062                       /lib/x86_64-linux-gnu/libpcre.so.3.13.2
7f882da95000-7f882da96000 rw-p 0006f000 fd:01 2062                       /lib/x86_64-linux-gnu/libpcre.so.3.13.2
7f882da96000-7f882daaf000 r-xp 00000000 fd:01 2119                       /lib/x86_64-linux-gnu/libz.so.1.2.8
7f882daaf000-7f882dcae000 ---p 00019000 fd:01 2119                       /lib/x86_64-linux-gnu/libz.so.1.2.8
7f882dcae000-7f882dcaf000 r--p 00018000 fd:01 2119                       /lib/x86_64-linux-gnu/libz.so.1.2.8
7f882dcaf000-7f882dcb0000 rw-p 00019000 fd:01 2119                       /lib/x86_64-linux-gnu/libz.so.1.2.8
7f882dcb0000-7f882dcc7000 r-xp 00000000 fd:01 1984                       /lib/x86_64-linux-gnu/libresolv-2.23.so
7f882dcc7000-7f882dec7000 ---p 00017000 fd:01 1984                       /lib/x86_64-linux-gnu/libresolv-2.23.so
7f882dec7000-7f882dec8000 r--p 00017000 fd:01 1984                       /lib/x86_64-linux-gnu/libresolv-2.23.so
7f882dec8000-7f882dec9000 rw-p 00018000 fd:01 1984                       /lib/x86_64-linux-gnu/libresolv-2.23.so
7f882dec9000-7f882decb000 rw-p 00000000 00:00 0
7f882decb000-7f882def1000 r-xp 00000000 fd:01 1966                       /lib/x86_64-linux-gnu/ld-2.23.so
7f882df45000-7f882e0dd000 r--p 00000000 fd:01 28901                      /usr/lib/locale/locale-archive
7f882e0dd000-7f882e0e7000 rw-p 00000000 00:00 0
7f882e0ed000-7f882e0ee000 rw-p 00000000 00:00 0
7f882e0ee000-7f882e0f0000 rw-p 00000000 00:00 0
7f882e0f0000-7f882e0f1000 r--p 00025000 fd:01 1966                       /lib/x86_64-linux-gnu/ld-2.23.so
7f882e0f1000-7f882e0f2000 rw-p 00026000 fd:01 1966                       /lib/x86_64-linux-gnu/ld-2.23.so
7f882e0f2000-7f882e0f3000 rw-p 00000000 00:00 0
7fff9c83b000-7fff9c85c000 rw-p 00000000 00:00 0                          [stack]
7fff9c917000-7fff9c919000 r--p 00000000 00:00 0                          [vvar]
7fff9c919000-7fff9c91b000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]

php-resque no longer a dependency so test fails

php-resque was removed as a composer dependency in favor of php-resque-ex. However, that was then moved to a suggestion. So now no package of php-resque is included, meaning the Resque class doesn't exist and "fresque test" fails.

Adding back php-resque (dev-master) and updating composer fixed it.

Starting worker ..................... Fail

I just had this problem while Fresque worked perfectly.
I stopped jobs, to restart (not through the command restart, but manually).

Then impossible to restart Fresque.

sudo fresque start -q backend --debug output :

[DEBUG] Will start 2 workers
[DEBUG] Starting worker (1)
[DEBUG] Running command :
    nohup sudo -u '_www' \
    bash -c "cd '/workspace/api/lib/Fresque/vendor/kamisama/php-resque-ex';  \
    VERBOSE=true  \
    QUEUE='default' \
    PIDFILE='/workspace/api/lib/Fresque/tmp/14266092016169' \
    APP_INCLUDE='/workspace/api/lib/Fresque/vendor/autoload.php' \
    RESQUE_PHP='/workspace/api/lib/Fresque/vendor/kamisama/php-resque-ex/lib/Resque.php' \
    INTERVAL='2' \
    REDIS_BACKEND='localhost:6379' \
    REDIS_DATABASE='0' \
    REDIS_NAMESPACE='resque' \
    COUNT=1 \
    LOGHANDLER='MongoDB' \
    LOGHANDLERTARGET='' \
    php './bin/resque' \
     >> '/var/log/Fresque/fresque.log' 2>&1" >/dev/null 2>&1 &
Starting worker ..................... Fail

Do you have an idea of the problem?

Stop Support for multiple servers

In the stop command add an additional option along with the existing "all workers" option that will only stop workers that have the machines hostname.

Fresque and Monit

I am using Fresque for my PHP project background jobs. I am monitoring Apache, Mysql and other important processes using Monit . I also want to add Fresque processes in Monit but I am unable to find PID files for worker processes. I have reviewed PHP-Resque library code and it seems that it does support and generate PID files for worker processes in /var/run/resque/ directory. Please guide me how I can achieve it using Fresque.

Version bump? 1.3.2 or 1.4.0?

@CyrilMazur introduced a rad new feature to include environment variables in each worker, but the 1.3.1 release was set in May 2015, and your pull in June never bumped the version number.

I'd include dev-master, but am wary of any other future merges that may break things or new features that you include in a v2 version that breaks dependencies. Just a thought. Will probably fork and include a cloned version until I hear back. Hope you consider it!

Failed to start worker when server is booting

Hi,

I'm trying to exec fresque command when sever reboot, to make every server I own will start workers automatically.

I'm using Amazon Linux, and put command "fresque start >> resque.log" to the instance settings "User Data"

The log file show me resque was stated failed, so I tried to change my command in user data to debug, "fresque test >> resque_debug.log" and looks everything fine, redid OK, database OK, etc

Just curious would you give me some advices?

Many thanks
Kai

Workers disappearing

Probably not the best place to ask this but is there any way to get more debugging information my workers seem to stop every couple of days with nothing in the logs? Can't find much on the php-resque github either about this?

question re fresque.ini

Below is an extract from my fresque.ini file. Based on that I believe that adding a job to the queue job-onboard-mailer will cause it to be done at a 360 second interval, the next time that queue is polled. But that doesn't seem to be the case according to my log file, an extract of which is pasted below. It seems to be doing the job instantly. Could you please advise if my settings are wrong or if I have misunderstood something?

Also, is there any documentation for the scheduler feature?

Thanks.

[Default]
; Default name of the queue the worker will be working one
; A worker can work on more than one queue, just separate
; the name with a commas, e.g "defaultone,defaultwo"
queue = job-worker

; Polling frequency
; Number of seconds to sleep between each polling
interval = 5

; Number of workers to fork
; e.g putting 2 will start to workers with exactly
; the same settings
workers = 1

[Queues]

job-dispatcher[workers] = 1
job-mailer[workers] = 1
job-worker[workers] = 6
job-deleter[workers] = 1
job-welcome-mailer[workers] = 1
job-onboard-mailer[workers] = 1
job-create-mp3[workers] = 1
job-onboard-mailer[interval] = 360
job-welcome-mailer[interval] = 180

[2015-08-11T11:56:30+01:00] Processing ID:bc7285fbe7053d1048f94dd5018584a9 in job-onboard-mailer
[2015-08-11T11:56:30+01:00] done ID:bc7285fbe7053d1048f94dd5018584a9
[2015-08-11T11:56:30+01:00] got {"queue":"job-onboard-mailer","id":"ddbefb12b4bfa17acc505e4a64abb42d","class":"Byta\JobBundle\Job\JobSendOnboardEmail","args":[{"messageID":33,"created":"2015-08-11 11:53:45","type":"meta"}]}
[2015-08-11T11:56:30+01:00] Processing ID:ddbefb12b4bfa17acc505e4a64abb42d in job-onboard-mailer
[2015-08-11T11:56:30+01:00] done ID:ddbefb12b4bfa17acc505e4a64abb42d
[2015-08-11T11:56:30+01:00] got {"queue":"job-onboard-mailer","id":"c87943072007a0bf3d9a925cc225b1f1","class":"Byta\JobBundle\Job\JobSendOnboardEmail","args":[{"messageID":33,"created":"2015-08-11 11:53:45","type":"meta"}]}
[2015-08-11T11:56:30+01:00] Processing ID:c87943072007a0bf3d9a925cc225b1f1 in job-onboard-mailer
[2015-08-11T11:56:30+01:00] done ID:c87943072007a0bf3d9a925cc225b1f1
[2015-08-11T11:56:30+01:00] got {"queue":"job-onboard-mailer","id":"e265c5ee44fa385fe945f4276cce2c15","class":"Byta\JobBundle\Job\JobSendOnboardEmail","args":[{"messageID":33,"created":"2015-08-11 11:53:45","type":"meta"}]}

Question : Multiple Workers

Hi kamisama,

Greetings.
Have you come across any scenario or conflict that a multi-worker queue might access the same data at the same time? Meaning at a point of time, worker A and worker B both pulling a job ID from a queue at the same time.... Or to rephrase it ..... "multiple workers running the same job"..

Cannot specify include file via command line

I am trying to specify an include file via command line. Unfortunately, both APP_INCLUDE and -a are ignored. I have tried

sudo ./fresque start -a /opt/fresque/autoloader2.php

and

sudo APP_INCLUDE=/opt/fresque/autoloader2.php ./fresque start

with the same result. But if I specify it within the ini file, it is correctly loaded.

Also, is it possible to load a queue specific include file? I tried setting the following in the ini file

[Queues]
VideoConvertor[include] = /opt/fresque/autoloader2.php
; VideoConvertor is my queue name

But that too did not work.

Fresque has stopped processing jobs once a month

I can't really figure out why and it's hard to for me to debug but last month (March 1st) and this month (April 5th) fresque stopped polling for jobs. It was still searching for new jobs, but it just wouldn't see that they were there and grab them. resque-web showed 900+ on the queue, but none would be processing. Restarting the workers works.

I'm using php-resque-ex as the library. Everything else is pretty much default.

Not sure if this is something you've seen?

Composer Requirements

Are the composer requirements for Fresque up-to-date?

I don't seem to be able to install it via Composer / Packagist - I can't be using chrisboulton/php-resque - only kamisama/php-resque-ex - is this expected? How up-to-date is your fork kept with Chris' version?

Also, if I use the latest version of kamisama/php-resque-ex (1.3.0), I'm unable to install Fresque; I get the following error:

Problem 1
    - Installation request for fresque/fresque 1.3.0 -> satisfiable by fresque/fresque[1.3.0].
    - fresque/fresque 1.3.0 requires kamisama/php-resque-ex ~1.2.5 -> no matching package found.

Any help/ advice is much appreciated!

Specifying worker names with stop command

I am going to implement a feature that allows users to specify the worker to kill in command line. This is useful if you are using some automation/CI tools (jenkins, ansible, puppet etc). There are going to be two additional options to the stop command: --worker and --count.

The --worker option allows you to specify a queue name to kill. By default it will kill all workers with that name.

The --count option works in tandem with the --worker option and allows you to specify how many to kill.

I'm not sure if you accept feature additions to your codebase, but if you want, I can make a pull request, implement it and then merge back into your repo. That way others can benefit.

Let me know what you think

Worker starter bash script

Hi,

The way the worker starter bash script is generated is not platform independent.

I'm running Debian 6 in my production server, and the following changes were needed to make it working.

  1. my nohup doesn't accept -u switch (you might want to apply the switch after checking if it accepts the switch or no)
  2. there is no sudo installed in my OS (same as many production environment)
  3. there is an extra double quote after 2>&1 in Fresque.php line 444

I downloaded the latest version from Composer. Please let me know if you need me to create a pull request or patch.

Beside the above, it's a great software and thank you.

Regards.

Rescheduler Failing (Not Found)

Hi,

I'm trying to use rescheduler inside Fresque in one of my loaded classes and i get:

PHP Fatal error: Class 'ResqueScheduler' not found

I have already started it using fresque startScheduler.

How do I load the ResqueScheduler class?

Thanks.

Regards,
Mike.

Restart is not working properly

Hi,

When I start 5 workers 2 times it has 10 workers started.

$ ./fresque start -n 5
Forking 5 new PHP Resque worker services (queue:default user:Ruud)

$ ./fresque start -n 5
Forking 5 new PHP Resque worker services (queue:default user:Ruud)

$ ./fresque stats
PHPResque Statistics

Jobs Stats
   Processed Jobs : 0
   Failed Jobs    : 0

Workers Stats
   Active Workers : 10

This is correct. But when I now hit the restart button and look at the stats it shows me unexpected behavior:

$ ./fresque restart
Shutting down Resque Worker complete
Killing 10 workers ...
Killing 21057
Killing 21067
Killing 21085
Killing 21078
Killing 21079
Killing 21061
Killing 21053
Killing 21054
Killing 21090
Killing 21082
Forking 5 new PHP Resque worker services (queue:default user:Ruud)
Forking 1 new PHP Resque worker service (queue:default user:Ruud)

$ ./fresque stats
PHPResque Statistics

Jobs Stats
   Processed Jobs : 0
   Failed Jobs    : 0

Workers Stats
   Active Workers : 4
    Worker : iMacRuud.local:21130:default
     - Started on     : Fri Aug 03 08:06:15 UTC 2012
     - Uptime         : less than a minute
     - Processed Jobs : 0
     - Failed Jobs    : 0
    Worker : iMacRuud.local:21134:default
     - Started on     : Fri Aug 03 08:06:15 UTC 2012
     - Uptime         : less than a minute
     - Processed Jobs : 0
     - Failed Jobs    : 0
    Worker : iMacRuud.local:21138:default
     - Started on     : Fri Aug 03 08:06:15 UTC 2012
     - Uptime         : less than a minute
     - Processed Jobs : 0
     - Failed Jobs    : 0
    Worker : iMacRuud.local:21132:default
     - Started on     : Fri Aug 03 08:06:15 UTC 2012
     - Uptime         : less than a minute
     - Processed Jobs : 0
     - Failed Jobs    : 0

Why does it now has 4 workers instead of 10? Sometimes its 6 workers. I don't get it.

ResqueScheduler into Fresque

Hi, just a quick question - I hope you can point me in the right direction :)

What is the best way to integrate the ResqueScheduler into Fresque

I can see that there are registerSchedulerWorker and other related methods in the fresque controls. Should I start a worker separately? If so how do I tell fresque the worker is running?

A Sample of fresque.ini

Hi kamisama,

Would you mine share the fresque.ini that will yield that results in your readme example?

I'm trying to configure the file with something like this :

[Queues]
high[interval] = 5
high[workers] = 4
medium[interval] = 60
medium[workers] = 2
low[interval] = 300
low[workers] = 1

But this is the result when I do a stats :


Resque statistics

Jobs Stats
Processed Jobs : 0
Failed Jobs : 0

Queues Stats
Queues count : 0

Workers Stats
Active Workers : 3
Worker : ip-66-0-0-101:6953:default
- Started on : Wed Oct 02 08:05:05 UTC 2013
- Uptime : 8 minutes and 39 seconds
- Processed Jobs : 0
- Failed Jobs : 0
Worker : ip-66-0-0-101:6937:default
- Started on : Wed Oct 02 08:05:04 UTC 2013
- Uptime : 8 minutes and 40 seconds
- Processed Jobs : 0
- Failed Jobs : 0
Worker : ip-66-0-0-101:6920:default
- Started on : Wed Oct 02 08:05:04 UTC 2013
- Uptime : 8 minutes and 40 seconds
- Processed Jobs : 0
- Failed Jobs : 0

Any idea where could have gone wrong? I started fresque with "fresque load" command.

fresque is stopping everyday

We are using fresque to process jobs in background. But from few days it is stopping almost everyday. what could be the reasons?

Unable to create more than one worker

Hi,
I have been using Fresque in production for about 1 year now, and haven't had any problems, but recently I deployed fresque on new servers and for some reason only one worker is being created. Also the stats for the worker aren't visible when i check them.

How can i resolve this?
Thanks

can pass -c to enquue command

Hi,

when i try to launch this command:
./fresque enqueue queuename classjob "params" -c another-config.ini
the options to load different config doesn't work

every works fine when launching
./fresque (start|load|stop) -c another-config.ini

Autoloader

I'm trying to figure out what the autoloader.php is supposed look like as there are several different ways to specify autoloaders...

Is there an example available I could crib from?

Thx.

Failed Jobs

Firstly thanks for this Nice tool.

The logs file gets bigger and bigger on the server after time. So Is there a quick way to check why our jobs failed or can we get any notification (email etc) when a job fails. Thanks.

Starting worker ..................... Fail

When attempting to start a worker using a normal user account, I get the following:

[rstanchak@myhost ] ./fresque start
----------------
Creating workers
----------------
Starting worker ..................... Fail

Running with --debug

[rstanchak@myhost ] ./fresque start --debug
----------------
Creating workers
----------------
[DEBUG] Will start 1 workers
[DEBUG] Starting worker (1)
[DEBUG] Running command :
        nohup sudo -u 'rstanchak' \
        bash -c "cd '/var/www/html/resque-test/vendor/fresque/fresque/../../../vendor/kamisama/php-resque-ex';  \
        VERBOSE=true  \
        QUEUE='StationProxyJobs' \
        PIDFILE='/var/www/html/resque-test/vendor/fresque/fresque/tmp/13809048873761' \
        APP_INCLUDE='/var/www/html/resque-test/vendor/fresque/fresque/../../../vendor/autoload.php' \
        INTERVAL='5' \
        REDIS_BACKEND='localhost:6379' \
        REDIS_DATABASE='0' \
        REDIS_NAMESPACE='resque' \
        COUNT=1 \
        LOGHANDLER='' \
        LOGHANDLERTARGET='' \
        php ./bin/resque \
         >> '/var/www/html/resque-test/vendor/fresque/fresque/../../../fresque.log' 2>&1" >/dev/null 2>&1 &
Starting worker ..................... Fail

just the shell command...

[rstanchak@myhost ] sudo -u 'rstanchak' \
>         bash -c "cd '/var/www/html/resque-test/vendor/fresque/fresque/../../../vendor/kamisama/php-resque-ex';  \
>         VERBOSE=true  \
>         QUEUE='MyJobs' \
>         PIDFILE='/var/www/html/resque-test/vendor/fresque/fresque/tmp/13809048873761' \
>         APP_INCLUDE='/var/www/html/resque-test/vendor/fresque/fresque/../../../vendor/autoload.php' \
>         INTERVAL='5' \
>         REDIS_BACKEND='localhost:6379' \
>         REDIS_DATABASE='0' \
>         REDIS_NAMESPACE='resque' \
>         COUNT=1 \
>         LOGHANDLER='' \
>         LOGHANDLERTARGET='' \
>         php ./bin/resque"
Sorry, user rstanchak is not allowed to execute '/bin/bash -c cd '/var/www/html/resque-test/vendor/fresque/fresque/../../../vendor/kamisama/php-resque-ex';          VERBOSE=true          QUEUE='MyJobs'         PIDFILE='/var/www/html/resque-test/vendor/fresque/fresque/tmp/13809048873761'         APP_INCLUDE='/var/www/html/resque-test/vendor/fresque/fresque/../../../vendor/autoload.php'         INTERVAL='5'         REDIS_BACKEND='localhost:6379'         REDIS_DATABASE='0'         REDIS_NAMESPACE='resque'         COUNT=1         LOGHANDLER=''         LOGHANDLERTARGET=''         php ./bin/resque' as rstanchak on myhost.

Based on this, it is clear that the user starting the job must be in the sudoers file.

Future users may find the following changes helpful:
(1) document the 'sudo' requirement in README
(2) be able to run fresque without requiring sudo
(3) capture the shell error and provide this detail if the worker fails to start

Other than this minor hang-up, I really like fresque - very convenient!

need for authentication support

Beacuse the origin php-resque don't support redis authentication, so I chose your php-resque-ex. Then I found out this awsome command line tool, but without redis authentication, >_<
In production environment, redis authentication is almost mandatory.

resume command doesn't work

Hi,
after starting some workers with "fresque -start" the system correctly handles "fresque - pause". Within the log file I can read
[notice] [15:51:55 2014-10-22] USR2 received; pausing job processing

but trying "fresque -resume" nothing happens. Workers are not working and within the log file the only new lines are

[info] [15:53:15 2014-10-22] Sleeping for 5

and the workers don't consume jobs.
Trying also the stop command, it doesn't work.

Here you can find some details about my environment

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.1 LTS"
NAME="Ubuntu"
VERSION="14.04.1 LTS, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04.1 LTS"
VERSION_ID="14.04"

PHP 5.5.9-1ubuntu4.4 (cli) (built: Sep 4 2014 06:56:34)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies

Regards,

Scalability: Scaling fresque

Hello,
How to scale the Fresque implementation? I am scaling my application and have 4 servers behind load balancer. Currently I am running fresque in all 4 servers. Is there any other method?

Thanks,
Girish

Timezone

When I set the date.timezone to 'PRC' , the worker's Uptime seems not correct.
image

How to Fix it ?

Broken bin when install from Composer on Debian

When i install Fresque from composer on Debian, i can't start it from vendor/bin/fresque because of error:

root@debian:/tmp/cg2# ./vendor/bin/fresque
./vendor/bin/
Could not open input file: ./vendor/bin//lib/init.php

vendor/bin/fresque is just a symlink to vendor/fresque/fresque/fresque

fresque -> ../fresque/fresque/fresque

So, when it try to do this

LIB=${0/%fresque/}
exec php -q ${LIB}/lib/init.php "$@"

${LIB) is vendor/bin/ and, of course, vendor/bin//lib/init.php doesn't exist.

If i install on windows or windows shared folder in linux system (without symlinks), Composer create binary file like this:

#!/usr/bin/env sh
SRC_DIR="`pwd`"
cd "`dirname "$0"`"
cd '../fresque/fresque'
BIN_TARGET="`pwd`/fresque"
cd "$SRC_DIR"
"$BIN_TARGET" "$@"

and it works like it should.

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.