增加gs_checkse工具检查参数范围提示
This commit is contained in:
parent
7455f379cf
commit
23a3a661ae
@ -299,7 +299,7 @@ def collectDBConnection():
|
||||
"""
|
||||
data = DBConnection()
|
||||
data.db = []
|
||||
sql_query = """SELECT datname FROM pg_database WHERE datistemplate = false AND datconnlimit = -1;"""
|
||||
sql_query = """SELECT datname FROM pg_database WHERE datistemplate = false AND (datconnlimit = -1 OR datconnlimit > 1024);"""
|
||||
getDatabaseInfo(data, sql_query)
|
||||
return data
|
||||
|
||||
@ -2592,6 +2592,9 @@ def checkConnectionConfiguration(isSetting):
|
||||
if not isSetting:
|
||||
g_logger.log(" Warning reason:Ensure correct configuration of maximum connection settings for the database instance.Setting parameters too high may cause the database to request more System V shared memory or semaphores, exceeding the values allowed by the operating system's default configuration. Users need to determine the size of parameter values based on business specifications or consult technical support.You can modify the value of the parameter max_connections and then restart the database.")
|
||||
else:
|
||||
admin_connections = collectAdminConnection()
|
||||
if admin_connections.output >= 5000:
|
||||
setAdminConnection(admin_connections)
|
||||
setConnectionConfiguration(data)
|
||||
|
||||
def checkDBConnection(isSetting):
|
||||
@ -2615,7 +2618,7 @@ def checkAdminConnection(isSetting):
|
||||
output : NA
|
||||
"""
|
||||
data = collectAdminConnection()
|
||||
if not (data.output < data.maxValue):
|
||||
if not ((data.output < data.maxValue) and (data.output >= 3)):
|
||||
if not isSetting:
|
||||
g_logger.log(" Warning reason:Ensure the connection settings used by system administrators are configured correctly.The parameter sysadmin_reserved_connections represents the minimum number of connections reserved for the database system administrator. This ensures that there are dedicated connection channels for the system administrator, preventing connections from being occupied by regular users or malicious users, which could otherwise prevent the administrator from connecting. The value of this parameter must be less than the value of max_connections.")
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user