본문 바로가기

반응형

Apache

C276x260 RPS(Requests Per Second) RPS(Requests Per Second) - 초당 요청 수Request Per Second(RPS)는 서버가 1초 동안 처리한 HTTP 요청의 개수를 의미하는 지표입니다. 이는 웹 서버, API 서버 등의 처리 성능을 측정하고 트래픽 부하를 평가하는 데 매우 유용한 지표입니다.정의RPS = 특정 시간 동안의 총 요청 수 ÷ 초 단위 시간예를 들어, 1초 동안 1,000개의 요청을 처리했다면 해당 서버의 RPS는 1,000입니다.이는 해당 웹 서버가 초당 1,000건의 요청을 처리할 수 있는 처리 능력을 가지고 있음을 의미합니다.RPS가 중요한 이유서비스의 성능 모니터링 및 병목 구간 파악부하 분산, 스케일 업/아웃 기준 설정서버 리소스의 최적화 지표실시간 트래픽 변화 감지 및 대응RPS 분석(NGIN.. 더보기
C276x260 ab(Apache Bench) tools 에러 ab(Apache Bench) tools 에러ab 명령어Usageab [options] [http[s]://]hostname[:port]/pathOptions are: -n requests Number of requests to perform (= 요청수)-c concurrency Number of multiple requests to make at a time (=동시 요청수(사용자))-t timelimit Seconds to max. to spend on benchmarking This implies -n 50000 -s timeout Seconds to max. wait for each response Default is 30 secondsab 에러ab -c 10000 -n 1000 http://l.. 더보기
C276x260 apache, php 메모리 모니터링 명령어 apache, php 메모리 모니터링 명령어apache 모니터링아파치 메모리 사용량ps -ylC httpd | awk '{x += $8;y += 1} END {print "Memory Usage (MB): "x/1024; print "Average Proccess Size (MB): "x/((y-1)*1024)}'$ ps -ylC httpd | awk '{x += $8;y += 1} END {print "Memory Usage (MB): "x/1024; print "Average Proccess Size (MB): "x/((y-1)*1024)}'Memory Usage (MB): 1618.67Average Proccess Size (MB): 323.734아파치 프로세스 개수$ ps -ef | grep ht.. 더보기
C276x260 Apache 로그 파일을 로테이션 설정 AApache 로그 파일을 로테이션(logrotate) 설정Logrotate는 리눅스 시스템에서 로그 파일을 관리하는 유틸리티입니다. 주된 목적은 로그 파일의 크기를 제한하거나 일정 기간 이상 된 로그를 삭제하고 새로운 로그 파일을 생성하여 시스템 로그가 지속적으로 용량을 차지하지 않도록 하는 것입니다. 기본적으로 로그 파일이 계속 커지면 디스크 공간이 부족해질 수 있으며 이는 시스템의 성능에도 영향을 미칠 수 있습니다. Logrotate는 이러한 문제를 해결하여 로그 관리를 보다 효율적으로 만듭니다. 일반적으로 logrotate는 cron 작업으로 실행되어 로그 파일을 주기적으로 관리합니다. 주요 설정 파일은 /etc/logrotate.conf이며 추가로 /etc/logrotate.d/ 디렉토리에 있는.. 더보기
C276x260 아파치 웹 서버에서 IP로 접속을 차단하는 방법 아파치 웹 서버에서 IP로 접속을 차단하는 방법아파치에서 IP로 접속을 차단하는 몇 가지 방법입니다.1 .htaccess 파일을 사용하여 IP 차단웹 서버의 루트 디렉토리 또는 해당 디렉토리에 .htaccess 파일을 생성합니다.다음과 같은 내용을 .htaccess 파일에 추가하여 특정 IP 주소 또는 IP 대역을 차단합니다.order allow,denydeny from 192.168.0.1deny from 10.0.0.0/24allow from all2 httpd.conf 또는 apache2.conf 파일을 사용하여 IP 차단웹 서버의 httpd.conf 또는 apache2.conf 파일을 엽니다.다음과 같은 내용을 파일에 추가하여 특정 IP 주소 또는 IP 대역을 차단합니다. Order allo.. 더보기
C276x260 아파치 디폴트 페이지(apache default page) 편집 아파치 디폴트 페이지(apache default page) 편집아파치 패키지 설치dnf install -y httpd아파치 버전 정보$ httpd -vServer version: Apache/2.4.37 (centos)Server built: Sep 15 2020 15:41:16welcome(welcome.conf) 페이지 편집vim /etc/httpd/conf.d/welcome.conf Options -Indexes #ErrorDocument 403 /noindex/index.html ErrorDocument 403 http://www.sangchul.kr/40x.htmlAlias /noindex /usr/share/httpd/noindex Options MultiViews Director.. 더보기
C276x260 Apache에서 http를 https(SSL)로 리다이렉트하는 방법 Apache에서 http를 https(SSL)로 리다이렉트하는 방법rewrite 모듈 활성화LoadModule rewrite_module modules/mod_rewrite.sovim httpd.confLoadModule rewrite_module modules/mod_rewrite.so모듈 확인httpd -Mhttpd -M | egrep -i rewrite rewrite_module (shared)가상호스트 설정httpd-vhosts.conf 편집RewriteEngine on RewriteCond %{HTTPS} off RewriteRule ^.*$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]vim httpd-vhosts.conf ServerAdmin webma.. 더보기
C276x260 Apache 다운로드 대역폭 속도 제한 Apache 다운로드 대역폭 속도 제한httpd.conf 편집(mod_ratelimit 모듈 활성화)vim /usr/local/apache2/conf/httpd.conf...#LoadModule data_module modules/mod_data.soLoadModule ratelimit_module modules/mod_ratelimit.soLoadModule reqtimeout_module modules/mod_reqtimeout.so#LoadModule ext_filter_module modules/mod_ext_filter.so...configuration 편집vim /usr/local/apache2/conf/extra/httpd-vhosts.conf... ServerAdmin webmaste.. 더보기

728x90
반응형