Files
game_server/src/main/resources/application.yml

126 lines
4.5 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

spring:
application:
name: gameplatform-server
datasource:
url: jdbc:mysql://192.140.164.137:3306/login_task_db?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&sessionVariables=innodb_lock_wait_timeout=10,wait_timeout=300,interactive_timeout=300
username: login_task_db
password: 3MaXfeWJ4d6cGMrL
driver-class-name: com.mysql.cj.jdbc.Driver
hikari:
maximum-pool-size: 100 # 增加最大连接数从50到100
minimum-idle: 20 # 增加最小空闲连接从10到20
connection-timeout: 10000 # 降低连接获取超时从30秒到10秒
idle-timeout: 240000 # 空闲连接超时4分钟必须 < wait_timeout
max-lifetime: 240000 # 连接最大存活4分钟必须 < MySQL wait_timeout=5分钟
leak-detection-threshold: 60000 # 连接泄漏检测60秒给事务足够时间
validation-timeout: 3000 # 连接验证超时3秒从5秒降低
connection-test-query: SELECT 1
# 连接池健康监控和自动重连
initialization-fail-timeout: 1
register-mbeans: true
# 自动重连配置
auto-commit: true
task:
detection:
poll:
size: 4
transaction:
default-timeout: 15 # 降低默认事务超时从30秒到15秒
mvc:
async:
request-timeout: 60000 # 异步请求超时60秒
lifecycle:
timeout-per-shutdown-phase: 30s # 关闭超时30秒
mybatis-plus:
mapper-locations: classpath:mapper/**/*.xml
type-aliases-package: com.gameplatform.server.model.entity
configuration:
map-underscore-to-camel-case: true
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 注释掉以关闭SQL日志
global-config:
db-config:
id-type: auto
logic-delete-field: deleted
logic-delete-value: 1
logic-not-delete-value: 0
server:
port: 18080
# Tomcat 线程池配置 - 提高并发处理能力
tomcat:
threads:
max: 200 # 最大工作线程数默认200
min-spare: 20 # 最小空闲线程数默认10
max-connections: 10000 # 最大连接数默认8192
accept-count: 200 # 等待队列长度默认100
connection-timeout: 20000 # 连接超时20秒
shutdown: graceful # 优雅关闭
management:
endpoints:
web:
exposure:
include: health,info,metrics,threaddump
logging:
level:
root: info
com.gameplatform.server: debug # 保持整体调试
# 仅保留设备解析最终汇总INFO其余降级
# com.gameplatform.server.service.device.DeviceStatusService: info
# com.gameplatform.server.service.device.DeviceStatusCheckService: info
# # 脚本客户端与定时任务降噪
# com.gameplatform.server.service.external.ScriptClient: warn
# com.gameplatform.server.task.DeviceStatusCheckTask: warn
# com.gameplatform.server.task.UsingLinkCheckTask: warn
# # 完成检测服务降噪屏蔽debug“置信度低”之类日志
# com.gameplatform.server.service.detection.GameCompletionDetectionService: warn
# # 设备任务更新服务:只保留警告/错误(不输出“开始处理设备/点数已更新为”等调试信息)
# com.gameplatform.server.service.link.DeviceTaskUpdateService: warn
# Mapper 与 SQL 调用降噪(屏蔽 MyBatis 的参数/SQL DEBUG
com.gameplatform.server.mapper: warn
com.baomidou.mybatisplus: warn
org.apache.ibatis: warn
org.mybatis: warn
com.zaxxer.hikari: warn
pattern:
console: "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"
console:
enabled: true
security:
jwt:
secret: "change-this-secret-to-a-long-random-string-please"
access-token-minutes: 1440
refresh-token-days: 7
# Swagger/OpenAPI 配置
springdoc:
api-docs:
path: /api-docs
swagger-ui:
path: /swagger-ui.html
tags-sorter: alpha
operations-sorter: alpha
doc-expansion: none
disable-swagger-default-url: true
display-request-duration: true
packages-to-scan: com.gameplatform.server.controller
# 外部脚本端配置与链接过期时间
script:
base-url: "http://36.138.184.60:12345"
api-base-url: "http://36.138.184.60:1234"
connect-timeout-ms: 3000
read-timeout-ms: 5000
# 服务器配置
app:
base-url: "https://uzi1.cn" # 生产环境需要配置为实际域名
# base-url: "http://localhost:18080" # 本地测试环境
link:
expire-hours: 2