Adding Tunning Options
This commit is contained in:
13
creolefuncs/mariadb.py
Normal file
13
creolefuncs/mariadb.py
Normal file
@ -0,0 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
def getMemoryPercentage(percent):
|
||||
import os
|
||||
try:
|
||||
percent = int(percent)
|
||||
totalMemory = os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES')
|
||||
memoryToUse = (totalMemory*percent)/100
|
||||
memoryMb = memoryToUse/(1024.**2)
|
||||
return "{0}M".format(round(memoryMb,2))
|
||||
except:
|
||||
return "Error during memory percentage calculation"
|
||||
|
Reference in New Issue
Block a user