Spring Cloud Gateway имеет задержку при отправке запросов к нижестоящим APIJAVA

Программисты JAVA общаются здесь
Ответить
Гость
 Spring Cloud Gateway имеет задержку при отправке запросов к нижестоящим API

Сообщение Гость »

Мы настроили Spring Cloud Gateway для пересылки запросов к нижестоящим API. Однако мы заметили, что некоторым запросам требуется около 5 секунд или более для отправки запросов к нижестоящим API, и эта задержка в отправке запросов приводит к тому, что другие службы не работают должным образом, поскольку у них есть тайм-аут в 5 секунд, и если ответ не получен в по этому таймауту сервис ответит ошибкой.
Серва проверены, нагрузки на ресурсы нет. Мы попытались увеличить значения -Xms и -Xmx для повышения производительности, но это тоже не помогло. Мы также пытались отправлять только запросы POST для маршрутизации, но мы все равно видим отправку некоторых запросов GET. и не знаем, как мы можем это остановить.
В приведенных ниже журналах задержка составляет около 10 секунд, и в конце мы получили **java.io.IOException: существующее соединение было принудительно закрыт удаленным хостом
**
2024-03-12 01:21:12.174 DEBUG 7104 --- [tor-http-nio-13] reactor.netty.http.server.HttpServer : [5b39460c-1, L:/Local IP:8058 - R:/10.216.130.23:14454] Handler is being applied: org.springframework.http.server.reactive.ReactorHttpHandlerAdapter@2bd948e4
2024-03-12 01:21:12.174 DEBUG 7104 --- [tor-http-nio-13] o.s.w.s.adapter.HttpWebHandlerAdapter : [5b39460c-2530] HTTP POST "/wallet/v1/wallet/qr/payment/auth"
2024-03-12 01:21:12.174 INFO 7104 --- [tor-http-nio-13] c.d.epiCloudproxy.LoggingFilter : Routing Incoming request orginal url Local API Endpoint route to url: api endpoint,
2024-03-12 01:21:12.174 DEBUG 7104 --- [ctor-http-nio-1] r.n.resources.PooledConnectionProvider : [c5448fc1, L:/Local IP:54766 - R:Remote IP:9480] Channel acquired, now: 1 active connections, 0 inactive connections and 0 pending acquire requests.
2024-03-12 01:21:12.174 DEBUG 7104 --- [ctor-http-nio-1] r.netty.http.client.HttpClientConnect : [c5448fc1-2, L:/Local IP:54766 - R:Remote IP:9480] Handler is being applied: {uri=api endpoint, method=POST}
2024-03-12 01:21:12.174 DEBUG 7104 --- [ctor-http-nio-1] r.n.r.DefaultPooledConnectionProvider : [c5448fc1-2, L:/Local IP:54766 - R:Remote IP:9480] onStateChange(POST{uri=/v1/wallet/qr/payment/auth, connection=PooledConnection{channel=[id: 0xc5448fc1, L:/Local IP:54766 - R:Remote IP:9480]}}, [request_prepared])
2024-03-12 01:21:12.174 DEBUG 7104 --- [tor-http-nio-13] reactor.netty.channel.FluxReceive : [5b39460c-1, L:/Local IP:8058 - R:/10.216.130.23:14454] [terminated=true, cancelled=false, pending=1, error=null]: subscribing inbound receiver
2024-03-12 01:21:12.174 DEBUG 7104 --- [ctor-http-nio-1] r.n.r.DefaultPooledConnectionProvider : [c5448fc1-2, L:/Local IP:54766 - R:Remote IP:9480] onStateChange(POST{uri=/v1/wallet/qr/payment/auth, connection=PooledConnection{channel=[id: 0xc5448fc1, L:/Local IP:54766 - R:Remote IP:9480]}}, [request_sent])
2024-03-12 01:21:21.940 DEBUG 7104 --- [tor-http-nio-14] reactor.netty.tcp.SslProvider : [0510b3b7, L:/Local IP:8058 - R:/10.216.130.22:55058] SSL enabled using engine 410137f5[SSLEngine[hostname=null port=-1] SSL_NULL_WITH_NULL_NULL]
2024-03-12 01:21:21.940 DEBUG 7104 --- [tor-http-nio-14] r.n.http.server.HttpServerOperations : [0510b3b7, L:/Local IP:8058 - R:/10.216.130.22:55058] New http connection, requesting read
2024-03-12 01:21:21.940 DEBUG 7104 --- [tor-http-nio-14] reactor.netty.transport.TransportConfig : [0510b3b7, L:/Local IP:8058 - R:/10.216.130.22:55058] Initialized pipeline DefaultChannelPipeline{(reactor.left.sslHandler = io.netty.handler.ssl.SslHandler), (reactor.left.sslReader = reactor.netty.tcp.SslProvider$SslReadHandler), (reactor.left.httpCodec = io.netty.handler.codec.http.HttpServerCodec), (reactor.left.httpTrafficHandler = reactor.netty.http.server.HttpTrafficHandler), (reactor.right.reactiveBridge = reactor.netty.channel.ChannelOperationsHandler)}
2024-03-12 01:21:21.940 DEBUG 7104 --- [tor-http-nio-14] r.n.http.server.HttpServerOperations : [0510b3b7, L:/Local IP:8058 - R:/10.216.130.22:55058] Increasing pending responses, now 1
2024-03-12 01:21:21.940 DEBUG 7104 --- [tor-http-nio-14] reactor.netty.http.server.HttpServer : [0510b3b7-1, L:/Local IP:8058 - R:/10.216.130.22:55058] Handler is being applied: org.springframework.http.server.reactive.ReactorHttpHandlerAdapter@2bd948e4
2024-03-12 01:21:21.940 DEBUG 7104 --- [tor-http-nio-14] o.s.w.s.adapter.HttpWebHandlerAdapter : [0510b3b7-2531] HTTP GET "/"
2024-03-12 01:21:21.940 DEBUG 7104 --- [tor-http-nio-14] o.s.w.r.handler.SimpleUrlHandlerMapping : [0510b3b7-2531] Mapped to ResourceWebHandler [classpath [META-INF/resources/], classpath [resources/], classpath [static/], classpath [public/]]
2024-03-12 01:21:21.940 DEBUG 7104 --- [tor-http-nio-14] o.s.w.r.resource.ResourceWebHandler : [0510b3b7-2531] Resource not found
2024-03-12 01:21:21.940 DEBUG 7104 --- [tor-http-nio-14] org.springframework.web.HttpLogging : [0510b3b7-2531] Resolved [ResponseStatusException: 404 NOT_FOUND] for HTTP GET /
2024-03-12 01:21:21.940 DEBUG 7104 --- [tor-http-nio-14] org.springframework.web.HttpLogging : [0510b3b7-2531] Encoding [{timestamp=Tue Mar 12 01:21:21 GST 2024, path=/, status=404, error=Not Found, message=null, requestI (truncated)...]
2024-03-12 01:21:21.940 DEBUG 7104 --- [tor-http-nio-14] r.n.http.server.HttpServerOperations : [0510b3b7-1, L:/Local IP:8058 - R:/10.216.130.22:55058] Detected non persistent http connection, preparing to close
2024-03-12 01:21:21.940 DEBUG 7104 --- [tor-http-nio-14] r.n.http.server.HttpServerOperations : [0510b3b7-1, L:/Local IP:8058 - R:/10.216.130.22:55058] Last HTTP packet was sent, terminating the channel
2024-03-12 01:21:21.940 DEBUG 7104 --- [tor-http-nio-14] reactor.netty.channel.ChannelOperations : [0510b3b7-1, L:/Local IP:8058 - R:/10.216.130.22:55058] [HttpServer] Channel inbound receiver cancelled (operation cancelled).
2024-03-12 01:21:21.940 DEBUG 7104 --- [tor-http-nio-14] o.s.w.s.adapter.HttpWebHandlerAdapter : [0510b3b7-2531] Completed 404 NOT_FOUND
2024-03-12 01:21:31.128 WARN 7104 --- [ctor-http-nio-1] r.netty.http.client.HttpClientConnect : [c5448fc1-2, L:/Local IP:54766 - R:Remote IP:9480] The connection observed an error



Подробнее здесь: https://stackoverflow.com/questions/781 ... tream-apis
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «JAVA»