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

Worker count when using rackup? #49

Closed
tomas opened this issue Feb 21, 2019 · 12 comments
Closed

Worker count when using rackup? #49

tomas opened this issue Feb 21, 2019 · 12 comments

Comments

@tomas
Copy link
Contributor

tomas commented Feb 21, 2019

Hi, great work with agoo!

I'm trying to fire the server through rackup (using a regular config.ru) but I'm not sure how to set the number of workers. I tried putting something like this on the config.ru file itself:

Agoo::Server.init(6471, 'root', thread_count: 8, worker_count: 4)

But no workie. How do I accomplish this?

@ohler55
Copy link
Owner

ohler55 commented Feb 21, 2019

Use the rackup option -O NAME[=VALUE]. So for a worker count of 2 you would do something like this:

$ rackup -r agoo -s agoo -O wc=2

@tomas
Copy link
Contributor Author

tomas commented Feb 21, 2019

Gotcha. And thanks for the quick response!

By the way, I forked your repo to fix a few compilation issues. If you're interested I can submit a PR.

@tomas tomas closed this as completed Feb 21, 2019
@ohler55
Copy link
Owner

ohler55 commented Feb 21, 2019

By all means. I use a C11 compiler so miss some of those. If you have them covered a fix would be really helpful.

@tomas
Copy link
Contributor Author

tomas commented Feb 21, 2019

Great! Will do.

By the way, does agoo support a) listening on a unix socket, and b) hot restarts? (Via USR2 or some other method)

@ohler55
Copy link
Owner

ohler55 commented Feb 21, 2019

It does support unix sockets. Checkout the bind_test.rb file.

Agoo does not support hot restarts today. On the plus side it starts pretty fast. :-)

@tomas
Copy link
Contributor Author

tomas commented Feb 21, 2019

I see. So unix socket not possible via rackup, right? (Couldn't find anything related to it on the rack handler definition)

@ohler55
Copy link
Owner

ohler55 commented Feb 21, 2019

Good point. I can add that. If you want to open an issue for that I'll use that for the addition.

I'm curious, rackup introduces a lot over overhead. What are your reasons for using it?

@tomas
Copy link
Contributor Author

tomas commented Feb 21, 2019

I actually don't use the rackup command regularly. I've always just fired puma or unicorn directly, and have them read the config.ru file and start serving. The only reason I'm using it now is because I'm testing agoo in some of my apps, and want to be able to swap one for another without too much fuss.

I'm not sure what your reasons are not to do it that way, but I think supporting config.ru from the agoo command might make adoption easier.

@ohler55
Copy link
Owner

ohler55 commented Feb 21, 2019

I suppose Agoo could look at the file suffix and if a .ru it could assume it is rack. That would be easy enough.

@tomas
Copy link
Contributor Author

tomas commented Feb 21, 2019

;)

@ohler55
Copy link
Owner

ohler55 commented Feb 21, 2019

Created issue #50 and #51.

@ohler55
Copy link
Owner

ohler55 commented Feb 21, 2019

I'll put something up for both those issues in the next few days. You comments would be appreciated.

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

No branches or pull requests

2 participants