Skip to content
This repository was archived by the owner on Mar 24, 2026. It is now read-only.

Setup GC threads on Crystal tests - #3001

Merged
NateBrady23 merged 26 commits into
TechEmpower:masterfrom
faustinoaq:setup-gc-threads
Nov 4, 2017
Merged

NateBrady23 merged 26 commits into
TechEmpower:masterfrom
faustinoaq:setup-gc-threads

Conversation

@faustinoaq

@faustinoaq faustinoaq commented Oct 20, 2017 •

Copy link
Copy Markdown
Contributor

Hi @nbrady-techempower We're having some issues on Kemal & Amber frameworks amberframework/amber#273 & #2960

Latest Crystal release doesn't support parallelism yet, so we are launching processes and using reuse_port. However current GC (bdwgc) is multithreaded.

This PR tries a new GC setting to avoid launching multiples threads across cores competing for CPU time.

Also add some small optimizations (compress html and remove extra variable) and update some dependencies

/cc @drujensen

Comment thread frameworks/Crystal/amber/setup.sh Outdated

export GC_MARKERS=1

export GC_NPROCS=1

@RX14 RX14 Oct 21, 2017 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/ivmai/bdwgc/blob/38facd4a1d5add23d6860aa728b1489a8384a985/doc/README.environment#L54

Note that setting this to 1
when multiple processors are available will preserve
correctness, but may lead to really horrible performance,
since the lock implementation will immediately yield without
first spinning.

It is safer to adjust GC_MARKERS than GC_NPROCS,
since GC_MARKERS has no impact on the lock implementation.

It is safer to adjust GC_MARKERS than GC_NPROCS,
since GC_MARKERS has no impact on the lock implementation.
It is safer to adjust GC_MARKERS than GC_NPROCS,
since GC_MARKERS has no impact on the lock implementation.
It is safer to adjust GC_MARKERS than GC_NPROCS,
since GC_MARKERS has no impact on the lock implementation.
It is safer to adjust GC_MARKERS than GC_NPROCS,
since GC_MARKERS has no impact on the lock implementation.
</tr>
<% end %>
</table> No newline at end of file
<table><tr><th>id</th><th>message</th></tr><% fortunes.each do |fortune| %><tr><td><%= fortune.id %></td><td><%= HTML.escape(fortune.message || "") %></td></tr><% end %></table>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@faustinoaq this doesn't seem like a realistic template. I would rather keep the spaces so if someone comes and looks at this Amber project, they can see what is going on.

Do you anticipate a significant increase in performance by removing the spaces?

@faustinoaq faustinoaq Oct 21, 2017 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see, let me revert this changes

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@faustinoaq

Copy link
Copy Markdown
Contributor Author

@drujensen Finally worked! :) I think we're ready to test performance

@drujensen drujensen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. please squash the extra commits.

@RX14 Do you think there are better settings for the GC than what @faustinoaq is proposing?

@NateBrady23

Copy link
Copy Markdown
Member

Hey guys, I'm going to leave this open until our new Server Central environment is ready to go. So feel free to make additional changes and as soon as we get that all set up, I'll merge in and we'll spit out another preview round. Make as many commits as you'd like; I always squash and merge.

@drujensen

Copy link
Copy Markdown
Contributor

@nbrady-techempower It looks like this is ready to test. Really interested to see if this makes a difference. Thanks for your help.

@NateBrady23

Copy link
Copy Markdown
Member

@drujensen It's on top of my list to get these numbers to you guys. We're waiting on the vendor to finish moving our machines to another server. It's out of our hands at the moment, but as soon as it's all set and we're able to start running tests again you will be among the first to know!

@eliasjpr

Copy link
Copy Markdown

@nbrady-techempower keep us in the loop we are interested in these results :)

@NateBrady23
NateBrady23 merged commit 8a6c5b8 into TechEmpower:master Nov 4, 2017
@NateBrady23

Copy link
Copy Markdown
Member

Hey guys, we've got our environment set up. I just kicked off a new run with this PR merged in. I should have some results to share for you by Monday.

@faustinoaq
faustinoaq deleted the setup-gc-threads branch November 4, 2017 16:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants