karlheyes / icecast-kh

KH branch of icecast
GNU General Public License v2.0
298 stars 106 forks source link

Traffic leap on track change #215

Open yarik2720 opened 6 years ago

yarik2720 commented 6 years ago

Hi! I'm monitoring outgoing_kbitrate from icecast in real-time on graph and when track changes graph jumps. I had monitored traffic from internet interface and it doesn't have any jumps

Using that code: <?php $s = file_get_contents("http://example.com:8000/status-json.xsl"); $json = json_decode($s, true); $outgoing_kbitrate = $json['icestats']['outgoing_kbitrate']; echo $outgoing_kbitrate; ?> chrome_2018-03-08_09-52-41

karlheyes commented 6 years ago

does the same thing happen with kh9? Some tweaks were done to the bitrate averaging code. metadata will add a small amount extra into the stream when triggered (depending on the amount in the metadata) but there should not be a huge spike. What sort of bitrate, listener numbers are we talking of?

karl

yarik2720 commented 6 years ago

On kh9 still the same. Average outgoing bitrate 25Mbps, and 200 listeners

karlheyes commented 6 years ago

does it still show the big drop and then big spike in each case? Do you use long metadata, limit is about 4k.

karl.

yarik2720 commented 6 years ago

Not always, as I request for status each second and it can be not monitored well, but spikes always on change. Metadata not long, maximum 90 symbols for trackname change

yarik2720 commented 6 years ago

I checked with "bmon" network activity, there ia no spikes on network interfaces, so it just looks like icecast stats delay during metadata update

karlheyes commented 6 years ago

I'm seeing some odd behaviour, investigating. It may affect fallback file throttling as well.

karl.

karlheyes commented 6 years ago

do you have any limiters configured like limit-rate or max-bandwidth

karl.

yarik2720 commented 6 years ago

Limits only for number of listeners summary and per mount-point. Also were changed default values of queue-size and burst-size for some mount-point, such as

<mount-name>/play_256</mount-name>
<max-listeners>220</max-listeners>
<queue-size>2024000</queue-size>
<burst-size>262140</burst-size>
....
karlheyes commented 6 years ago

I tried loading 200-600 listeners on a single mount and was not able to trigger a large burst of bandwidth. I presume based on your report, if you try the following then the bitrate jumps on metadata change (does not require a restart)

curl -X STATS -s --no-buffer 'http://admin:pw@host:8000/' | grep outgoing

Are there any other requests coming in at the same time, hard to think what would align in such a way, but I'm wondering if something may be small normally but expands out briefly.

karl.

yarik2720 commented 6 years ago

Here is output:

EVENT global outgoing_kbitrate 26036
EVENT /play outgoing_kbitrate 8638
EVENT /play_256 outgoing_kbitrate 14469
EVENT /play_32_aac outgoing_kbitrate 157
EVENT /play_64_aac outgoing_kbitrate 2373
EVENT /play_96 outgoing_kbitrate 342
EVENT /play outgoing_kbitrate 8672
EVENT /play_256 outgoing_kbitrate 14031
EVENT /play_96 outgoing_kbitrate 410
EVENT global outgoing_kbitrate 26036
EVENT global outgoing_kbitrate 19966
EVENT global outgoing_kbitrate 25313
EVENT global outgoing_kbitrate 28094
EVENT /play_64_aac outgoing_kbitrate 2385
EVENT /play_32_aac outgoing_kbitrate 227
EVENT global outgoing_kbitrate 19931
EVENT /play outgoing_kbitrate 8692
EVENT /play_256 outgoing_kbitrate 14001
EVENT /play_96 outgoing_kbitrate 349
EVENT global outgoing_kbitrate 29611
EVENT global outgoing_kbitrate 24044
EVENT global outgoing_kbitrate 26598
EVENT global outgoing_kbitrate 25241
EVENT /play_64_aac outgoing_kbitrate 2405
EVENT /play_32_aac outgoing_kbitrate 245
EVENT global outgoing_kbitrate 25222
EVENT /play outgoing_kbitrate 8801
EVENT /play_256 outgoing_kbitrate 14064
EVENT /play_96 outgoing_kbitrate 284
EVENT global outgoing_kbitrate 28573
EVENT global outgoing_kbitrate 12500
EVENT global outgoing_kbitrate 36877
EVENT global outgoing_kbitrate 21332
EVENT /play_32_aac outgoing_kbitrate 190
EVENT /play_64_aac outgoing_kbitrate 2563
EVENT global outgoing_kbitrate 27106
EVENT /play outgoing_kbitrate 8772
EVENT /play_96 outgoing_kbitrate 342
EVENT /play_256 outgoing_kbitrate 14299
EVENT global outgoing_kbitrate 23481
EVENT global outgoing_kbitrate 22924
EVENT global outgoing_kbitrate 35773
EVENT global outgoing_kbitrate 27345
EVENT /play_32_aac outgoing_kbitrate 187
EVENT /play_64_aac outgoing_kbitrate 2566
EVENT global outgoing_kbitrate 23503
EVENT /play_96 outgoing_kbitrate 344
EVENT /play outgoing_kbitrate 9060
EVENT /play_256 outgoing_kbitrate 14192
EVENT global outgoing_kbitrate 29253
EVENT global outgoing_kbitrate 27594
EVENT global outgoing_kbitrate 26334

events for mount-points are coming at the same time

collected data more later with more listeners:

EVENT global outgoing_kbitrate 37440
EVENT global outgoing_kbitrate 38138
EVENT global outgoing_kbitrate 38922
EVENT global outgoing_kbitrate 38668
EVENT /play_32_aac outgoing_kbitrate 314
EVENT /play_64_aac outgoing_kbitrate 2571
EVENT global outgoing_kbitrate 35253
EVENT /play_256 outgoing_kbitrate 23407
EVENT /play outgoing_kbitrate 12655
EVENT /play_96 outgoing_kbitrate 283
EVENT global outgoing_kbitrate 43893
EVENT global outgoing_kbitrate 37532
EVENT global outgoing_kbitrate 41121
EVENT global outgoing_kbitrate 38179
EVENT /play_64_aac outgoing_kbitrate 2586
EVENT /play_32_aac outgoing_kbitrate 321
EVENT global outgoing_kbitrate 38328
EVENT /play outgoing_kbitrate 12698
EVENT /play_256 outgoing_kbitrate 23006
EVENT /play_96 outgoing_kbitrate 344
EVENT global outgoing_kbitrate 35504
EVENT global outgoing_kbitrate 39768
EVENT global outgoing_kbitrate 40802
EVENT global outgoing_kbitrate 42309
EVENT /play_64_aac outgoing_kbitrate 2595
EVENT /play_32_aac outgoing_kbitrate 312
EVENT global outgoing_kbitrate 72020
EVENT /play_256 outgoing_kbitrate 22867
EVENT /play outgoing_kbitrate 12892
EVENT /play_96 outgoing_kbitrate 286
EVENT global outgoing_kbitrate 37429
EVENT global outgoing_kbitrate 14015
EVENT global outgoing_kbitrate 37829
EVENT global outgoing_kbitrate 35714
k-zakhariy commented 4 years ago

Hey guys, how did you get working /status-json.xsl, i can't even find this file in web folder, i want to track stream info and listeners Thanks in advance