Ant-Media-Server icon indicating copy to clipboard operation
Ant-Media-Server copied to clipboard

Wrong System Memory running in LXC

Open oe73773 opened this issue 5 months ago • 5 comments

Short description

RTMP Stream from OBS is rejected after update Ant Media Server rom 2.6.4 to 2.11.1 running on LXC.

Log in error:

024-09-01 09:45:23,662 [RTMPConnectionExecutor-4] INFO  i.a.AntMediaApplicationAdapter - W3C x-category:session x-event:connect c-ip:172.26.64.56 c-client-id:1
2024-09-01 09:45:23,706 [RTMPConnectionExecutor-4] ERROR i.antmedia.statistic.StatsCollector - Not enough resource. Due to memory limit. Memory usage should be less than %75 but it is %88
2024-09-01 09:45:23,706 [RTMPConnectionExecutor-4] INFO  o.red5.server.net.rtmp.RTMPHandler - There is not enough resource to rtmp ingest stream: obslive
2024-09-01 09:45:23,720 [RTMPConnectionExecutor-1] INFO  o.red5.server.stream.StreamService - deleteStream with internal id:1.0 is null so it's not closed

After doing some debugging. This is cause by Ant Media Server detecting 27.6 GB of 31.0 GB used. While 31 GB is the real memory on the Promox host. The 27.6GB is not a real value (may be use and free are swaped). System shows:

root@ns31xxxxxxxx:~# vmstat -S M
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 2  2      0  27901     42    668    0    0    58    77  123  170  1  1 96  2  0  

Environment

  • Operating system and version (Proxmox Host): Debain 12
  • Operating system and version (LCX Container): Ubuntu 24.04.1 LTS
  • Java version: OpenJDK 64-Bit Server VM (build 17.0.12+7-Ubuntu-1ubuntu224.04, mixed mode, sharing)
  • Ant Media Server version: Community Edition 2.11.1 20240831_1437
  • Browser name and version: n/a

Steps to reproduce

  1. Update from ANT Media Server 2.6.4
  2. Start Stream on OBS

Expected behavior

Stream should work.

Actual behavior

OBS shows and error

Workaround

Set <property name="memoryLimit" value="${server.memory_limit_percentage:95}" /> in /usr/local/antmedia/conf/red-common.xml

Logs

024-09-01 09:45:23,662 [RTMPConnectionExecutor-4] INFO  i.a.AntMediaApplicationAdapter - W3C x-category:session x-event:connect c-ip:172.26.64.56 c-client-id:1
2024-09-01 09:45:23,706 [RTMPConnectionExecutor-4] ERROR i.antmedia.statistic.StatsCollector - Not enough resource. Due to memory limit. Memory usage should be less than %75 but it is %88
2024-09-01 09:45:23,706 [RTMPConnectionExecutor-4] INFO  o.red5.server.net.rtmp.RTMPHandler - There is not enough resource to rtmp ingest stream: obslive
2024-09-01 09:45:23,720 [RTMPConnectionExecutor-1] INFO  o.red5.server.stream.StreamService - deleteStream with internal id:1.0 is null so it's not closed

oe73773 avatar Sep 01 '24 16:09 oe73773