1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

set send socket buf. mw/mr sleep default to 350.

This commit is contained in:
winlin 2014-12-05 11:24:05 +08:00
parent 4d1c162ebd
commit fad6074a25
10 changed files with 101 additions and 36 deletions

View file

@ -98,42 +98,28 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// always use fmt0 as cache.
//#define SRS_CONSTS_RTMP_MAX_FMT3_HEADER_SIZE 5
/**
* how many msgs can be send entirely.
* for play clients to get msgs then totally send out.
* for example, 25fps video, 40ms per video packet,
* while audio is 20ms per audio packet where 2/3 is audios,
* when SYS_CONSTS_MAX_PLAY_SEND_MSGS is 128, then
* we will send all 128*40ms/3=1706ms packets in a time,
* which should greater than the SRS_CONSTS_RTMP_PULSE_TIMEOUT_US
* (for example, 500ms), that is, we should:
* SYS_CONSTS_MAX_PLAY_SEND_MSGS * 40 / 3 >= SRS_CONSTS_RTMP_PULSE_TIMEOUT_US
* @remark, recomment to 128.
*/
#define SYS_CONSTS_MAX_PLAY_SEND_MSGS 128
/**
* for performance issue,
* the iovs cache, @see https://github.com/winlinvip/simple-rtmp-server/issues/194
* iovs cache for multiple messages for each connections.
* each iovc is 16bytes, sizeof(iovec)=16, suppose the chunk size is 64k,
* each message send in a chunk which needs only 2 iovec,
* so the iovs max should be (SYS_CONSTS_MAX_PLAY_SEND_MSGS * 16 * 2)
* suppose the chunk size is 64k, each message send in a chunk which needs only 2 iovec,
* so the iovs max should be (SRS_PERF_MW_MSGS * 2)
*
* @remark, SRS will realloc when the iovs not enough.
*/
#define SRS_CONSTS_IOVS_MAX (SYS_CONSTS_MAX_PLAY_SEND_MSGS * 32)
#define SRS_CONSTS_IOVS_MAX (SRS_PERF_MW_MSGS * 2)
/**
* for performance issue,
* the c0c3 cache, @see https://github.com/winlinvip/simple-rtmp-server/issues/194
* c0c3 cache for multiple messages for each connections.
* each c0 <= 16byes, suppose the chunk size is 64k,
* each message send in a chunk which needs only a c0 header,
* so the c0c3 cache should be (SYS_CONSTS_MAX_PLAY_SEND_MSGS * 16)
* so the c0c3 cache should be (SRS_PERF_MW_MSGS * 16)
*
* @remark, SRS will try another loop when c0c3 cache dry, for we cannot realloc it.
* so we use larger c0c3 cache, that is (SYS_CONSTS_MAX_PLAY_SEND_MSGS * 32)
* so we use larger c0c3 cache, that is (SRS_PERF_MW_MSGS * 32)
*/
#define SRS_CONSTS_C0C3_HEADERS_MAX (SYS_CONSTS_MAX_PLAY_SEND_MSGS * 32)
#define SRS_CONSTS_C0C3_HEADERS_MAX (SRS_PERF_MW_MSGS * 32)
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////