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

Add option to call FastCGI through unix socket and TCP #65

Open
johnduro opened this issue Apr 15, 2019 · 9 comments
Open

Add option to call FastCGI through unix socket and TCP #65

johnduro opened this issue Apr 15, 2019 · 9 comments
Assignees
Milestone

Comments

@johnduro
Copy link
Contributor

Hey,

We use this consumer to execute numerous fast process in php and we realized that the startup cost of php took most of the execution time.

To resolve this issue we tried launching the process through FastGCI (PHP-FPM for this case) and we saw an improvement and now we would like to add this possibility to this consumer.

Would you consider accepting a PR adding an option to consume message though FastCGI unix socket ? default behavior would still be launching a script.

@corvus-ch
Copy link
Owner

Hi @johnduro,

Agreed, script startup is a factor not to be underestimated. This is specially true if throuput is essential. But before adding another complexity to this project, I suggest you have a lock at https://github.com/skolodyazhnyy/amqp-cgi-bridge. As I understand said project is doing exactly what you are asking for.

Can you please have a lock and let me know if the amqp-cgi-Bridge is suits to your needs?

@johnduro
Copy link
Contributor Author

Hey,

Thanks for showing me this project, it does what we want but we use your consumer on a daily basis in production and we are pretty happy about it and about the fact that it is maintained, your quick response to issues is a good example. On the contrary amqp-cgi-bridge seems to have less users and activity
(the last commit is 9 month old).

In the light of these we would prefer to modify your consumer if i can convince you ! I think we could add this feature and keep a clean and understandable code.

Do you think it is worth a try ?

@corvus-ch
Copy link
Owner

Not having recent commits is not a bad thing per se but I understand what you are saying. Thanks for your trust in me and this project. Indeed I am willing to follow along with this idea.

@johnduro If I understand you correctly, you would be willing to contribute the implementation of the FastCGI feature. If that is correct, please directly contact me by email. I would like to sync your work with some other ideas I have in mind and I would like to reduce the potential for conflicts and frustration.

@johnduro
Copy link
Contributor Author

great ! just sent you a mail

@corvus-ch corvus-ch added this to the Version 3 milestone Apr 22, 2019
@corvus-ch
Copy link
Owner

Target branch for this feature must be https://github.com/corvus-ch/rabbitmq-cli-consumer/tree/version-3.

@corvus-ch corvus-ch assigned corvus-ch and johnduro and unassigned corvus-ch Apr 22, 2019
@estahn
Copy link
Collaborator

estahn commented Apr 23, 2019

@corvus-ch @johnduro Is there a design spec for this feature? I don’t see how FastCGI is used here. I have a rough idea but some clarification would be good.

Also please keep in mind you ideally want to implement tcp and Unix sockets.

I have done some work with FastCGI on this project: https://github.com/hipages/php-fpm_exporter/blob/master/phpfpm/phpfpm.go#L156

@corvus-ch
Copy link
Owner

Is there a design spec for this feature? I don’t see how FastCGI is used here. I have a rough idea but some clarification would be good.

@estahn So far I do not have anything related to the implementation of this. The only thing I have so far is the interface I came up to bring the current shell exec and FastCGI under the same umbrella. See https://github.com/corvus-ch/rabbitmq-cli-consumer/wiki/Architecture and #68.

Also please keep in mind you ideally want to implement tcp and Unix sockets.

Yes, I agree. We should have support for both.

@johnduro
Copy link
Contributor Author

@estahn @corvus-ch yes i put only socket in the issue but it should/will be available for both.

If one of you have a preference for a package to use to make those calls i'm all ears.

@corvus-ch corvus-ch changed the title Add option to call FastCGI throug unix socket Add option to call FastCGI through unix socket and TCP Apr 23, 2019
johnduro added a commit to johnduro/rabbitmq-cli-consumer that referenced this issue Jul 10, 2019
@dkarlovi
Copy link

Adding this and ability to subscribe to multiple queues (like https://github.com/skolodyazhnyy/amqp-cgi-bridge does) would make an amazing PHP-powered queue processor! <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants