savonet / liquidsoap

Liquidsoap is a statically typed scripting general-purpose language with dedicated operators and backend for all thing media, streaming, file generation, automation, HTTP backend and more.
http://liquidsoap.info
GNU General Public License v2.0
1.39k stars 127 forks source link

Stereotool #3159

Open rgriep opened 1 year ago

rgriep commented 1 year ago

Hi,

I am testing and programming Liquidsoap 2.2.0 and Stereotool. It works temporary fine and the Liquidsoap crash without ny error. Trying to run it as an daemon doesn't work too. No stream.

The servere runs on Ubuntu 22/ 4 core, 8GB memory. Only as a test server before production output.

Processor use avg 53% memory 9% while running the Liquidsoap script with Stereotool.

I followed the instructions for Liquidsoap 2.20 an Stereotool.

What can be the problem?

Best regards, Robert

toots commented 1 year ago

Thanks for reporting.

Are you familiar with gdb? You should be able to obtain a stack trace this way:

gdb /path/to/liquidsoap
> r <options>
.... crash
> thread apply all bt

Thanks!

rgriep commented 1 year ago

Thank you, I will try it out

speniti commented 1 year ago

Hey @rgriep did you found a solution? I think that I'm experiencing the same problem. @toots I'm using the docker image to run Liquidsoap, is there a way to obtain the logs using gdb as well?

toots commented 1 year ago

@speniti yes absolutely, just install gdb inside the container.

speniti commented 1 year ago

I think that I found the issue, it was the enable_replaygain_metadata that was slowly increasing memory usage until the max. I have just removed it and everything seems working fine now with an almost constant memory usage. Hope this can help you @rgriep.

toots commented 1 year ago

Thanks for finding this @speniti. I'm gonna have a pass at this memory increase with enable_replaygain_metadata. How fast was the memory increasing?

speniti commented 1 year ago

Not so fast, in my case the container has the memory limited to 1280MB, just after starting Liquidsoap was using ~40/43% of it and the usage was increasing ~1% per hour, so something like ~12MB/h. After removing the enable_replaygain_metadata call, the memory usage is stable around ~45/46%.

Also CPU usage has changed, before I was seeing some spikes above the 100% (I have 2vCPUs available), now seems more stable around the ~40/60%.

I don't have any useful graph to show at the moment since I still have to configure CloudWatch properly, sorry.

toots commented 1 year ago

@speniti CPU spikes are expected. The replaygain method does have to decode files when the metadata is not available and this will consume CPU. We introduced a ratio parameter in https://github.com/savonet/liquidsoap/commit/be75b6ec4c9ed56fba93be0c5e396d382e99c615 that should allow for a finer control of the spikes but they are unfortunately required for the functionality.

speniti commented 1 year ago

Ah, ok gotcha! Thanks, I wasn't aware of the ratio parameter.