Commit Graph

23 Commits

Author SHA1 Message Date
cnderrauber
e963953817 Refine ipv6 support (#4352)
* Refine ipv6 support

* go mod

* check ipv4 is set in turn
2026-03-09 20:43:00 +08:00
Raja Subramanian
8cc17f8f8b Rework node stats a bit. (#3555)
* Rework node stats a bit.

Related protocol PR - https://github.com/livekit/protocol/pull/1023

- Make a config for node stats measurements. Wanted to put the config in
  `routing` package, but a circular dependency forced me to put in
   config.go
- Make rate calculations explicit, i. e. requested via config.
  Previously, it had some odd checks to decide when to calculate rate
  and it would have been calculating over different windows.
- Report signal/data channel bytes every 5 seconds to stats collection
  module. Previously, it was doing it every 30 seconds and that meant
  some windows could have had a large spike
  NOTE: Still need to think about this for load calculations as a large
  number of participants leaving could flush in a small window and that
  could report a large spike in bytes/packets. Maybe need to ignore
  signal bytes for load calculation?

* deps

* use default node stats config if given config is nil

* split out node stats into a struct for re-use

* update config
2025-03-27 12:42:19 +05:30
David Zhao
84cb14695f Fix incorrect computation of SecondsSinceNodeStatsUpdate (#3172)
Stats.UpdatedAt is in seconds, but we were loading as nanosecs
2024-11-12 01:13:08 -06:00
Raja Subramanian
49b75e94a6 Consolidate operations on LocalNode. (#3140) 2024-10-25 18:57:23 +05:30
Paul Wells
f1886ece42 update protocol (#2760)
* update protocol

* deps
2024-06-05 19:46:34 -07:00
David Zhao
d6ebc081d5 Use random NodeID instead of MAC based (#2029)
Makes it possible to run multiple instances of livekit-server locally.

Also enables Signal Relay by default as default signal proxy.
2023-09-02 17:36:55 -07:00
David Zhao
981fb7cac7 Adding license notices (#1913)
* Adding license notices

* remove from config
2023-07-27 16:43:19 -07:00
David Colburn
faa870de3d Move callbacks out of messageRouter (#269)
* move callbacks out of messageRouter

* OCD

* more OCD

* fix forwarder test

* even more OCD

* maximum OCD

* package name collision, copy lock by value
2021-12-17 13:19:23 -08:00
Mathew Kamkar
bd42a39117 Include node ID with Prometheus metrics (#251)
* include node id in prometheus metrics

* static prom init and nodeID

* update protocol dep
2021-12-10 15:49:14 -08:00
David Zhao
2d93ccd668 Updated protocol from protocol/proto -> protocol/livekit (#242)
* Updated protocol from protocol/proto -> protocol/livekit

* separate MediaTrack from PublishedTrack
2021-12-08 13:58:38 -08:00
Brint E. Kriebel
822f8c3944 Region Aware node selection fixes and enhancements (#141)
* cli: Allow setting the current node region with flag or env variable

Also add region to "starting LiveKit server" log.

* routing: Add region to node registration

Register the node's region on the selected router so it can be used for
region aware node selection.

Also add the region to the list-nodes output.

* regionaware: Set minDist to zero for the current node

If you don't set the minDist when leaving the loop early for a node that
matches the current region, the minDist value with still be at max. This
causes the the wrong node to be selected if the current node is the
first one the loop passes through.

Add a test that validates this change. The new test fails if this new
change is not in place.
2021-10-10 22:21:37 -07:00
Mathew Kamkar
700a879c0b Redis Router graceful stop (#116)
* prestop and hasparticipants in interface

* add prestop function to existing routers

* fakerouter prestop

* update protocol version

* read lock

* redis router graceful stop

* test fix

* force stop
2021-09-15 13:07:44 -07:00
David Colburn
4044c314b8 participant key (#106)
* participant key

* update fake router

* WriteRTCMessage

* move sink closing

* unused code
2021-08-31 16:14:06 -05:00
David Colburn
8a44fad307 protocol 0.8 (#95)
* protocol 0.8

* merge new selector
2021-08-27 13:16:33 -05:00
David Zhao
a80e8cf69f Enable passing in local IP, refactored IP detection (#48)
* Enable passing in local IP, refactored IP detection

* update docker server instructions
2021-07-11 08:42:11 -07:00
David Zhao
4e6eafa63c for test environments, allow use of internal IP if external IP isn't available 2021-06-30 15:14:58 -07:00
David Zhao
a3228c2ae9 resolve data race conditions, code quality 2021-06-04 14:57:55 -07:00
David Zhao
093d99b010 update dependencies, minor fixes 2021-03-15 11:42:57 -07:00
David Zhao
7d02c01fd8 refactor - moved common code to livekit/protocol 2021-03-13 22:01:51 -08:00
David Zhao
b52354623c use hostname instead of MAC address to work with docker environments 2021-02-17 17:51:54 -08:00
David Zhao
d83a1b1af3 automatically cleanup participant redis data 2021-01-18 17:56:48 -08:00
David Zhao
30e99e8c6b redis based router & roomstore 2021-01-17 00:12:05 -08:00
David Zhao
9064f6ade1 decouple websocket and RTC nodes, prep for distributed 2021-01-16 10:37:38 -08:00