mirontoli / sql-max

SQL Server Max Memory Calculator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Terminology

roobie opened this issue · comments

We should choose to use GiB for the unit in the UI
or
use var oneGb = 1000; //MB in the calculations

since:

one GB === 1000 MB === 1 000 000 000 B
one GiB === 1024 MiB === 2^30 B

(Reference1)[http://www.wolframalpha.com/input/?i=1+gb]

(Reference2)[http://www.wolframalpha.com/input/?i=1+gib]

Agreed, since we're recommending exact max memory that people should use, we need to be accurate.

Thanks, guys, for the heads up. Totally agree on that. I have not thought about it a lot, just "copied" the formula from sqlmem.codeplex.com. But we should abolutely be accurate.

Can we write some unit tests for calculating, some simple parameters and obvious results? I'd prefer jasmine.

+1 for unit tests. However, for these to work we need some correct inputs and their corresponding correct outputs, since otherwise we would just be implementing the same algorithm in the unit test as in the 'production' code.

Yes, exactly, by simple values I meant some values where we the results in advance. It it would be multiplication, we could test 3*2 = 6. The result cannot be "calculated" in the unit tests..

There are actually two definitions:

  • _Base 10 Definition_ where 1 GB = 1000 MB. It is an SI definition, a standardized definition
  • _Base 2 Definition_ where 1 GB = 1024 MB, is a "standard" used by Microsoft.

When you google it, you'll see a calculator based on the base 2 definition.

In my opinion, it should as in all other units:
1 K = 1000
1 M = 1000 000
1 G = 1000 000 000

So should be with Bytes, too.

The real question is which unit is used when configuring SQL.

You are right. There are standards and there are other standards. SQL Max web app is only relevant for MS SQL Server. Need to investigate.

I am changing GB to GiB for now...

Hi,
Stumbled on this while trying to replicate the formula in PowerShell and consistently getting different values compared to the web app. This change does not seem to have made it into the web app, as it still counts 1 GB = 1000. Any reason why this was not implemented?
Personally I find it strange to use 1 GB = 1000, while later on in the formula you calculate (1 GB * ($TotalCPUCores / 4)), where 1 GB is manually defined as 1024.
It seems a bit inconsistent, doesn't it?