web application optimization//todo

nginx 

proxy_connect_timeout 

proxy_read_timeout

proxy_write_timeout

max_fails + fail_timeout (after being satisfied, wait for fail_timeout to send the request again)

proxy_pass upstream load balancing

tomcat(springboot)

Cluster deployment

max-threads: 2000 maximum number of threads

min-spare-threads: 30 The number of threads that will be created initially, and ensure that there are at least that many threads available to initialize the number of threads  

MaxKeepAliveRequests Maximum number of connections In order to ensure that the service will not be overwhelmed by too many long http connections, we need to set a maximum number of connections to tomcat. Requests exceeding this number of connections will be rejected and let them load to other machines. Achieve the protection of oneself while playing the role of load balancing of the number of connections

acceptCount the maximum queue length of incoming connection requests

 connectionTimeout="20000" Request timed out 

max-http-post-size: 100MB #Request parameter length

uri-encoding: UTF-8 # URI encoding of tomcat

mysql

JDBC

# 初始连接数
initialSize: 5
# 最小连接池数量
minIdle: 10
# 最大连接池数量
maxActive: 200
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000
# 配置一个连接在池中最大生存的时间,单位是毫秒
maxEvictableIdleTimeMillis: 900000

repeat

#配置redis
redis:
  cluster:
    nodes: 10.110.20.214:7001,
            10.110.20.214:7002,
            10.110.20.214:7003,
            10.110.20.214:7004,
            10.110.20.214:7005,
            10.110.20.214:7006
    max-redirects: 3
    #连接超时时间
    timeout: 5000
    password :
  jedis:
    pool:
      max-total: 20
      #连接池最大连接数(使用负值表示没有限制)
      max-active: 10
      #连接池中的最大空闲连接
      min-idle: 1
      #连接池最大阻塞等待时间(使用负值表示没有限制)
      max-wait: -1
      #连接池中的最小空闲连接
      max-idle: 8
      timeBetweenEvictionRunsMillis : 10
      testWhileIdle : true
      testOnBorrow : true
      testOnReturn : true
  # redis key 标识 区分本地跟测试环境
  cache:
     resource: dev

dubbo

<dubbo:reference id="recordAaUsedService" interface="com.wondware.user.service.RecordAbUsedService" timeout="30000" />

dubbo.reference.retries>1 The default number of dubbo retries is 2, so the service is only called once and needs to be set to retries=0

The timeout period set by the DUBBO consumer side cannot be arbitrarily set. It needs to be set according to the actual business situation. If the set time is too short, it will take a long time for complex services to be completed, and normal services cannot be completed within the set timeout period. deal with.

If the consumer reaches the timeout period, then dubbo will perform a retry mechanism (if dubbo.reference.retries>1 is configured)

hive

h2

oracle

# 初始连接数
initialSize: 5
# 最小连接池数量
minIdle: 10
# 最大连接池数量
maxActive: 2000
# 配置获取连接等待超时的时间
maxWait: 300000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000
# 配置一个连接在池中最大生存的时间,单位是毫秒

 

 

 

Guess you like

Origin blog.csdn.net/qq_24271537/article/details/113349959