기존 8G 메모리, 1T 하드디스크로 서버가 구성되었다고 한다면 메모리: 8G-> 16G, 하드디스크 1T-> 10T 로 하드웨어 사양을 업그레이드 하는것을 스케일 업이라고하며 ,서버의 사양을 높이는 것이기 때문에 수직 스케일링(vertical scaling) 이라고도 한다.
scale-up
스케일 아웃(Scale-Out) ?
서버의 자원 사용량이 부족하여 비슷한 사양의 서버를 추가하는 작업을 말한다.
하나의 장비에서 서비스를 처리함에 있어 한계에 부딪힐 경우 비슷한 스펙의 서버를 추가함으로 서버의 부하를 분산하는데 목적이 있다.
scale-out
스케일 인(Scale-In) ?
스케일 아웃과 반대되는 개념으로서 스케일 인 작업은 서버 용량 부족으로 늘렸던 자원을 다시 회수 하는 작업을 의미한다. 서비스 사용량이 줄어 늘려놓았던 불필요한 서버 자원을 해제 하는 작업을 의미한다.
scale-in
오토스케일(Auto-Scale)?
서비스 사용량에 따라서 스케일 인/ 스케일 아웃 작업을 알아서 자동으로 해주는 작업을 말합니다.
root@ubuntu2004:~# tail -f /var/log/gitlab/gitlab-rails/production.log Completed 200 OK in 34ms (Views: 0.5ms | ActiveRecord: 0.0ms | Elasticsearch: 0.0ms | Allocations: 814) Started GET "/api/v4/geo/proxy" for 127.0.0.1 at 2022-04-16 12:36:37 +0900 Started GET "/-/metrics" for 127.0.0.1 at 2022-04-16 12:36:44 +0900 Processing by MetricsController#index as HTML Completed 200 OK in 33ms (Views: 0.4ms | ActiveRecord: 0.0ms | Elasticsearch: 0.0ms | Allocations: 814) Started GET "/api/v4/geo/proxy" for 127.0.0.1 at 2022-04-16 12:36:47 +0900 Started GET "/api/v4/geo/proxy" for 127.0.0.1 at 2022-04-16 12:36:57 +0900 Started GET "/-/metrics" for 127.0.0.1 at 2022-04-16 12:36:59 +0900 Processing by MetricsController#index as HTML Completed 200 OK in 32ms (Views: 0.4ms | ActiveRecord: 0.0ms | Elasticsearch: 0.0ms | Allocations: 814) Started GET "/api/v4/geo/proxy" for 127.0.0.1 at 2022-04-16 12:37:07 +0900 Started GET "/-/metrics" for 127.0.0.1 at 2022-04-16 12:37:14 +0900 Processing by MetricsController#index as HTML Completed 200 OK in 36ms (Views: 0.5ms | ActiveRecord: 0.0ms | Elasticsearch: 0.0ms | Allocations: 814)
gitlab 서비스 로그 확인
gitlab-ctl tail 명령을 통해 gitlab 서버에서 남기는 각종 로그를 확인할수 있습니다.
STS 란 Spring Tool Suit 약어 이며 , Spring FrameWork 을 지원하기 위해 최적화 된 IDE 개발 툴입니다. 기존에 이클립스(Eclipse) 기반 환경에서 웹서비스를 개발 하기 위해서는 개발에 필요한 여러가지 필수 플러그인을 별도로 설치해야 했습니다. STS 는 Eclipse 환경에서는 기본 설치 되지 않은 내장 톰켓 서버나 , 빌드툴( gradle,maven) ,git 등이 기본으로 플러그인에 포함되어있어 보다 쉽고 간편하게 웹서비스를 개발 할수 있도록 도와주는 고마운 툴입니다.
STS 다운로드
필자는 우분투 환경이라 리눅스 버전을 다운로드 받아 설치 하는 방법에 대해 소개 하겠습니다.
spring.io 사이트에서 리눅스 버전을 다운로드 받습니다.
다운로드 받은 파일을 압축 해제 합니다.
tar xvzf spring-tool-suite-4-4.14.0.RELEASE-e4.23.0-linux.gtk.x86_64.tar.gz
dev@ubuntu2004:~/STS/sts-4.14.0.RELEASE$ ll 합계 1328 drwxr-xr-x 9 dev dev 4096 3월 14 01:20 ./ drwxrwxr-x 3 dev dev 4096 4월 16 22:32 ../ -rw-r--r-- 1 dev dev 61 3월 9 01:22 .eclipseproduct drwxr-xr-x 2 dev dev 4096 3월 14 01:18 META-INF/ -rwxr-xr-x 1 dev dev 86328 3월 14 01:16 SpringToolSuite4* -rw-r--r-- 1 dev dev 681 3월 14 01:20 SpringToolSuite4.ini -rw-r--r-- 1 dev dev 160278 3월 14 01:20 artifacts.xml drwxr-xr-x 5 dev dev 4096 3월 14 01:18 configuration/ drwxr-xr-x 2 dev dev 4096 3월 14 01:18 dropins/ drwxr-xr-x 72 dev dev 12288 3월 14 01:20 features/ -rwxr-xr-x 1 dev dev 136129 3월 14 01:16 icon.xpm* -rw-r--r-- 1 dev dev 11522 3월 14 01:12 license.txt -rw-r--r-- 1 dev dev 845709 3월 14 01:20 open-source-licenses.txt drwxr-xr-x 5 dev dev 4096 3월 14 01:19 p2/ drwxr-xr-x 24 dev dev 53248 3월 14 01:20 plugins/ drwxr-xr-x 2 dev dev 4096 3월 14 01:18 readme/
jmeter@ubuntu2004:~$ java -version openjdk version "1.8.0_312" OpenJDK Runtime Environment (build 1.8.0_312-8u312-b07-0ubuntu1~20.04-b07) OpenJDK 64-Bit Server VM (build 25.312-b07, mixed mode) jmeter@ubuntu2004:~$ javac -version javac 1.8.0_312
JMeter 실행
다운로드 바이너리 바일 압축 해제
jemeter.sh 실행
jmeter@ubuntu2004:~$ tar xvzf apache-jmeter-5.4.3.tgz jmeter@ubuntu2004:~$ cd apache-jmeter-5.4.3/bin jmeter@ubuntu2004:~/apache-jmeter-5.4.3/bin$ sh jmeter.sh
JMeter 부하 테스트
JDBC 로 오라클 Database 접속 하여 DML 부하 테스트 하는 방법에 대해 알아보겠습니다.
Thread Group 생성
File ->New 버튼을 눌러 테스트 계획을 만듭니다.
Test Plan 우클릭 버튼을 눌러 쓰레드 그룹을 만듭니다.
Jdbc Connection Configuration 생성
설정 내용
Name :커넥션 명을 작성 한다.
Variable Name for create pool : 실제 테스트시 사용할 Connection pool 명이다 .
Database URL : 오라클 접속 URL jdbc:oracle:thin:@116.121.154.196:1521:ORCLCDB
JDBC Driver Class :오라클 jdbc 드라이버 클래스 명을 선택 한다.
UserName : 접속할 테스트 계정이다 .
Password :접속할 테스트 계정의 비밀번호 이다.
테스트 결과 Report 생성
Test Plan ->Add ->Listener 선택후 확인하고자 하는 결과 리포팅 추가 작업
pip list 명령을 통해 설치된 버전 확인 (pip 를 통해 파이썬에서 필요로 하는 팩키지를 설치할수 있습니다.)
(py27) [testuser1@centos7:/home/testuser1/venv]$ python -V Python 2.7.5 (py27) [testuser1@centos7:/home/testuser1/venv]$ pip --version pip 20.3.4 from /home/testuser1/venv/py27/lib/python2.7/site-packages/pip (python 2.7) (py27) [testuser1@centos7:/home/testuser1/venv]$ pip list DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality. Package Version ---------- ------- pip 20.3.4 setuptools 44.1.1 wheel 0.37.1