Skip to content

Commit

Permalink
allow win get 1/4 shared_buffers for pg >= 10
Browse files Browse the repository at this point in the history
  • Loading branch information
le0pard committed Apr 1, 2021
1 parent d4a73d4 commit 187578a
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 60 deletions.
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GIT
remote: https://github.com/middleman/middleman
revision: 35a52af5284cb1b7164ba0ead734cbdb8a1322f7
revision: 0dc897211baaae4433cfc9d26f7334549cbf9f50
specs:
middleman (5.0.0.rc.2)
coffee-script (~> 2.2)
Expand Down Expand Up @@ -80,7 +80,7 @@ GEM
kramdown (2.3.1)
rexml
lazy_priority_queue (0.1.1)
listen (3.5.0)
listen (3.5.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
memoist (0.16.2)
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
"assets:build": "gulp cleanup:assets && NODE_ENV=production webpack --bail"
},
"dependencies": {
"@babel/core": "7.13.13",
"@babel/core": "7.13.14",
"@babel/plugin-transform-runtime": "7.13.10",
"@babel/preset-env": "7.13.12",
"@babel/preset-react": "7.13.13",
"@babel/runtime": "7.13.10",
"@babel/runtime-corejs3": "7.13.10",
"babel-loader": "8.2.2",
"classnames": "2.2.6",
"classnames": "2.3.0",
"clipboard": "2.0.8",
"core-js": "3.9.1",
"core-js": "3.10.0",
"create-react-context": "0.3.0",
"critical": "3.0.0",
"css-loader": "5.2.0",
Expand All @@ -41,9 +41,9 @@
"lost": "8.3.1",
"mini-css-extract-plugin": "1.4.0",
"normalize.css": "8.0.1",
"postcss": "8.2.8",
"postcss": "8.2.9",
"postcss-browser-reporter": "0.6.0",
"postcss-import": "14.0.0",
"postcss-import": "14.0.1",
"postcss-loader": "5.2.0",
"postcss-preset-env": "6.7.0",
"postcss-reporter": "7.0.2",
Expand Down Expand Up @@ -73,7 +73,7 @@
"yup": "0.32.9"
},
"devDependencies": {
"@babel/eslint-parser": "7.13.10",
"@babel/eslint-parser": "7.13.14",
"babel-jest": "26.6.3",
"eslint": "7.23.0",
"eslint-plugin-import": "2.22.1",
Expand Down
14 changes: 8 additions & 6 deletions webpack/selectors/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,21 @@ const totalMemoryInKb = createSelector(
)

export const sharedBuffers = createSelector(
[totalMemoryInKb, getDBType, getOSType],
(totalMemoryKb, dbType, osType) => {
[totalMemoryInKb, getDBType, getOSType, getDBVersion],
(totalMemoryKb, dbType, osType, dbVersion) => {
let sharedBuffersValue = {
[DB_TYPE_WEB]: Math.floor(totalMemoryKb / 4),
[DB_TYPE_OLTP]: Math.floor(totalMemoryKb / 4),
[DB_TYPE_DW]: Math.floor(totalMemoryKb / 4),
[DB_TYPE_DESKTOP]: Math.floor(totalMemoryKb / 16),
[DB_TYPE_MIXED]: Math.floor(totalMemoryKb / 4)
}[dbType]
// Limit shared_buffers to 512MB on Windows
const winMemoryLimit = 512 * SIZE_UNIT_MAP['MB'] / SIZE_UNIT_MAP['KB']
if (OS_WINDOWS === osType && sharedBuffersValue > winMemoryLimit) {
sharedBuffersValue = winMemoryLimit
if (dbVersion < 10 && OS_WINDOWS === osType) {
// Limit shared_buffers to 512MB on Windows
const winMemoryLimit = 512 * SIZE_UNIT_MAP['MB'] / SIZE_UNIT_MAP['KB']
if (sharedBuffersValue > winMemoryLimit) {
sharedBuffersValue = winMemoryLimit
}
}
return sharedBuffersValue
}
Expand Down
101 changes: 55 additions & 46 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,24 @@
resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.13.12.tgz#a8a5ccac19c200f9dd49624cac6e19d7be1236a1"
integrity sha512-3eJJ841uKxeV8dcN/2yGEUy+RfgQspPEgQat85umsE1rotuquQ2AbIub4S6j7c50a2d+4myc+zSlnXeIHrOnhQ==

"@babel/core@7.13.13":
version "7.13.13"
resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.13.13.tgz#bc44c4a2be2288ec4ddf56b66fc718019c76ac29"
integrity sha512-1xEs9jZAyKIouOoCmpsgk/I26PoKyvzQ2ixdRpRzfbcp1fL+ozw7TUgdDgwonbTovqRaTfRh50IXuw4QrWO0GA==
"@babel/core@7.13.14":
version "7.13.14"
resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.13.14.tgz#8e46ebbaca460a63497c797e574038ab04ae6d06"
integrity sha512-wZso/vyF4ki0l0znlgM4inxbdrUvCb+cVz8grxDq+6C9k6qbqoIJteQOKicaKjCipU3ISV+XedCqpL2RJJVehA==
dependencies:
"@babel/code-frame" "^7.12.13"
"@babel/generator" "^7.13.9"
"@babel/helper-compilation-targets" "^7.13.13"
"@babel/helper-module-transforms" "^7.13.12"
"@babel/helper-module-transforms" "^7.13.14"
"@babel/helpers" "^7.13.10"
"@babel/parser" "^7.13.13"
"@babel/template" "^7.12.13"
"@babel/traverse" "^7.13.13"
"@babel/types" "^7.13.13"
"@babel/types" "^7.13.14"
convert-source-map "^1.7.0"
debug "^4.1.0"
gensync "^1.0.0-beta.2"
json5 "^2.1.2"
lodash "^4.17.19"
semver "^6.3.0"
source-map "^0.5.0"

Expand All @@ -70,12 +69,12 @@
semver "^6.3.0"
source-map "^0.5.0"

"@babel/eslint-parser@7.13.10":
version "7.13.10"
resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.13.10.tgz#e272979914f36bb6cea144c14c32bb51632696dd"
integrity sha512-/I1HQ3jGPhIpeBFeI3wO9WwWOnBYpuR0pX0KlkdGcRQAVX9prB/FCS2HBpL7BiFbzhny1YCiBH8MTZD2jJa7Hg==
"@babel/eslint-parser@7.13.14":
version "7.13.14"
resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.13.14.tgz#f80fd23bdd839537221914cb5d17720a5ea6ba3a"
integrity sha512-I0HweR36D73Ibn/FfrRDMKlMqJHFwidIUgYdMpH+aXYuQC+waq59YaJ6t9e9N36axJ82v1jR041wwqDrDXEwRA==
dependencies:
eslint-scope "5.1.0"
eslint-scope "^5.1.0"
eslint-visitor-keys "^1.3.0"
semver "^6.3.0"

Expand Down Expand Up @@ -230,19 +229,19 @@
"@babel/types" "^7.13.0"
lodash "^4.17.19"

"@babel/helper-module-transforms@^7.13.12":
version "7.13.12"
resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.13.12.tgz#600e58350490828d82282631a1422268e982ba96"
integrity sha512-7zVQqMO3V+K4JOOj40kxiCrMf6xlQAkewBB0eu2b03OO/Q21ZutOzjpfD79A5gtE/2OWi1nv625MrDlGlkbknQ==
"@babel/helper-module-transforms@^7.13.14":
version "7.13.14"
resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.13.14.tgz#e600652ba48ccb1641775413cb32cfa4e8b495ef"
integrity sha512-QuU/OJ0iAOSIatyVZmfqB0lbkVP0kDRiKj34xy+QNsnVZi/PA6BoSoreeqnxxa9EHFAIL0R9XOaAR/G9WlIy5g==
dependencies:
"@babel/helper-module-imports" "^7.13.12"
"@babel/helper-replace-supers" "^7.13.12"
"@babel/helper-simple-access" "^7.13.12"
"@babel/helper-split-export-declaration" "^7.12.13"
"@babel/helper-validator-identifier" "^7.12.11"
"@babel/template" "^7.12.13"
"@babel/traverse" "^7.13.0"
"@babel/types" "^7.13.12"
"@babel/traverse" "^7.13.13"
"@babel/types" "^7.13.14"

"@babel/helper-optimise-call-expression@^7.12.13":
version "7.12.13"
Expand Down Expand Up @@ -1140,6 +1139,15 @@
lodash "^4.17.19"
to-fast-properties "^2.0.0"

"@babel/types@^7.13.14":
version "7.13.14"
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.13.14.tgz#c35a4abb15c7cd45a2746d78ab328e362cbace0d"
integrity sha512-A2aa3QTkWoyqsZZFl56MLUsfmh7O0gN41IPvXAE/++8ojpbz12SszD7JEGYVdn4f9Kt4amIei07swF1h4AqmmQ==
dependencies:
"@babel/helper-validator-identifier" "^7.12.11"
lodash "^4.17.19"
to-fast-properties "^2.0.0"

"@bcoe/v8-coverage@^0.2.3":
version "0.2.3"
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
Expand Down Expand Up @@ -2822,10 +2830,10 @@ class-utils@^0.3.5:
isobject "^3.0.0"
static-extend "^0.1.1"

classnames@2.2.6:
version "2.2.6"
resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.2.6.tgz#43935bffdd291f326dad0a205309b38d00f650ce"
integrity sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q==
classnames@2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.3.0.tgz#19524334bad47ccd99793936b67f9be0860fe835"
integrity sha512-UUf/S3eeczXBjHPpSnrZ1ZyxH3KmLW8nVYFUWIZA/dixYMIQr7l94yYKxaAkmPk7HO9dlT6gFqAPZC02tTdfQw==

clean-css@^4.2.3:
version "4.2.3"
Expand Down Expand Up @@ -3094,10 +3102,10 @@ core-js-pure@^3.0.0:
resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.9.1.tgz#677b322267172bd490e4464696f790cbc355bec5"
integrity sha512-laz3Zx0avrw9a4QEIdmIblnVuJz8W51leY9iLThatCsFawWxC3sE4guASC78JbCin+DkwMpCdp1AVAuzL/GN7A==

core-js@3.9.1:
version "3.9.1"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.9.1.tgz#cec8de593db8eb2a85ffb0dbdeb312cb6e5460ae"
integrity sha512-gSjRvzkxQc1zjM/5paAmL4idJBFzuJoo+jDjF1tStYFMV2ERfD02HhahhCGXUyHxQRG4yFKVSdO6g62eoRMcDg==
core-js@3.10.0:
version "3.10.0"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.10.0.tgz#9a020547c8b6879f929306949e31496bbe2ae9b3"
integrity sha512-MQx/7TLgmmDVamSyfE+O+5BHvG1aUGj/gHhLn1wVtm2B5u1eVIPvh7vkfjwWKNCjrTJB8+He99IntSQ1qP+vYQ==

core-util-is@1.0.2, core-util-is@~1.0.0:
version "1.0.2"
Expand Down Expand Up @@ -3990,15 +3998,7 @@ eslint-plugin-react@7.23.1:
resolve "^2.0.0-next.3"
string.prototype.matchall "^4.0.4"

eslint-scope@5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.0.tgz#d0f971dfe59c69e0cada684b23d49dbf82600ce5"
integrity sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w==
dependencies:
esrecurse "^4.1.0"
estraverse "^4.1.1"

eslint-scope@^5.1.1:
eslint-scope@^5.1.0, eslint-scope@^5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c"
integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==
Expand Down Expand Up @@ -4087,7 +4087,7 @@ esquery@^1.4.0:
dependencies:
estraverse "^5.1.0"

esrecurse@^4.1.0, esrecurse@^4.3.0:
esrecurse@^4.3.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921"
integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==
Expand Down Expand Up @@ -6954,7 +6954,7 @@ nanoclone@^0.2.1:
resolved "https://registry.yarnpkg.com/nanoclone/-/nanoclone-0.2.1.tgz#dd4090f8f1a110d26bb32c49ed2f5b9235209ed4"
integrity sha512-wynEP02LmIbLpcYw8uBKpcfF6dmg2vcpKqxeH5UcoKEYdExslsdUA4ugFauuaeYdTB76ez6gJW8XAZ6CgkXYxA==

nanoid@^3.1.20:
nanoid@^3.1.20, nanoid@^3.1.22:
version "3.1.22"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.22.tgz#b35f8fb7d151990a8aebd5aa5015c03cf726f844"
integrity sha512-/2ZUaJX2ANuLtTvqTlgqBQNJoQO398KyJgZloL0PZkC0dpysjncRUPsFe3DUPzz/y3h+u7C46np8RMuvF3jsSQ==
Expand Down Expand Up @@ -7888,10 +7888,10 @@ postcss-image-set-function@^3.0.1:
postcss "^7.0.2"
postcss-values-parser "^2.0.0"

postcss-import@14.0.0:
version "14.0.0"
resolved "https://registry.yarnpkg.com/postcss-import/-/postcss-import-14.0.0.tgz#3ed1dadac5a16650bde3f4cdea6633b9c3c78296"
integrity sha512-gFDDzXhqr9ELmnLHgCC3TbGfA6Dm/YMb/UN8/f7Uuq4fL7VTk2vOIj6hwINEwbokEmp123bLD7a5m+E+KIetRg==
postcss-import@14.0.1:
version "14.0.1"
resolved "https://registry.yarnpkg.com/postcss-import/-/postcss-import-14.0.1.tgz#6a3f8f2ce74a95fc7c72ecfe3eddfa0e9124e677"
integrity sha512-Xn2+z++vWObbEPhiiKO1a78JiyhqipyrXHBb3AHpv0ks7Cdg+GxQQJ24ODNMTanldf7197gSP3axppO9yaG0lA==
dependencies:
postcss-value-parser "^4.0.0"
read-cache "^1.0.0"
Expand Down Expand Up @@ -8404,13 +8404,13 @@ postcss@7.0.14:
source-map "^0.6.1"
supports-color "^6.1.0"

postcss@8.2.8, postcss@^8.2.6, postcss@^8.2.8:
version "8.2.8"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.2.8.tgz#0b90f9382efda424c4f0f69a2ead6f6830d08ece"
integrity sha512-1F0Xb2T21xET7oQV9eKuctbM9S7BC0fetoHCc4H13z0PT6haiRLP4T0ZY4XWh7iLP0usgqykT6p9B2RtOf4FPw==
postcss@8.2.9:
version "8.2.9"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.2.9.tgz#fd95ff37b5cee55c409b3fdd237296ab4096fba3"
integrity sha512-b+TmuIL4jGtCHtoLi+G/PisuIl9avxs8IZMSmlABRwNz5RLUUACrC+ws81dcomz1nRezm5YPdXiMEzBEKgYn+Q==
dependencies:
colorette "^1.2.2"
nanoid "^3.1.20"
nanoid "^3.1.22"
source-map "^0.6.1"

postcss@^6.0.0, postcss@^6.0.1, postcss@^6.0.14, postcss@^6.0.17, postcss@^6.0.6, postcss@^6.0.7, postcss@^6.0.8:
Expand All @@ -8431,6 +8431,15 @@ postcss@^7.0.0, postcss@^7.0.1, postcss@^7.0.14, postcss@^7.0.17, postcss@^7.0.2
source-map "^0.6.1"
supports-color "^6.1.0"

postcss@^8.2.6, postcss@^8.2.8:
version "8.2.8"
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.2.8.tgz#0b90f9382efda424c4f0f69a2ead6f6830d08ece"
integrity sha512-1F0Xb2T21xET7oQV9eKuctbM9S7BC0fetoHCc4H13z0PT6haiRLP4T0ZY4XWh7iLP0usgqykT6p9B2RtOf4FPw==
dependencies:
colorette "^1.2.2"
nanoid "^3.1.20"
source-map "^0.6.1"

prelude-ls@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
Expand Down

0 comments on commit 187578a

Please sign in to comment.