когда я использую springcloud zuul, возникает большое количество состояний TCP CLOSE_WAIT , кто-нибудь знает, почему это происходит?
вот моя конфигурация zuul
родительский пом
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version>
<relativePath />
</parent>
pom.xml
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-zuul</artifactId>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Edgware.SR2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
application.properties
server.port=8081
spring.application.name=zuul-server-test
eureka.instance.preferIpAddress=true
eureka.instance.instance-id=${spring.cloud.client.ipAddress}:${server.port}
eureka.instance.leaseRenewalIntervalInSeconds=5
eureka.instance.leaseExpirationDurationInSeconds=10
eureka.client.serviceUrl.defaultZone=http://127.0.0.1:8080/eureka/
zuul.add-host-header=true
zuul.sensitive-headers=
hystrix.command.default.execution.timeout.enable=true
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=60000
zuul.host.connect-timeout-millis=60000
zuul.host.socket-timeout-milllis=60000
ribbon.eureka.enabled=true
ribbon.ReadTimeout=60000
ribbon.ConnectTimeout=30000
ribbon.MaxAutoRetries=0
ribbon.MaxAutoRetriesNextServer=1
ribbon.OkToRetryOnAllOperations=false
ribbon.httpclient.enabled=false
ribbon.okhttp.enabled=true
zuul.routes.hello.path=/hello/**
zuul.routes.hello.sensitiveHeaders=
zuul.routes.hello.service-id=hello-server
Java
@SpringBootApplication
@EnableDiscoveryClient
@EnableZuulProxy
public class DevcloudZuulApplication {
public static void main(String[] args) {
SpringApplication.run(DevcloudZuulApplication.class, args);
}
}
при посещении http://localhost:8081/hello/index.html, созданных tcp-ссылок порт 8082 является hello-сервером
tcp 0 0 ::ffff:192.168.120.20:8082 ::ffff:192.168.120.20:21505 ESTABLISHED 47968/java
tcp 0 0 ::ffff:192.168.120.20:21505 ::ffff:192.168.120.20:8082 ESTABLISHED 132689/java
tcp 0 0 ::ffff:192.168.120.20:8082 ::ffff:192.168.120.20:21510 ESTABLISHED 47968/java
tcp 0 0 ::ffff:192.168.120.20:21510 ::ffff:192.168.120.20:8082 ESTABLISHED 132689/java
tcp 0 0 ::ffff:192.168.120.20:8082 ::ffff:192.168.120.20:21504 ESTABLISHED 47968/java
tcp 0 0 ::ffff:192.168.120.20:21504 ::ffff:192.168.120.20:8082 ESTABLISHED 132689/java
потом меняется
tcp 0 0 ::ffff:192.168.120.20:8082 ::ffff:192.168.120.20:21505 FIN_WAIT2 -
tcp 1 0 ::ffff:192.168.120.20:21505 ::ffff:192.168.120.20:8082 CLOSE_WAIT 132689/java
tcp 0 0 ::ffff:192.168.120.20:8082 ::ffff:192.168.120.20:21510 FIN_WAIT2 -
tcp 0 0 ::ffff:192.168.120.20:21510 ::ffff:192.168.120.20:8082 CLOSE_WAIT 132689/java
tcp 0 0 ::ffff:192.168.120.20:8082 ::ffff:192.168.120.20:21504 FIN_WAIT2 -
tcp 1 0 ::ffff:192.168.120.20:21504 ::ffff:192.168.120.20:8082 CLOSE_WAIT 132689/java
наконец
tcp 1 0 ::ffff:192.168.120.20:21505 ::ffff:192.168.120.20:8082 CLOSE_WAIT 132689/java
tcp 1 0 ::ffff:192.168.120.20:21504 ::ffff:192.168.120.20:8082 CLOSE_WAIT 132689/java
tcp 1 0 ::ffff:192.168.120.20:21510 ::ffff:192.168.120.20:8082 CLOSE_WAIT 132689/java
и этот статус будет действовать в течение нескольких часов.