Skip to content

Commit

Permalink
Threads: Support Hybrid+API+LOG threads
Browse files Browse the repository at this point in the history
commit
    Remove SEND/RECV/SRTP threads.
    Enable generate_streams by default.
    Support disable circuit breaker.

commit 6c83e89
Author: winlin <winlin@vip.126.com>
Date:   Mon Apr 26 09:38:19 2021 +0800

    Threads: Refine circuit breaker

commit 614a781
Author: winlin <winlin@vip.126.com>
Date:   Sun Apr 25 19:52:13 2021 +0800

    Threads-Hybrid: Fix rebase bugs

commit 9c845c5
Author: winlin <winlin@vip.126.com>
Date:   Wed Apr 7 15:53:14 2021 +0800

    Threads-Hybrid: Support multiple hybrid threads, 5.0.3

    1. Support multiple hybrid threads.
    2. Update benchmark data for 1/4/8/32 CPUs.
    3. Update benchmark for Janus.

commit 10edbb5
Author: winlin <winlin@vip.126.com>
Date:   Fri Apr 9 11:45:59 2021 +0800

    Threads-Hybrid: Always response channel with error information

commit 5074a4d
Author: winlin <winlin@vip.126.com>
Date:   Fri Apr 9 11:21:45 2021 +0800

    Threads-Hybrid: Use ST wait and IO for RECV/SEND thread.

commit c8f2ff0
Author: winlin <winlin@vip.126.com>
Date:   Fri Apr 9 10:21:05 2021 +0800

    Threads-Hybrid: Merge api to master thread.

commit 50f03ad
Author: winlin <winlin@vip.126.com>
Date:   Wed Apr 7 13:26:04 2021 +0800

    Threads-Hybrid: Config auto generate stream config for hybrids.

commit 11aada1
Author: winlin <winlin@vip.126.com>
Date:   Tue Apr 6 20:00:16 2021 +0800

    Threads-Hybrid: Process api request one by one

commit 963a0fa
Author: winlin <winlin@vip.126.com>
Date:   Tue Apr 6 19:46:53 2021 +0800

    Threads-Hybrid: Change pps stat to thread-local.

commit 9eb9b19
Author: winlin <winlin@vip.126.com>
Date:   Tue Apr 6 15:21:48 2021 +0800

    Threads-Hybrid: Move acquire pid file from hybrid to pool.

commit 97f6684
Author: winlin <winlin@vip.126.com>
Date:   Tue Apr 6 12:53:17 2021 +0800

    Threads-Hybrid: Schedule connection to the sample hybrid by url

commit eab4f89
Author: winlin <winlin@vip.126.com>
Date:   Tue Apr 6 12:20:38 2021 +0800

    Threads-Hybrid: Change global variables to thread-local or with lock

    1. Thread-Safe: Config subscribes, subscribe or unsubscribe.
    2. Global-Shared: Async SRTP/RECV/SEND/Log use thread-safe objects.
    3. Global-Shared: SRTP and DTLS certificate, without critical data.
    4. Thread-Local: Blackhole, ResourceManager, StreamManager, ObjectCache, by design.
    5. Global-Shared: Log and context, which use thread-safe objects.
    6. Thread-Local: Pithy print for each thread.

commit 7dbac15
Author: winlin <winlin@vip.126.com>
Date:   Tue Apr 6 09:10:16 2021 +0800

    Threads-Hybrid: Add TODO as be thread-local

commit babe8e6
Author: winlin <winlin@vip.126.com>
Date:   Tue Apr 6 08:22:48 2021 +0800

    Threads-Hybrid: Start multiple hybrid threads

commit 3367956
Author: winlin <winlin@vip.126.com>
Date:   Tue Apr 6 07:59:37 2021 +0800

    Threads-Hybrid: Support mulitple hybrid/stream servers

    1. For hybrid RTMP/HTTP/RTC servers.
    2. Config hybrids in threads.
    3. Get hybrid server config with index.

