일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- mysql 5.5
- spring
- Effective Java 3/e
- log4j2
- REACTJS
- regex
- 퀵소트
- Chunk
- MySQL
- nodejs
- eslint
- JavaScript
- migration
- Express
- spring cloud
- Regular expression
- Webpack
- expire_logs_days
- upgrade
- REACT
- git
- Node
- Spring Batch
- Effective Java
- java
- 정규표현식
- log_bin
- update
- current_date
- npm
- Today
- Total
내 세상
[React] Browser HTTP connetions in Node.js 본문
Browser 별로 fetch/Ajax 요청에 대한 Connection 제한이 있다. 이러한 이슈는 SPA 형태의 앱에서 문제를 일으킨다.
(크롬 기준) 최대 6개의 API만 연결이 되기 때문에 10개의 API를 요청했을 때, 6개의 API를 먼저 처리하고 남은 4개의 API를 처리한다.
여기서 문제가 발생하는 부분은 먼저 요청한 6개의 API가 응답이 없을 때, 무작정 Max Time out (정확히 어디서 설정하는지 현재 확인 중/크롬 기준 default 120초로 추정/20.05.14)을 대기한다. 그런 다음, 남은 4개의 API 요청이 처리된다.
- IE 7: 2 connections
- IE 8 & 9: 6 connections
- IE 10: 8 connections
- IE 11: 13 connections
- Firefox, Chrome (Mobile and Desktop), Safari (Mobile and Desktop), Opera: 6 connections
해결책
이러한 Request Connection Limit 이슈를 해결하기 위해 비동기로 동작하는 Message Queue(ex. kafka..)를 사용할 때, consumer나 producer를 한 다음 반드시 response를 날려줘야 한다.
해당 이슈에 대한 다른 사람들의 의견이 있는 주소
내가 fetch API를 쓰지 못했던 이유
fetch API 는 완벽한가?
medium.com
- https://blog.fullstacktraining.com/concurrent-http-connections-in-node-js/
Concurrent HTTP connections in Node.js
Browsers, as well as Node.js, have limitations on concurrent HTTP connections. It is essential to understand these limitations because we can run into undesired situations whereby an application would function incorrectly. In this article, we will review e
blog.fullstacktraining.com
'Technical > React' 카테고리의 다른 글
[React] react-contextmenu에서 react-contexify로 변경한 이유 (0) | 2021.04.21 |
---|---|
[React] React Component/JSX Element to Html (0) | 2021.02.04 |
[React] Dialog 위 Component Focus Setting (0) | 2020.06.09 |
[React] Class Component / Function Component / Arrow Function (0) | 2020.05.11 |
[React] JSX / const, let, var (0) | 2020.05.11 |