Skip to content

Commit 1ed6e36

Browse files
author
Your Name
committed
windows tune
1 parent 4c1e6eb commit 1ed6e36

File tree

5 files changed

+31
-5
lines changed

5 files changed

+31
-5
lines changed

mamonsu/lib/parser.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,18 @@
109109
--dont-reload-postgresql
110110
"""
111111

112+
if platform.WINDOWS:
113+
usage_msg += """
114+
115+
AutoTune config and system:
116+
Command: tune
117+
Options:
118+
-l, --log-level INFO|DEBUG|WARN
119+
--dry-run
120+
--disable-sudo
121+
--dont-tune-pgbadger
122+
--dont-reload-postgresql
123+
"""
112124

113125
def print_total_help():
114126
print(usage_msg.format(prog=sys.argv[0]))

mamonsu/tools/tune/pgsql.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def __init__(self, args):
2525
self._configure_pgbadger()
2626
self._configure_extensions()
2727
self._configure_virt_guest()
28+
self._miscellaneous()
2829

2930
self._reload_config()
3031

@@ -118,6 +119,10 @@ def _checkpointer(self):
118119
self._run_query(
119120
"alter system set checkpoint_completion_target to 0.75")
120121

122+
if platform.WINDOWS:
123+
logging.info('No wal_size tune for windows')
124+
return
125+
121126
sysmemory = self.sys_info.meminfo['_TOTAL']
122127
if sysmemory < 4 * 1024 * 1024 * 1024:
123128
return
@@ -154,11 +159,19 @@ def _configure_pgbadger(self):
154159
"'%%t [%%p]: [%%l-1] db=%%d,user=%%u,app=%%a,client=%%h ';")
155160

156161
def _configure_virt_guest(self):
162+
if platform.WINDOWS:
163+
logging.info('No virt_guest tune for windows')
164+
return
157165
if not self.sys_info.is_virt_guest():
158166
return
159167
self._run_query(
160168
"alter system set synchronous_commit to off;")
161169

170+
def _miscellaneous(self):
171+
if platform.WINDOWS:
172+
self._run_query(
173+
"alter system set update_process_title to off;")
174+
162175
def _reload_config(self):
163176
if self.args.reload_config is not None:
164177
return

mamonsu/tools/tune/start.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
import optparse
55
import os
66
import sys
7-
import pwd
7+
import mamonsu.lib.platform as platform
8+
if platform.LINUX:
9+
import pwd
810

911
from mamonsu import __version__
10-
import mamonsu.lib.platform as platform
1112
from mamonsu.lib.default_config import DefaultConfig
1213
from mamonsu.plugins.pgsql.driver.checks import is_conn_to_db
1314
from mamonsu.tools.tune.pgsql import AutoTunePgsl

packaging/win/mamonsu.def.nsh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
!define NAME Mamonsu
2-
!define VERSION 0.6.5
2+
!define VERSION 2.0.4
33
!define MAMONSU_REG_PATH "Software\PostgresPro\Mamonsu"
44
!define MAMONSU_REG_UNINSTALLER_PATH "Software\Microsoft\Windows\CurrentVersion\Uninstall"
55
!define EDB_REG "SOFTWARE\Postgresql"

packaging/win/mamonsu.nsi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ Section "${NAME} ${VERSION}" SectionMamonsu
120120
${endif}
121121

122122
SetOutPath "$INSTDIR"
123-
File "..\dist\service_win32.exe"
124-
File "..\dist\agent.exe"
123+
File "..\..\dist\service_win32.exe"
124+
File "..\..\dist\mamonsu.exe"
125125
CreateDirectory "$log_dir"
126126
WriteUninstaller "$INSTDIR\Uninstall.exe"
127127

0 commit comments

Comments
 (0)