commit 6e2de90
Author: winlin <winlin@vip.126.com>
Date:   Mon Apr 5 21:48:25 2021 +0800

    Threads-Hybrid: Support communicate between threads by chan and slot

    1. Hybrid thread is responder, API thread is initiator.
    2. Responder read message from initiator-slot, write message to responder-slot.
    3. Initiator write message to initiator-slot, read message from responder-slot.
    4. Responder start a coroutine to consume requests and response it.

commit 281350d
Author: winlin <winlin@vip.126.com>
Date:   Mon Apr 5 18:53:32 2021 +0800

    Threads-Hybrid: Extract pipe and pair to communicate between threads

    1. Pipe can be open by any threads, because it's only os FDs.
    2. If pipe is open read/write, it's associated by ST, so we MUST free it by the same thread.
    3. If open pipe in one thread, it's ok to free it directly, without close pipe.
    4. If open read in a thread, then open write in another thread, user MUST close it correctly.

commit 40e59ef
Author: winlin <winlin@vip.126.com>
Date:   Mon Apr 5 16:16:23 2021 +0800

    Threads-Hybrid: Enable RTC play API with bugs

commit 9f4fbdb
Author: winlin <winlin@vip.126.com>
Date:   Mon Apr 5 12:39:28 2021 +0800

    Threads-Hybrid: Init ST for each threads

    1. ST is thread-local now.
    2. MUST init st for each threads.
    3. Do it as early as possible.

commit 2fa3aca
Author: winlin <winlin@vip.126.com>
Date:   Mon Apr 5 10:22:13 2021 +0800

    Threads-Hybrid: Extract API server and threads.

commit dd7c7ad
Author: winlin <winlin@vip.126.com>
Date:   Sun Apr 4 20:44:07 2021 +0800

    Threads-Hybrid: Refine conf file

commit 246d7f5
Author: winlin <winlin@vip.126.com>
Date:   Mon Apr 5 11:55:10 2021 +0800

    Threads-Hybrid: Research for extern and __thread

commit 1a0456a
Author: winlin <winlin@vip.126.com>
Date:   Fri Apr 9 22:44:56 2021 +0800

    Threads: TODO: Sort the packets, to avoid NACK

commit b11f958
Author: winlin <winlin@vip.126.com>
Date:   Wed Mar 31 18:37:39 2021 +0800

    Threads: Support multiple threads with locks, #2188. 5.0.2

    1. Threads-Log: Use thread to write and reopen logs.
    2. Threads-SRTP: Support decrypt RTP by async SRTP.
    3. Threads-RECV: Support dedicate thread to recv UDP packets.
    4. Threads: Support cpu affinity for threads.
    5. Threads-RECV: Drop received packet if exceed max queue size.
    6. Threads: Use coroutine to consume recv/srtp packets.
    7. Threads: Support Circuit-Breaker to work in storms.
    8. Threads-SRTP: Support async decrypt RTCP
    9. Threads-SEND: Support async send UDP packets
    10. Threads-SRTP: Use async encrypt SRTP packet
    11. Threads-SEND/RECV: Bind handler to listener to support multiple ports.
    12. Threads-RECV: Support tunnel for recv-srtp.
    13. Threads-SEND: Support tunnel for srtp-send.
    14. Threads: Support circuit-breaker dying threshold

commit 8cf7ead
Author: winlin <winlin@vip.126.com>
Date:   Tue Apr 6 20:54:36 2021 +0800

    Threads: Enable threads support for openssl.

commit 28d8f1a
Author: winlin <winlin@vip.126.com>
Date:   Wed Apr 7 10:29:18 2021 +0800

    Threads: Support multiple SRTP/SEND/RECV threads.

    1. Move received and cooked packets queue to thread entry, that is, each thread has its own queue.
    2. In RECV thread, push received packet to queue of source thread, in thread listener.
    3. In SRTP thread, push cooked packet to queue of source thread, in asyn SRTP task.
    4. In hybrid thread, directly and only consume the packets of self thread.
    5. Sync between SRTP task by lock.

commit a505b6b
Author: winlin <winlin@vip.126.com>
Date:   Mon Apr 5 16:17:08 2021 +0800

    Threads: Directly use hybrid thread to consume messages.

commit 14bc7bc
Author: winlin <winlin@vip.126.com>
Date:   Tue Mar 30 16:38:30 2021 +0800

    Threads: Keep alive when got RTP plaintext

