Мы настроили 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
Spring Cloud Gateway имеет задержку при отправке запросов к нижестоящим API ⇐ JAVA
Программисты JAVA общаются здесь
1710664949
Гость
Мы настроили 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
Подробнее здесь: [url]https://stackoverflow.com/questions/78174555/spring-cloud-gateway-has-delay-in-sending-requests-to-downstream-apis[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия