-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to run multiple workers on one machine like chrisboulton/php-resque using COUNT environment variable? #56
Comments
I kown that,run comand "bin/resque worker:start &" many times .Thanks |
I think the way to implement this would be to add logic here: https://github.com/mjphaynes/php-resque/blob/master/src/Resque/Commands/Worker/Start.php#L48 which would fork N times, where N is the value of the COUNT env var, if it's set. If you want to write a PR for that, I'd be happy to review! |
thanks,I will do that in my spare time。I have another question, What's the difference between Predis and phpredis? I want to replace Predis into Credis (https://github.com/colinmollenhour/credis) ,a wrapper of phpredis ,beacuse phpredis is a php extension ,I think it can resutl in better performance. |
So, that topic is a bit complicated... Predis is a php library which facilitates the use of redis. This lib uses Predis because it makes it cleaner to write the code for it. I have a feeling that it was also picked because of some apparent performance issues with Credis that has been seen in the past (see chrisboulton/php-resque#248). It seems that Predis is much more well maintained and current compared to Credis. Predis works on its own as a pure PHP implementation to interface with a redis instance, but it also supports using php extensions to accelerate itself, if they're available. Predis works best with A little while back when I worked on making changes to this lib, I added support for See #42 for some info about Oh also, if you install |
I set phpiredis: true in config.yml ,then use command "bin/resque woker:start " to start worker,but it is not available. print_r($config) in Redis __construct ,var phpiredis is none , then print_r($config) in Redis __construct ,var phpiredis is 1,so it can get correct value from config.yml . but when I start worker, show error: |
I use docker, so this is how I install it in on my image (alpine linux):
|
so can not get phpiredis value from config.yml is a bug? |
Oh, I think I see what's going on for you. I think you have too recent a version of hiredis installed, which changed some of the function names. See nrk/phpiredis#52 Maybe you should fork phpiredis and make the changes from that PR and try again? I think the alpine release I use has an older version of hiredis, meaning I didn't run into this problem. Edit: btw, protip, you can use ``` to make code blocks. It's kinda hard to read what you wrote above because you inlined everything Edit2: Or maybe you didn't install |
Oh,I'm sorry ,My english is so pool.I mean if phpiredis extensions is correct ,why it can not get phpiredis value from config.yml before I changed code? print_r($config) in Redis __construct ,var phpiredis is none , Is this a bug ? or beacause I use PHP7.1? |
It feels like your folder structure might be in a way that the lib doesn't find your The other thing is that Other than that, I'm not entirely sure what's going wrong based on just the information you gave me. |
Oh ,I know your mean ,I didn't call so,calling |
Are you Canadian?I'm curious now that Canada is at night? 😄 |
Yes. I'm just awake late tonight. 🌔 |
How is the current status on this issue? As far as I see, it touches a few topics:
If everything is covered there, I'd close this issue. What do you think @davidtall and @francislavoie? |
For the suggested deployment we should add some documentation for the upcoming release, I think the rest is covered already. Therefore I'm closing this issue. If you think otherwise, just feel free to reopen 😄 |
Sorry I never replied, I had sometime typed up last week but I got sidetracked! Yeah IMO everything is already dealt with. My Dockerfile unfortunately has some closed source stuff in it so I can't really share that fully, but I can provide a snippet for how I'm installing phpiredis. I'll do that in #42 like you asked, when I find a minute 😄 |
No problem, I hope you had a good start in the new year nevertheless 😄 Thank you, no problem. I have a Dockerfile example as well which I can integrate.... Will just take a few days, as I'm also quite busy atm. |
No description provided.
The text was updated successfully, but these errors were encountered: