Adding Tunning Options

This commit is contained in:
2018-04-11 17:00:18 +02:00
parent edafc9a45e
commit 8b9bb4e7d7
5 changed files with 109 additions and 0 deletions

13
creolefuncs/mariadb.py Normal file
View 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"