Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

백엔드 TPS 관련 로그 #596

Open
Minjoo522 opened this issue Oct 4, 2024 · 23 comments
Open

백엔드 TPS 관련 로그 #596

Minjoo522 opened this issue Oct 4, 2024 · 23 comments
Assignees
Labels
📋 문서 문서 작업 🚛 백엔드 백엔드 관련 이슈 🤔 백로그 논의가 필요한 사항

Comments

@Minjoo522
Copy link
Contributor

Minjoo522 commented Oct 4, 2024

논의가 필요한 내용

백엔드 TPS 관련 논의 사항 업로드
작업 현황 기록용

@Minjoo522 Minjoo522 added 🚛 백엔드 백엔드 관련 이슈 📋 문서 문서 작업 🤔 백로그 논의가 필요한 사항 labels Oct 4, 2024
@Minjoo522
Copy link
Contributor Author

10월 4일(금)

성능 테스트 도구 선정

  • nGrinder
    런칭 전 테스트가 필요하지만 런칭이 얼마 남지 않았기 때문에 최대한 러닝 커브가 적으면서도 가독성이 좋은 서비스가 필요했다. nGrinder는 국내 기업인 네이버에서 운영하고 있어 한국어를 공식적으로 지원한다. 자바와 비슷한 스크립트 언어를 사용하기 때문에 스크립트 언어에 대한 추가적인 학습에 대한 부담이 적고 완성도 높은 뼈대 코드를 기본적으로 제공한다. 게다가 가독성 좋은 GUI를 탑재하고 있기 때문에 nGrinder로 선정했다.
  • https://naver.github.io/ngrinder/
  • https://github.com/naver/ngrinder/wiki/User-Guide

@Minjoo522
Copy link
Contributor Author

Minjoo522 commented Oct 7, 2024

스크립트

import static net.grinder.script.Grinder.grinder
import static org.junit.Assert.*
import static org.hamcrest.Matchers.*
import net.grinder.script.GTest
import net.grinder.script.Grinder
import net.grinder.scriptengine.groovy.junit.GrinderRunner
import net.grinder.scriptengine.groovy.junit.annotation.BeforeProcess
import net.grinder.scriptengine.groovy.junit.annotation.BeforeThread
// import static net.grinder.util.GrinderUtils.* // You can use this if you're using nGrinder after 3.2.3
import org.junit.Before
import org.junit.BeforeClass
import org.junit.Test
import org.junit.runner.RunWith
import org.ngrinder.http.HTTPRequest
import org.ngrinder.http.HTTPRequestControl
import org.ngrinder.http.HTTPResponse
import org.ngrinder.http.cookie.Cookie
import org.ngrinder.http.cookie.CookieManager
/**
* A simple example using the HTTP plugin that shows the retrieval of a single page via HTTP.
*
* This script is automatically generated by ngrinder.
*
* @author admin
*/
@RunWith(GrinderRunner)
class TestRunner {
	public static GTest test
	public static HTTPRequest request
	public static Map<String, String> headers = [:]
	public static Map<String, Object> params = [:]
	public static List<Cookie> cookies = []
	@BeforeProcess
	public static void beforeProcess() {
		HTTPRequestControl.setConnectionTimeout(300000)
		test = new GTest(1, "[dev.api.devel-up.co.kr](http://dev.api.devel-up.co.kr/)")
		request = new HTTPRequest()
		[grinder.logger.info](http://grinder.logger.info/)("before process.")
	}
	@BeforeThread
	public void beforeThread() {
		test.record(this, "test")
		grinder.statistics.delayReports = true
		[grinder.logger.info](http://grinder.logger.info/)("before thread.")
	}
	@Before
	public void before() {
		request.setHeaders(headers)
		CookieManager.addCookies(cookies)
		[grinder.logger.info](http://grinder.logger.info/)("before. init headers and cookies")
	}
	@Test
	public void test() {
		long beforeTime = System.currentTimeMillis()
		HTTPResponse response = request.GET("https://dev.api.devel-up.co.kr/solutions", params)
		long afterTime = System.currentTimeMillis()
		long secDiffTime = (afterTime - beforeTime) / 1000
		
		if (response.statusCode == 301 || response.statusCode == 302) {
			grinder.logger.warn("Warning. The response may not be correct. The response code was {}.", response.statusCode)
		} else {
				assertThat(response.statusCode, is(200))
				assertThat((int) secDiffTime, lessThanOrEqualTo(1000))
		}
	}
}

@Minjoo522
Copy link
Contributor Author

image

@Minjoo522
Copy link
Contributor Author

image

@Minjoo522
Copy link
Contributor Author

Minjoo522 commented Oct 7, 2024

개발서버 - 분석 2

image
image
ㅎㅇ.csv

총 Vuser가 500일 때
TPS : 평균 300.2

@Minjoo522
Copy link
Contributor Author

image

평균 TPS : 336.7142857143

@Minjoo522
Copy link
Contributor Author

Minjoo522 commented Oct 16, 2024

image
최대 -> 평균

@Minjoo522
Copy link
Contributor Author

image

  • 페이지네이션 도입 후

@Minjoo522
Copy link
Contributor Author

image

  • 히카리 커넥션 풀 : 5

@Minjoo522
Copy link
Contributor Author

image

  • 히카리 커넥션 풀 : 50

@Minjoo522
Copy link
Contributor Author

image

  • 히카리 커넥션 풀 : 5
  • 스레드 풀 : 100

@Minjoo522
Copy link
Contributor Author

image

  • 히카리 커넥션 풀 : 5
  • 스레드 풀 : 50

@Minjoo522
Copy link
Contributor Author

image

cachePrepStmts: true
prepStmtCacheSize: 200
prepStmtCacheSqlLimit: 2048
useServerPrepStmts: true

@Minjoo522
Copy link
Contributor Author

image
메모리 계단식으로 떨어지고 있음

@Minjoo522
Copy link
Contributor Author

image
가상 스레드 설정
에러 5
메모리 상태 요상함
image

@Minjoo522
Copy link
Contributor Author

DB가 병목 구간이다

@Minjoo522
Copy link
Contributor Author

--- 여기까지 dev 서버

@Minjoo522
Copy link
Contributor Author

image

@Minjoo522
Copy link
Contributor Author

image

@Minjoo522
Copy link
Contributor Author

image

@Minjoo522
Copy link
Contributor Author

image

@Minjoo522
Copy link
Contributor Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📋 문서 문서 작업 🚛 백엔드 백엔드 관련 이슈 🤔 백로그 논의가 필요한 사항
Projects
Status: ✏️ TODO
Development

No branches or pull requests

5 participants