Adding mariadb service management

This commit is contained in:
2018-04-12 10:38:53 +02:00
parent 76120e1411
commit c1ff249d3e
2 changed files with 11 additions and 9 deletions

View File

@ -6,8 +6,8 @@ def getMemoryPercentage(percent):
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(int(memoryMb))
memoryMb = int(memoryToUse/(1024.**2))
return "{0}M".format(memoryMb)
except:
return "Error during memory percentage calculation"