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

긴 노래 재생시 약 30분 뒤 노래가 끊기는 현상. #1

Closed
asgfu4368 opened this issue Jul 23, 2023 · 1 comment
Closed

Comments

@asgfu4368
Copy link

30분 이상 영상을 재생시킬 시 30분 뒤 노래가 끊기며 통화방으로 나가는 현상이 나옵니다.
모듈문제일까요?

@Emin-G
Copy link
Owner

Emin-G commented Jul 23, 2023

네. ytdl-core의 고질적인 문제 입니다.
ytdl-core를 사용하면 현재로써 근본적인 해결책은 없고요.
일단 임시 방편으로
functions/play.js Line 28을

resource[message.guild.id] = createAudioResource( ytdl(url, {filter : "audioonly", quality: "highestaudio", highWaterMark: 1 << 124, dlChunkSize: 0 }), { inlineVolume: true } );

으로 변경해주시고
(highWaterMark의 값을 어느정도 조절해주는 것입니다.)

봇을 실행 시키실 때

node --max-old-space-size=18000 .
와 같이 사용 가능 메모리 양을 늘려 주시면 해결은 가능합니다.

위의 세팅 값은 메모리 16기가 기준으로 운영체제 구동 메모리를 제외하고 여유롭게 잡아놓은 값입니다.

그러나, 장기간 재부팅 없이 길이가 긴 영상을 많이 재생했을 경우에는 ytdl-core의 고질병인 메모리 누수로 인해 메모리 사용량이 기하급수적으로 늘어날 수 있습니다.
해결하기 위해 LavaPlayer를 이용한 다른 뮤직봇 프로젝트를 개발하고 있으나 시간이 어느 정도 걸릴 것 같고요.
Lavaplayer와 같은 ytdl-core 외의 다른 모듈을 이용해서 처음부터 개발하지 않은 이유는 초기 세팅이 너무 복잡해져서
누구나 사용하기 어렵다고 판단하였기 때문입니다.

@Emin-G Emin-G closed this as completed Jul 23, 2023
@Emin-G Emin-G pinned this issue Jul 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants