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

Feature: Remove arbitrary maximum integer values. Implements #101 #102

Merged
merged 2 commits into from
Nov 29, 2024

Conversation

jmealo
Copy link
Contributor

@jmealo jmealo commented Nov 27, 2024

Addresses #101

@@ -182,7 +182,7 @@ const ConfigurationForm = () => {
autoCorrect="off"
autoCapitalize="none"
min={1}
max={9999}
max={Number.MAX_SAFE_INTEGER}
Copy link
Owner

Choose a reason for hiding this comment

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

I am not sure, postgresql exists server, which have more, than 9999 CPUs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

An arbitrary limit on memory forced me to fork in order to use the tool. The UI code didn't handle not having a max value, so I set everything to the maximum allowable value. I don't necessarily think it makes sense to add arbitrary limits, as they cause issues for users, and aren't likely to cause typos/errors as they're implemented (since 9999 is "too high" anyway).

@@ -203,7 +203,7 @@ const ConfigurationForm = () => {
autoCorrect="off"
autoCapitalize="none"
min={20}
max={9999}
max={Number.MAX_SAFE_INTEGER}
Copy link
Owner

@le0pard le0pard Nov 27, 2024

Choose a reason for hiding this comment

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

1000 connections even dont make sense, so I dont see reason for this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suppose I have a 4 socket EPYC server, with 768 cores and 2TB of ram.... At 15MB per connection = ~83,200 theoretical max connections.

I'm mostly concerned with memory, however, I don't see a logical reason to enforce a maximum on any of these values. (How did we land on 9999?)

@le0pard
Copy link
Owner

le0pard commented Nov 28, 2024

Let put just 999999 - should be enough. also you need fix pattern for inputs

@jmealo
Copy link
Contributor Author

jmealo commented Nov 29, 2024

@le0pard: Thank you. That sounds reasonable to me. I added a constant in the config for MAX_NUMERIC_VALUE and referenced that throughout.

It occured to me that allowing decimal inputs when memory units are GB would also make a ton of sense. I still require MB to be an integer, but allow decimal for GB. What do you think?

@le0pard
Copy link
Owner

le0pard commented Nov 29, 2024

Problem with decimal, that different locales using different separator, so I better skip this for now. Just don't forget fix pattern for inputs (regex need allow more numbers)

@jmealo
Copy link
Contributor Author

jmealo commented Nov 29, 2024

@le0pard: I just noticed that! I tried to do it in a locale-aware way and it was giving me some trouble. I'll back that out.

@jmealo
Copy link
Contributor Author

jmealo commented Nov 29, 2024

@le0pard: Ok, I removed decimal support, everything looks good/consistent here with the regex/constant-usage to me.

@le0pard le0pard merged commit 3947f47 into le0pard:master Nov 29, 2024
2 checks passed
@le0pard
Copy link
Owner

le0pard commented Nov 29, 2024

thanks for contribution @jmealo

@le0pard le0pard mentioned this pull request Nov 29, 2024
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

Successfully merging this pull request may close these issues.

2 participants