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

Incorrect Concurrency Configuration in README Example #51

Open
divyanshsikarwar opened this issue Dec 30, 2023 · 0 comments
Open

Incorrect Concurrency Configuration in README Example #51

divyanshsikarwar opened this issue Dec 30, 2023 · 0 comments

Comments

@divyanshsikarwar
Copy link

Issue Description

The README of the go-sitemap-generator repository provides an example for setting concurrency that can lead to unintended consequences, causing severe performance degradation and downtime in production environments.

Expected Behavior

The README example should provide clear and accurate guidance on setting concurrency, avoiding any negative impact on the overall application performance.

Clarification on Misleading Information

The First README example sm := stm.NewSitemap(1) might be misconstrued as endorsing the recommended initialization with 1. However, using this value inadvertently changes the Golang runtime to utilize only one core for the entire application, resulting in severe performance degradation and potential downtimes.

Additionally, the line "To disable concurrency, set number of CPUs to 1." in the README is misleading. It may be misinterpreted as suggesting the setting of internal max goroutines to 1, rather than correctly understanding that it impacts the whole Go application by limiting the go runtime to a single core.

Proposed Solution

Update the README examples to better guide users on configuring concurrency without causing unintended consequences.

Additional Context

I encountered this issue while working as a Backend intern at Testbook. The incorrect configuration resulted in a downtime on our production environment.

Solution :

Update the following text in readme.md

To disable concurrency, set the number of CPUs to 1 for the whole Go Application [Not Recommended].

sm := stm.NewSitemap(1)

And change the first example to this :

func main() {
sm := stm.NewSitemap(0)
....

Changes are in italics.

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

1 participant