본문 바로가기
SW/Apache

httpd.conf 옵션

by bigju 2021. 10. 10.
반응형

 

-Timeout

​

지정한 시간동안 클라이언트가 응답이 없을 경우, 세션을 끊어 버립니다.

​

Timeout 60

​


-KeepAlive

​

지속적인 연결을 허용 여부를 설정합니다. 비활성화하려면 Off 를 입력하면 됩니다.

​

KeepAlive On


-MaxKeepAliveRequests

​

허용할 최대 요청 수를 지정합니다. 최상의 성능을 위해서는 수치를 높게 설정하는 것을 권장합니다.

​

무제한으로 설정하려면 0 으로 설정하면 됩니다.

​

MaxKeepAliveRequests 100


-KeepAliveTimeout

​

동일한 연결에서 동일한 클라이언트의 다음 요청을 대기하는 시간입니다.

​

응답이 없을 경우 서버가 클라이언트의 접속을 끊습니다.

​

KeepAliveTimeout 5


<Apache 동시접속자 확인하기>

​

-> 아파치 서버가 현재 처리 중인 소켓 연결 개수를 확인할 수 있으며

​

설정한 MaxClients 수를 넘지 않도록 유의해야 합니다.

​

# netstat -nltp |grep :80.*ESTABLISHED | wc -l

​

-> 하드웨어 자원을 고려한 가용 동시연결수 계산 = 여유 메모리 / 1연결당 메모리

​

2000MB free memory, 1연결당 20MB 를 사용 = 100개의 동시연결 가능. (300~500 동시접속자 처리가능)

​

1-3 ) 벤치마킹 테스트

​

<웹서버 벤치마킹 도구(ab) 사용하여 테스트>

​

# ab -n 3000 -c 300 http://localhost/

​

-n은 요청수를, -c 는 동시요청수를 나타낸다.

​

300명의 사용자가 10번씩 총 3000번 요청하는 것입니다.

​

사이트 주소의 끝에 / (슬래시)를 붙여야 합니다.

​

많이 쓰이는 옵션

​

Server Software : 아파치 버전을 표시

​

Server Hostname : 특정사이트의 이름

​

Server Port : 웹서비스 사용 포트 번호

​

Document Path : 초기 문서가 존재하는 웹문서 root위치

​

Time taken for tests : 응답시간(매우 중요한 결과 값)

​

Document Length : 초기문서의 크기

​

Complete requests : 요구에 응답완료한 세션 수

​

Failed requests : 요구에 응답실패한 세션 수

​

Broken pipe errors : 실패한 에러 수

​

Total transferred : 총 전송 바이트 수

​

HTTP transferred : 총 전송한 HTML 바이트 수

​

Requests per second : 초당 응답 요구 수

​

Time per request : 요구에 응답한 시간(단위 micro second, 중요한 결과값)

​

Time per request : 요구에 응답한 시간

​

Transfer rate : 초당 전송 가능한 용량

​

<prefork 방식>

​

Benchmarking localhost (be patient)

​

Server Software: Apache/2.4.27

​

Server Hostname: localhost

​

Server Port: 80

​

Document Path: /

​

Document Length: 45 bytes

​

Concurrency Level: 300

​

Time taken for tests: 9.534 seconds

​

Complete requests: 3000

​

Failed requests: 0

​

Total transferred: 909000 bytes

​

HTML transferred: 135000 bytes

​

Requests per second: 314.68 [#/sec] (mean)

​

Time per request: 953.353 [ms] (mean)

​

Time per request: 3.178 [ms] (mean, across all concurrent requests)

​

Transfer rate: 93.11 [Kbytes/sec] received

​

Connection Times (ms)

​

min mean[+/-sd] median max

​

Connect: 0 1 1.8 0 9

​

Processing: 1 260 1218.8 17 9522

​

Waiting: 1 260 1218.8 17 9522

​

Total: 5 261 1219.7 17 9526

​

Percentage of the requests served within a certain time (ms)

​

50% 17

​

66% 18

​

75% 18

​

80% 18

​

90% 20

​

95% 225

​

98% 3328

​

99% 9523

​

100% 9526 (longest request)

​

<worker 방식>

​

Benchmarking localhost (be patient)

​

Server Software: Apache/2.4.27

​

Server Hostname: localhost

​

Server Port: 80

​

Document Path: /

​

Document Length: 45 bytes

​

Concurrency Level: 300

​

Time taken for tests: 0.592 seconds

​

Complete requests: 3000

​

Failed requests: 0

​

Total transferred: 867000 bytes

​

HTML transferred: 135000 bytes

​

Requests per second: 5069.15 [#/sec] (mean)

​

Time per request: 59.181 [ms] (mean)

​

Time per request: 0.197 [ms] (mean, across all concurrent requests)

​

Transfer rate: 1430.65 [Kbytes/sec] received

​

Connection Times (ms)

​

min mean[+/-sd] median max

​

Connect: 0 2 2.1 1 10

​

Processing: 2 27 71.8 13 578

​

Waiting: 0 26 71.7 12 578

​

Total: 7 29 72.5 14 585

​

Percentage of the requests served within a certain time (ms)

​

50% 14

​

66% 16

​

75% 17

​

80% 18

​

90% 24

​

95% 32

​

98% 222

​

99% 584

​

100% 585 (longest request)

​

1-4) 아파치 메모리 사용량 측정

​

-> 전체 메모리 사용량을 아파치 프로세스 개수로 나누어 계산

​

# ps aux | grep apache | awk ‘{print $6}’ | awk ‘{total = total + $1 } END {print total/1024}’

​

<prefork>

​

# ps aux | grep apache | awk ‘{print $6}’ | awk ‘{total = total + $1 } END {print total/1024}’

​

25.4727

​

<worker>

​

# ps aux | grep apache | awk ‘{print $6}’ | awk ‘{total = total + $1 } END {print total/1024}’

​

16.2109

​

<event>

​

# ps aux | grep apache | awk ‘{print $6}’ | awk ‘{total = total + $1 } END {print total/1024}’

​

15.3633

 

BigJu
반응형

댓글

메인으로가기


    

Big Ju

IT Engineer


항상 답을 위해 노력하는

엔지니어입니다.

 

 

    


 UP!