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

Multi-thread support #1806

Open
notramo opened this issue May 6, 2023 · 4 comments
Open

Multi-thread support #1806

notramo opened this issue May 6, 2023 · 4 comments

Comments

@notramo
Copy link

notramo commented May 6, 2023

Crystal has multi-thread support. Is it possible to enable it for the server executable?

@jwoertink
Copy link
Member

I actually haven't played with the multithreading yet because it's still behind a preview flag, so I've been treating that like an experimental feature. It would be cool if Lucky ran with the multithread support, but I haven't tried it out yet.

@notramo
Copy link
Author

notramo commented May 6, 2023

Does it require lot of work?

@jwoertink
Copy link
Member

I have no clue, to be honest 🤷‍♂️ I've never used multithreading, so I'm not sure if it works, or if it doesn't and what it would take to make it work.

For extra performance, I'm currently using https://github.com/jwoertink/lucky-cluster so I can boot multiple instances on the same server. Instead of using 1 server with multi thread, I'm using 8 servers with single thread 😆

@mdwagner
Copy link
Contributor

I see this question get brought up on the Crystal forum sometimes, and it usually comes down to: Yes, it's supported, but it's behind a preview flag, because they're not confident the standard library will run with it well, since it was not designed for multithreading.

I don't think this will get much attention until Crystal enables it completely, and they have at least run it through it's paces with the standard library.

In the meantime, you can always horizontally scale, which is usually a better approach in practice.

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

3 participants