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

limit the user-space buffer size to 128KB, 128MB for 1k publishers.

This commit is contained in:
winlin 2014-12-04 22:00:09 +08:00
parent 76af04c55d
commit 98647d6e67
2 changed files with 17 additions and 5 deletions

View file

@ -429,7 +429,8 @@ void SrsPublishRecvThread::set_socket_buffer(int sleep_ms)
// sleep 800ms for small bytes, the buffer should set to:
// 800*1000/8=100000B(about 128KB).
// 2000*3000/8=750000B(about 732KB).
int kbps = 3000;
// 2000*5000/8=1250000B(about 1220KB).
int kbps = 5000;
int socket_buffer_size = sleep_ms * kbps / 8;
// socket recv buffer, system will double it.