commit e15737f
Author: winlin <winlin@vip.126.com>
Date:   Mon Mar 29 17:18:04 2021 +0800

    Threads: Support circuit-breaker dying threshold

commit d6a92cb
Author: winlin <winlin@vip.126.com>
Date:   Tue Mar 30 14:14:26 2021 +0800

    Threads-SEND: Support tunnel for srtp-send.

commit d282ccd
Author: winlin <winlin@vip.126.com>
Date:   Mon Mar 29 12:02:41 2021 +0800

    Threads-RECV: Support tunnel for recv-srtp.

commit eb7ce7f
Author: winlin <winlin@vip.126.com>
Date:   Mon Mar 22 19:09:04 2021 +0800

    Threads-RECV: Reset the cache buffer when copy

commit 1235b33
Author: winlin <winlin@vip.126.com>
Date:   Mon Mar 22 18:45:12 2021 +0800

    Threads-SEND/RECV: Bind handler to listener to support multiple ports.

commit 615da26
Author: winlin <winlin@vip.126.com>
Date:   Fri Mar 19 18:52:11 2021 +0800

    Threads-SRTP: Use async encrypt SRTP packet

    1. Async SRTP support protect RTCP.
    2. Send packet ignore when encrypt size is 0.
    3. Callback to send packet if encrypt done.

commit a26b926
Author: winlin <winlin@vip.126.com>
Date:   Fri Mar 19 18:43:08 2021 +0800

    Threads-SRTP: Use async encrypt SRTP packet

    1. Async SRTP support protect RTP.
    2. Send packet ignore when encrypt size is 0.
    3. Callback to send packet if encrypt done.

commit 56ffc28
Author: winlin <winlin@vip.126.com>
Date:   Fri Mar 19 18:03:40 2021 +0800

    Threads-SEND: Support async send UDP packets

    1. Support async send UDP by SrsAsyncSendManager.
    2. Copy UDP packet by SrsAsyncUdpPacket.
    3. Support SrsUdpMuxSocket raw sendto.
    4. Config the async send by async_send.

commit b0800f5
Author: winlin <winlin@vip.126.com>
Date:   Fri Mar 19 16:16:09 2021 +0800

    Threads-SRTP: Support async decrypt RTCP

    1. SrsAsyncSRTP support unprotect_rtcp packet.
    2. Extract on_rtcp_plaintext from on_rtcp.

commit 949c80e
Author: winlin <winlin@vip.126.com>
Date:   Fri Mar 19 14:58:34 2021 +0800

    Threads-RECV: Change UDP recv max size from 6k to 1500 bytes.

commit 198dca5
Author: winlin <winlin@vip.126.com>
Date:   Fri Mar 19 13:48:36 2021 +0800

    Threads: Merge recv and srtp consume to one timer.

commit 57b771a
Author: winlin <winlin@vip.126.com>
Date:   Fri Mar 19 11:30:46 2021 +0800

    Threads: Refine variables and do dispose

    1. Rename packets to srtp or received packets.
    2. Add task dispose API, cleanup in future.
    3. If got packets before init AsyncSRTP, return error.
    4. Never free the SRTPTask, dispose it instead.

commit 9a05d24
Author: winlin <winlin@vip.126.com>
Date:   Thu Mar 18 17:33:51 2021 +0800

    Threads: Support Circuit-Breaker to work in storms.

    1. Config the recv queue, drop packet if exceed.
    2. Config the high and critical threshold and pulse of water level.
    3. If critical water level, disable NACK and TWCC.
    4. If high water level, ignore for NACK insert and send.
    5. Support read the CPU of thread.
    6. Refine SrsPps to support r1s sample.

commit 1c90497
Author: winlin <winlin@vip.126.com>
Date:   Wed Mar 17 13:53:55 2021 +0800

    Threads: Use coroutine to consume recv/srtp packets.

commit 957034e
Author: winlin <winlin@vip.126.com>
Date:   Wed Mar 17 08:08:17 2021 +0800

    Threads: Use thread-local buffer for log

    1. Call SrsThreadPool::setup() in main(),or  each thread starting.
    2. Initialize the thread-local object in SrsThreadPool::setup().
    3. Change shared log buffer to thread-local.

