Skip to content

Commit

Permalink
add huge pages
Browse files Browse the repository at this point in the history
  • Loading branch information
le0pard committed Aug 20, 2023
1 parent 900a2c4 commit b7900a4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/common/components/configurationView/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
selectConnectionNum,
selectHDType,
selectMaxConnections,
selectHugePages,
selectSharedBuffers,
selectEffectiveCacheSize,
selectMaintenanceWorkMem,
Expand Down Expand Up @@ -104,6 +105,7 @@ const ConfigurationView = () => {
const hdType = useSelector(selectHDType)
// computed settings
const maxConnectionsVal = useSelector(selectMaxConnections)
const hugePagesVal = useSelector(selectHugePages)
const sharedBuffersVal = useSelector(selectSharedBuffers)
const effectiveCacheSizeVal = useSelector(selectEffectiveCacheSize)
const maintenanceWorkMemVal = useSelector(selectMaintenanceWorkMem)
Expand Down Expand Up @@ -164,7 +166,8 @@ const ConfigurationView = () => {
['default_statistics_target', defaultStatisticsTargetVal],
['random_page_cost', randomPageCostVal],
['effective_io_concurrency', effectiveIoConcurrencyVal],
['work_mem', formatValue(workMemVal)]
['work_mem', formatValue(workMemVal)],
['huge_pages', hugePagesVal]
]
.concat(getCheckpointSegments())
.concat(getParallelSettings())
Expand Down
6 changes: 6 additions & 0 deletions src/features/configuration/configurationSlice.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ export const selectMaxConnections = createSelector(
}[dbType]
)

export const selectHugePages = createSelector(
[selectTotalMemoryInKb],
// more 32GB - better also have huge page
(totalMemoryKBytes) => (totalMemoryKBytes >= 33554432 ? 'try' : 'off')
)

export const selectSharedBuffers = createSelector(
[selectTotalMemoryInKb, selectDBType, selectOSType, selectDBVersion],
(totalMemoryKb, dbType, osType, dbVersion) => {
Expand Down

0 comments on commit b7900a4

Please sign in to comment.