Skip to content

Commit ffb2ce2

Browse files
committed
http linux 관련 정보 추가
1 parent e84b6e9 commit ffb2ce2

3 files changed

Lines changed: 86 additions & 5 deletions

File tree

‎_wiki/Http.md‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
layout : wiki
3+
title : Http
4+
summary : Http 에 대한 정보를 정리
5+
date : 2019-05-20 01:49:12 +0900
6+
updated : 2019-05-20 02:13:27 +0900
7+
tags : http
8+
toc : true
9+
public : true
10+
parent : Web
11+
latex : false
12+
adsense : true
13+
---
14+
* TOC
15+
{:toc}
16+
17+
## HTTP 연결 이해를 돕기 위한 내용들
18+
19+
* 성능 관련 중요 요소
20+
* TCP 커텍션의 핸드세이크 설정
21+
* 인터넷의 혼자을 제어하기 위한 TCP의 느린시작(slow-start)
22+
* 데이터를 한데 모아 한 번에 전송하기 위한 네이블(nagle) 알고리즘
23+
* TCP 의 편승(piggyback) 확인응답(acknowledgment)을 위한 확인응답 지연 알고리즘
24+
* TIME_WAIT 지연과 포트 고갈
25+
26+
### TCP Connection HandShake
27+
28+
* 3 WAY Handshake
29+
* Client 는 `SYN` 라는 작은 패킷을 서버에게 보낸다.
30+
* 서버는 그에 대한 응답으로 `SYN` + `ACK` 패킷을 보낸다.
31+
* Client 는 최종적으로 연결되었음을 알리는 `ACK` 를 보내는데 이때 데이터를 같이 보낼수도 있다.
32+
33+
34+
### Keep-Alive
35+
36+
* 해당 optioan 을 끈다면, client 에서 매번 연결하는 연결 비용이 발생해서 성능에 좋지 않는 영향을 미칠 수 있다.
37+
* 보통은 키고 있는데 성능에 좋다.
38+
* API 서버의 경우, 보통 출발지가 고정되어 있기 때문에 설정하는게 초고 timeout 설정은 10s 정도가 적당함
39+
40+
41+
### 참고자료
42+
43+
* [CLOSE_WAIT & TIME_WAIT 최종 분석](http://tech.kakao.com/2016/04/21/closewait-timewait/)
44+
* [HTTP 완벽 가이드](http://www.kyobobook.co.kr/product/detailViewKor.laf?ejkGb=KOR&mallGb=KOR&barcode=9788966261208&orderClick=LEA&Kc=)
45+
* [권남님의 wiki - web performance][http://kwonnam.pe.kr/wiki/web/performance]

‎_wiki/Linux.md‎

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,58 @@
1-
[[---]]
1+
---
22
layout : wiki
33
title : Linux
44
summary : linux 활용에 관한 모든것
55
date : 2018-08-21 18:28:36 +0900
6-
updated : 2018-09-11 09:37:38 +0900
6+
updated : 2019-05-20 02:04:33 +0900
77
tags : linux
88
toc : true
99
public : true
1010
parent : DevOps
1111
latex : false
12+
adsense : true
1213
---
1314

14-
# Linux 활용
15+
## Linux 활용
16+
17+
### Linux Kernal Parameter
18+
19+
* 아래 설정에 하나하나 알아갈때마다 의미를 채워보자
20+
21+
```
22+
vm.swappiness = 0 # swap memory 를 이용하지 않음.
23+
24+
net.core.somaxconn = 1000
25+
net.core.netdev_max_backlog = 5000
26+
net.core.rmem_max = 16777216
27+
net.core.wmem_max = 16777216
28+
29+
net.ipv4.tcp_wmem = 4096 12582912 16777216
30+
net.ipv4.tcp_rmem = 4096 12582912 16777216
31+
net.ipv4.tcp_max_syn_backlog = 8096
32+
net.ipv4.tcp_slow_start_after_idle = 0
33+
net.ipv4.tcp_tw_reuse = 1 # TIME_WAIT local socket 재사용
34+
net.ipv4.ip_local_port_range = 10240 65535 # local port 범위 조정
35+
```
36+
37+
* 주의사항
38+
* swap 메모리를 사용하지 않는다면, applicaiton 이 시스템 메모리를 80% 이상 점유하지 않도록 하자.
39+
* [[번역] Linux에서 메모리를 다 써버렸을 때 일어나는 일](https://medium.com/@EJSohn/%EB%B2%88%EC%97%AD-linux%EC%97%90%EC%84%9C-%EB%A9%94%EB%AA%A8%EB%A6%AC%EB%A5%BC-%EB%8B%A4-%EC%8D%A8%EB%B2%84%EB%A0%B8%EC%9D%84-%EB%95%8C-%EC%9D%BC%EC%96%B4%EB%82%98%EB%8A%94-%EC%9D%BC-9dadba29c89c?fbclid=IwAR1RSqZZReZdsexmbhRvf_bjMqyP8Sz-z7NhOd0Q9cXGqo1zvQf6Bf99mAY)
40+
41+
### 자주쓰는 문법
1542

1643

17-
* 자주쓰는 문법
1844
```
1945
grep -rn "찾고자 하는 문자열" *
2046
```
47+
48+
* while 문으로 주기적인 실행
49+
50+
```
51+
while true ; do echo -n "$(date) " ; ss -s | grep timewait ; sleep 1 ; done
52+
```
53+
54+
### Linux Utils
55+
2156
* logrotate : log rolling 설정을 해주는 linux util
2257
* [logroate 설정방법](https://www.manualfactory.net/10547)
2358
* supervisor : process 관리 해주는 도구

‎_wiki/index.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout : wiki
33
title : index
44
summary : anyjava wiki index
55
date : 2018-08-15 19:41:36 +0900
6-
updated : 2019-04-24 08:52:39 +0900
6+
updated : 2019-05-20 01:49:12 +0900
77
tags :
88
toc : true
99
public : true
@@ -41,6 +41,7 @@ latex : false
4141
* [[성능튜닝]]
4242
* [[Jvm]]
4343
* [[Web]]
44+
* [[Http]]
4445
* [[SecureCoding]]
4546
* [[CORS (Cross Origin Resource Sharing)]]
4647
* [[XSS]]

0 commit comments

Comments
 (0)