commit 185359f
Author: winlin <winlin@vip.126.com>
Date:   Tue Mar 16 20:29:35 2021 +0800

    Threads-RECV: Show the dropped packets pps.

commit 6fca411
Author: winlin <winlin@vip.126.com>
Date:   Tue Mar 16 20:26:41 2021 +0800

    Threads-RECV: Drop received packet if exceed max queue size.

    1. Print the number of recv/srtp queue packets.
    2. Drop packet if exceed max recv queue size.

commit 9e554ca
Author: winlin <winlin@vip.126.com>
Date:   Tue Mar 16 19:26:44 2021 +0800

    Threads: Support cpu affinity for threads.

    1. Config cpu_affinity in threads.
    2. Default to not set the cpu affinity.
    3. Support set by cpu range 0-63.

commit fa4c9f9
Author: winlin <winlin@vip.126.com>
Date:   Tue Mar 16 11:42:32 2021 +0800

    Threads: Set the threads name display in top.

commit 1c6e941
Author: winlin <winlin@vip.126.com>
Date:   Tue Mar 16 08:30:21 2021 +0800

    Threads-RECV: Refine the stat for SNMP UDP recv/error

    1. Remove the delta of _srs_snmp_udp_stat.
    2. Use _srs_pps_rloss for receive loss rate.
    3. Use _srs_pps_sloss for send loss rate.

commit 85ea39d
Author: winlin <winlin@vip.126.com>
Date:   Mon Mar 15 22:51:58 2021 +0800

    Threads-RECV: Support dedicate thread to recv UDP packets.

    1. Use SrsUdpMuxSocket::raw_recvfrom to read, without ST.
    2. Start a UDP recv thread, to recv packets.
    3. Consume UDP packets in RTC server timer.

commit e3686a4
Author: winlin <winlin@vip.126.com>
Date:   Mon Mar 15 21:15:28 2021 +0800

    Threads: Fix bug for SRTP and Log thread nanosleep.

commit 88165ba
Author: winlin <winlin@vip.126.com>
Date:   Mon Mar 15 20:36:20 2021 +0800

    Threads-SRTP: Support decrypt RTP by async SRTP.

    1. Create dedicate thread for async srtp.
    2. SrsSecurityTransport use async srtp if config on.
    3. Cook SRTP packets in async srtp.
    4. Consume cooked SRTP packets in RTC server timer.

commit f068540
Author: winlin <winlin@vip.126.com>
Date:   Sun Mar 14 21:39:36 2021 +0800

    Threads-SRTP: Config and add files for the async-srtp

    1. If configed the async srtp, use a new object.
    2. Allow sync and async srtp, by config.

commit 2367483
Author: winlin <winlin@vip.126.com>
Date:   Sun Mar 14 22:11:02 2021 +0800

    Threads-Log: Refine stat for sync wait, in log thread.

commit 6a1d6a0
Author: winlin <winlin@vip.126.com>
Date:   Sun Mar 14 18:43:54 2021 +0800

    Threads-Log: Remove dual queue for sys logs.

    1. It exists delay for multiple threads.
    2. There is overlay for cache of coroutine queues.
    3. Risk when other threads write logs.

commit 6ddbc5f
Author: winlin <winlin@vip.126.com>
Date:   Sun Mar 14 18:30:23 2021 +0800

    Threads-Log: Refine comments for global variable.

    1. Dual queue for async logs, exists risk.
    2. Flush the logs is too slow, because it depends on logs and interval.

commit 6718c38
Author: winlin <winlin@vip.126.com>
Date:   Sun Mar 14 10:42:09 2021 +0800

    Threads-Log: Refine dual queue for log thread.

    1. App/User controls the interval to flush coroutine-queue.
    2. Use srs_update_system_time to get time for log.
    3. Stat the thread sync in us, in SrsThreadPool.
    4. Change default interval for thread to 5s.

