1

서버에서 awslogs agent을 실행 중이며 AWS 콘솔에서 CloudWatch 로그를 볼 때 로그는 약 60 분 뒤입니다. 우리 서버는 시간당 약 650MB의 데이터를 생성하며 에이전트는 계속 유지할 수없는 것으로 보입니다. 여기awslogs 상담원이 계속 진행할 수 없습니다.

우리의 약식 설정 파일입니다 :

[application.log] 
datetime_format = %Y-%m-%d %H:%M:%S 
time_zone = UTC 
file = var/output/logs/application.json.log* 
log_stream_name = {hostname} 
initial_position = start_of_file 
log_group_name = ApplicationLog 

[service_log] 
datetime_format = %Y-%m-%dT%H:%M:%S 
time_zone = UTC 
file = var/output/logs/service.json.log* 
log_stream_name = {hostname} 
initial_position = start_of_file 
log_group_name = ServiceLog 

가 awslogs 에이전트의 속도에 대한 공통 방법이 있나요?

답변

5

데이터 양 (> 0.2MB/s)은 에이전트에서 문제가되지 않습니다. 에이전트는 로그 파일 당 약 3MB/s의 용량을 가지고 있습니다. 그러나 여러 로그 파일에 동일한 로그 스트림을 사용하는 경우 에이전트는 동일한 스트림에 기록하고 서로를 차단합니다. 로그 파일간에 스트림을 공유 할 때 처리량이 절반 이상입니다.

는 또한, 성능에 영향있을 수 있습니다 구성 할 수 있습니다 a few properties이 있습니다 : (

  1. 이 대폭 배치 크기를 증가 :

    buffer_duration = <integer> 
    batch_count = <integer> 
    batch_size = <integer> 
    

    내 문제를 해결하기를, 나는 두 가지 일을했다 기본값은 32768 바이트입니다.

  2. 각 로그 파일마다 다른 로그 스트림 사용

그리고 에이전트는 계속 문제가 없었습니다. 여기 내 최종 설정 파일입니다 :

file = var/output/logs/application.json.log* 

선택할 것이다 너무 많은 파일 :

[application.log] 
datetime_format = %Y-%m-%d %H:%M:%S 
time_zone = UTC 
file = var/output/logs/application.json.log* 
log_stream_name = {hostname}-app 
initial_position = start_of_file 
log_group_name = ApplicationLog 
batch_size = 524288 

[service_log] 
datetime_format = %Y-%m-%dT%H:%M:%S 
time_zone = UTC 
file = var/output/logs/service.json.log* 
log_stream_name = {hostname}-service 
initial_position = start_of_file 
log_group_name = ServiceLog 
batch_size = 524288 
+0

json 데이터를 로깅하고있는 것으로 나타났습니다. Cloudwatch 로그로 분석 할 수 있습니까? – Julian

+0

CloudWatch는 JSON을 최우선으로 지원합니다. – EmptyArsenal

+0

달콤한. 그걸 몰랐어! 감사. – Julian

0

awslogs 에이전트는 로그 회전 그래서이 지원?

시도 :

file = var/output/logs/application.json.log 

이 과정을 속도를.