Skip to content
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

Write down that redis driver can't handle parallel workers #451

Open
wapmorgan opened this issue May 30, 2022 · 10 comments
Open

Write down that redis driver can't handle parallel workers #451

wapmorgan opened this issue May 30, 2022 · 10 comments
Labels
status:to be verified Needs to be reproduced and validated. type:docs Documentation

Comments

@wapmorgan
Copy link

I ask to Write it down that library can't handle parallel workers when redis driver used.

What steps will reproduce the problem?

Run few workers with redis driver

What's expected?

Few workers working in parallel

What do you get instead?

Few workers working as 1 worker - spreading payloads in one-thread-work

Additional info

Q A
Yii version latest
PHP version doesn't matter
Operating system RedHat
@samdark samdark added the type:docs Documentation label May 31, 2022
@samdark
Copy link
Member

samdark commented May 31, 2022

That is expected from queue but we may, indeed, state it more clearly.

@rob006
Copy link

rob006 commented May 31, 2022

@samdark I'm pretty sure that Redis driver handles multiple concurrent workers (or at least it did in the past).

@samdark
Copy link
Member

samdark commented Jun 1, 2022

@rob006
Copy link

rob006 commented Jun 1, 2022

@samdark this is about moving delayed and interrupted jobs to waiting queue - one worker can handle this, while the rest will skip it and process actual jobs in queue.

@samdark
Copy link
Member

samdark commented Jun 1, 2022

Right. That needs to be verified. I've heard the same info about single worker being active while all others waiting for it to finish.

@samdark samdark added the status:to be verified Needs to be reproduced and validated. label Jun 1, 2022
@wapmorgan
Copy link
Author

wapmorgan commented Jun 1, 2022

That is expected from queue but we may, indeed, state it more clearly.

Sorry, but rabbit-driven queue do it in parallel.
Inconsistent

After all, In docs there is example with supervisor, where few workers used. Few workers for single-thread work?) doubt

@wapmorgan
Copy link
Author

It would be good to clarify which drivers can handle few consumers

@rob006
Copy link

rob006 commented Jun 1, 2022

It would be good to clarify which drivers can handle few consumers

AFAIK all (except sync) drivers should support this. How do your run these multiple workers?

@wapmorgan
Copy link
Author

It would be good to clarify which drivers can handle few consumers

AFAIK all (except sync) drivers should support this. How do your run these multiple workers?

Few docker containers with entrypoint: php yii queue/listen 3

@silverslice
Copy link

I tried to test redis queue in docker, everything works correctly, the workers process jobs in parallel.
@wapmorgan, please try my example.

The problem in redis driver is that the message can be lost between pop new message from "waiting" list and place it to the "reserved" set if worker crashes unexpectedly. To be more precise, the message will remain in the "messages" hash, but will not be sent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:to be verified Needs to be reproduced and validated. type:docs Documentation
Projects
None yet
Development

No branches or pull requests

4 participants