commit 37aee44
Author: winlin <winlin@vip.126.com>
Date:   Sun Mar 14 08:55:17 2021 +0800

    Threads-Log: Support dual queue cache for async logs.

    1. Create dual queue, the coroutine queue and thread queue.
    2. The coroutine queue cache logs does not require lock.
    3. When need to flush, flush the logs from coroutine-queue to thread-queue.
    4. Finally, flush thread-queue to disk.

commit 4918160
Author: winlin <winlin@vip.126.com>
Date:   Sat Mar 13 07:09:56 2021 +0800

    Threads-Log: Support thread-safe queue SrsThreadQueue.

    1. Wrap std::vector to thread-safe queue.
    2. Keep API compatible with std::vector.
    3. SrsAsyncFileWriter use thread-safe queue instead.

commit 3810f5f
Author: winlin <winlin@vip.126.com>
Date:   Fri Mar 12 18:59:14 2021 +0800

    Threads-Log: Remove utest for reload log configs.

commit bf95fdf
Author: winlin <winlin@vip.126.com>
Date:   Fri Mar 12 18:48:03 2021 +0800

    Threads-Log: Use thread to write and reopen logs.

    1. Remove support for reload log configs.
    2. Add config for thread pool cycle interval.
    3. Add config for log flush interval.
    4. Create a SrsAsyncLogManager to create writers.
    5. Create a SrsAsyncFileWriter to write file async.

commit 0cea382
Author: winlin <winlin@vip.126.com>
Date:   Fri Mar 12 12:02:36 2021 +0800

    Threads-Log: Refine thread lock type to ERRORCHECK.

    1. Set lock attribute type to PTHREAD_MUTEX_ERRORCHECK.
    2. If dead lock, the pthread_mutex_lock return EDEADLK.
    3. We assert fail if lock failed.

commit 668c9c1
Author: winlin <winlin@vip.126.com>
Date:   Fri Mar 12 08:45:10 2021 +0800

    Threads-Log: Run hybrid server in thread.

    1. Create thread when execute by thread pool.
    2. The primordial thread check all threads status.
    3. Have not complete the cleanup and stop.

commit 831b77b
Author: winlin <winlin@vip.126.com>
Date:   Thu Mar 11 18:06:16 2021 +0800

    Threads-Log: Refine API and main workflow.

    1. Use SrsThreadPool to execute the hybrid server.
    2. Right now, directly run in primordial thread, that is no threads.
    3. Define the main APIs of SrsThreadPool.
  • Loading branch information
winlinvip committed Apr 30, 2021
1 parent d85f959 commit 39e1ce9
Show file tree
Hide file tree
Showing 58 changed files with 4,148 additions and 1,755 deletions.
66 changes: 23 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ Other important wiki:

## V5 changes

