scala
2019. 10. 31. 08:52
Spark Streaming Job(Kafka-Consumer)의 성능을 높일 수 있다.
* Kafka topic의 파티션 개수 * 설정 파일의 spark.streaming.kafka.maxRatePerPartition 이다.
* 파티션 개수가 10개 * spark.streaming.kafka.maxRatePerPartition이 5 개이면 => 50 event /duration 성능이 나온다.
그러나 maxRatePerPartition이 너무 크면 OOM이 발생하거나 스트리밍 시스템(sink)에 영향을 줄 수 있다.
스트리밍이 제대로 동작되는지 확인하려면 2가지를 확인할 수 있다.
1) 52 completed batches, 653 records (동작안되면 0 completed batches 라고 뜬다)
2) Processing Time과 Total Delay 처리 Avg 시간을 확인한다. -로 나온다면 처리하는 것이 아니다.

Posted by 김용환 '김용환'
td-agent가 잘동작하는지 확인하려면 시스템 레벨에서 td-agent가 잘 동작하는지를 확인할 수 있을 것이다.
이외 td-agent에 기본적으로 설치된 24220 포트를 활성화하고 해당 서버의 포트를 체크한다.
<source>
@type monitor_agent
bind 0.0.0.0
port 24220
</source>
대략 (파이썬을 사용해 ) ansible의 host 파일을 읽어 아래와 같이 모니터링할 수 있다.
failed_servers = []
for ansible_server in ansible_server_list:
url = f"http://{ansible_server}:24220/api/plugins.json"
try:
r = requests.get(url)
r.raise_for_status()
except (requests.exceptions.ConnectionError, requests.exceptions.Timeout, requests.exceptions.HTTPError):
failed_servers.append(ansible_server)
Posted by 김용환 '김용환'
scala
2019. 10. 21. 15:21
아무리 수정해도 sbt가 잘 동작하지 않으면, sbt의 로컬 디렉토리인 ~/.sbt 을 다시 지우고 시작하자!!
Posted by 김용환 '김용환'
sbt 사용할 때 Exception이 fully하게 보여주지 않으니 답답한데..
-oD를 사용하니 기니 Exception이 fully 로 나온다. 속이 시원하다.
http://www.scalatest.org/user_guide/using_scalatest_with_sbt
Specifying ScalaTest Arguments
You can pass arguments to ScalaTest by using testOptions
and Tests.Argument
in your sbt build file:
testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-oD")
The -oD
argument above will be pass to ScalaTest for all test runs, you can also pass arguments for individual runs by using test-only
and placing them after --
, like this:
> test-only org.acme.RedSuite -- -oD
Posted by 김용환 '김용환'
scala
2019. 10. 21. 15:17
sbt 에서 컴파일 속도가 나지 않는다고 계속 아래 커맨드를 사용하라고 로그가 나와서
[warn] Getting the hostname Alvins-MacBook-Pro.local was slow (5003.850955 ms).
This is likely because the computer's hostname is not set.
You can set the hostname with the command:
scutil --set HostName $(scutil --get LocalHostName).
아래 커맨드를 사용하니 잘 동작한다.
$ scutil —set HostName $(scutil —get LocalHostName)
참고할 내용
실제 코드
https://github.com/sbt/sbt/pull/3766/files
질문 & 답
https://apple.stackexchange.com/questions/175320/why-is-my-hostname-resolution-taking-so-long
\
Posted by 김용환 '김용환'
Open JDK를 테스트하는데 일주일 걸리고, 한 번 테스트하는데 만불(1200만원) 걸린다고 한다.
=> 역시 구글은 테스트를 중요하게 생각한다.
Posted by 김용환 '김용환'
http://www.mysqlkorea.com/gnuboard4/bbs/board.php?bo_table=develop_03&wr_id=73
semi-sync 에 자체적으로 timeout 이 있어 일정 횟수 실패하면, 자동으로 async 로 변경된다.
Posted by 김용환 '김용환'
댓글을 달아 주세요