* v5.0, 2021-04-07, Threads: Support multiple hybrid threads, [#2188](https://github.com/ossrs/srs/issues/2188). 5.0.3
* v5.0, 2021-03-31, Threads: Support multiple threads with locks, [#2188](https://github.com/ossrs/srs/issues/2188). 5.0.2
* v5.0, 2021-03-17, Live: Refine edge to follow client and HTTP/302. 5.0.1
* v5.0, 2021-03-15, Init SRS/5. 5.0.0

Expand Down Expand Up @@ -1091,7 +1093,6 @@ The data for publishing RTMP was benchmarked by [SB][srs-bench]:

The data for playing HTTP FLV was benchmarked by [SB][srs-bench]:


| Update | SRS | Clients | Type | CPU | Memory | Commit |
| ------------- | --------- | ------------- | ------------- | --------- | -------- | ------------ |
| 2014-05-25 | 2.0.171 | 6.0k(6000) | players | 84% | 297MB | [code][p20] |
Expand All @@ -1105,61 +1106,40 @@ The data for playing HTTP FLV was benchmarked by [SB][srs-bench]:

The RTC benchmark data, by [srs-bench](https://github.com/ossrs/srs-bench/tree/feature/rtc#usage):


| Update | SRS | Clients | Type | CPU | Memory | Threads |
| ------------- | --------- | ------------- | ------------- | --------- | -------- | ------- |
| 2021-03-31 | 4.0.87 | 550 | publishers | ~86% | 1.3GB | 1 |
| 2021-03-31 | 4.0.87 | 800 | players | ~94% | 444MB | 1 |

> Note: CentOS7, 500Kbps, 4CPU, 2.5 GHz Intel Xeon Platinum 8163/8269CY.
| Update | Server | Clients | Type | CPU | Memory | Threads | Commit |
| ------------- | ------------ | ----- | ---------- | -------- | -------- | ----- | --------- |
| 2021-04-07 | SRS/5.0.3 | 10000 | publishers | ~90% x 32 | 28GB | 33 | [#2188](https://github.com/ossrs/srs/issues/2188#issuecomment-816309097) |
| 2021-04-20 | Janus/0.11.1 | 4000 | publishers | ~90% x 32 | 790MB | 51 | [#2629](https://github.com/meetecho/janus-gateway/pull/2629#issuecomment-822914989) |
| 2021-04-07 | SRS/5.0.3 | 3400 | publishers | ~95% x 8 | 6.3GB | 12 | [#2188](https://github.com/ossrs/srs/issues/2188#issuecomment-816309097) |
| 2021-04-20 | Janus/0.11.1 | 1500 | publishers | ~95% x 8 | 276MB | 26 | [#2629](https://github.com/meetecho/janus-gateway/pull/2629#issuecomment-822914989) |
| 2021-04-07 | SRS/5.0.3 | 2000 | publishers | ~95% x 4 | 4.1GB | 8 | [#2188](https://github.com/ossrs/srs/issues/2188#issuecomment-816309097) |
| 2021-03-31 | SRS/5.0.2 | 1400 | publishers | ~90% x 4 | 3.1GB | 6 | [#2188](https://github.com/ossrs/srs/issues/2188#issuecomment-812499542) |
| 2021-03-31 | SRS/5.0.2 | 1400 | players | ~93% x 4 | 1.0GB | 6 | [#2188](https://github.com/ossrs/srs/issues/2188#issuecomment-812499542) |
| 2021-04-20 | Janus/0.11.1 | 750 | publishers | ~90% x 4 | 142MB | 23 | [#2629](https://github.com/meetecho/janus-gateway/pull/2629#issuecomment-822914989) |
| 2021-04-20 | Janus/0.11.1 | 750 | players | ~92% x 4 | 283MB | 23 | [#2629](https://github.com/meetecho/janus-gateway/pull/2629#issuecomment-822914989) |
| 2021-03-31 | SRS/4.0.87 | 550 | publishers | ~86% x 1 | 1.3GB | 1 | |
| 2021-03-31 | SRS/4.0.87 | 800 | players | ~94% x 1 | 444MB | 1 | |

> Note: The benchmark tool for Janus is [srs-bench](https://github.com/ossrs/srs-bench/tree/feature/rtc#janus), and startup script by [janus-docker](https://github.com/winlinvip/janus-docker#usage).
<a name="latency-benchmark"></a>
**Latency benchmark**

The latency between encoder and player with realtime config([CN][v4_CN_LowLatency], [EN][v4_EN_LowLatency]):
|

| Update | SRS | VP6 | H.264 | VP6+MP3 | H.264+MP3 |
| ------------- | --------- | --------- | --------- | --------- | -------- |
| 2014-12-16 | 2.0.72 | 0.1s | 0.4s |[0.8s][p15]|[0.6s][p16]|
| 2014-12-12 | 2.0.70 |[0.1s][p13]|[0.4s][p14]| 1.0s | 0.9s |
| 2014-12-03 | 1.0.10 | 0.4s | 0.4s | 0.9s | 1.2s |
| Update | SRS | Protocol | VP6 | H.264 | VP6+MP3 | H.264+MP3 |
| ------------- | --------- | --------- | --------- | --------- | --------- | -------- |
| 2014-12-16 | 2.0.72 | RTMP | 0.1s | 0.4s |[0.8s][p15]|[0.6s][p16]|
| 2014-12-12 | 2.0.70 | RTMP |[0.1s][p13]|[0.4s][p14]| 1.0s | 0.9s |
| 2014-12-03 | 1.0.10 | RTMP | 0.4s | 0.4s | 0.9s | 1.2s |
| 2021-04-02 | 4.0.87 | WebRTC | x | 80ms | x | x |

> 2018-08-05, [c45f72e](https://github.com/ossrs/srs/commit/c45f72ef7bac9c7cf85b9125fc9e3aafd53f396f), Refine HTTP-FLV latency, support realtime mode. 2.0.252
We used FMLE as encoder for benchmark. The latency of server was 0.1s+,
and the bottleneck was the encoder. For more information, read
[bug #257][bug #257-c0].

<a name="hls-overhead"></a>
**HLS overhead**

About the overhead of HLS overhead, we compared FFMPEG and SRS.

| Bitrate | Duration | FLV(KB) | HLS(KB) | Overhead |
| ------- | -------- | ------- | -------- | --------- |
| 275kbps | 600s | 11144 | 12756 | 14.46% |
| 260kbps | 1860s | 59344 | 68004 | 14.59% |
| 697kbps | 60s | 5116 | 5476 | 7.03% |
| 565kbps | 453s | 31316 | 33544 | 7.11% |
| 565kbps | 1813s | 125224 | 134140 | 7.12% |
| 861kbps | 497s | 52316 | 54924 | 4.98% |
| 857kbps | 1862s | 195008 | 204768 | 5.00% |
| 1301kbps | 505s | 80320 | 83676 | 4.17% |
| 1312kbps | 1915s | 306920 | 319680 | 4.15% |
| 2707kbps | 600s | 198356 | 204560 | 3.12% |
| 2814kbps | 1800s | 618456 | 637660 | 3.10% |
| 2828kbps | 60s | 20716 | 21356 | 3.08% |
| 2599kbps | 307s | 97580 | 100672 | 3.16% |
| 2640kbps | 1283s | 413880 | 426912 | 3.14% |
| 5254kbps | 71s | 45832 | 47056 | 2.67% |
| 5147kbps | 370s | 195040 | 200280 | 2.68% |
| 5158kbps | 1327s | 835664 | 858092 | 2.68% |

The HLS overhead is calc by: (HLS - FLV) / FLV * 100%.

The overhead should be larger than this benchmark(48kbps audio is best overhead), for we fix the [#512][bug #512].

## Architecture

SRS always use the simplest architecture to solve complex domain problems.
Expand Down
8 changes: 6 additions & 2 deletions trunk/auto/depends.sh
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,11 @@ fi
# Affected users should upgrade to OpenSSL 1.1.0e. Users unable to immediately
# upgrade can alternatively recompile OpenSSL with -DOPENSSL_NO_HEARTBEATS.
if [[ $SRS_SSL == YES && $SRS_USE_SYS_SSL != YES ]]; then
OPENSSL_OPTIONS="-no-shared -no-threads -DOPENSSL_NO_HEARTBEATS"
# Should never disable threads by -no-threads, because we're now multiple threading.
# @see https://www.openssl.org/blog/blog/2017/02/21/threads/
# @see https://github.com/openssl/openssl/issues/2165
# @see https://curl.se/libcurl/c/opensslthreadlock.html
OPENSSL_OPTIONS="-no-shared -DOPENSSL_NO_HEARTBEATS"
OPENSSL_CONFIG="./config"
# https://stackoverflow.com/questions/15539062/cross-compiling-of-openssl-for-linux-arm-v5te-linux-gnueabi-toolchain
if [[ $SRS_CROSS_BUILD == YES ]]; then
Expand Down Expand Up @@ -523,7 +527,7 @@ if [[ $SRS_SSL == YES && $SRS_USE_SYS_SSL != YES ]]; then
fi
#
# https://wiki.openssl.org/index.php/Compilation_and_Installation#Configure_Options
# Already defined: -no-shared -no-threads -no-asm
# Already defined: -no-shared -no-asm
# Should enable: -no-dtls -no-dtls1 -no-ssl3
# Might able to disable: -no-ssl2 -no-comp -no-idea -no-hw -no-engine -no-dso -no-err -no-nextprotoneg -no-psk -no-srp -no-ec2m -no-weak-ssl-ciphers
# Note that we do not disable more features, because no file could be removed.
Expand Down
Loading

0 comments on commit 39e1ce9

Please sign in to comment.