|
|
|
|
|
by pthatcherg
4674 days ago
|
|
As far as I know, the only issue with large messages is that while they are being sent, they'll reside in memory. But that's true even if you break up the message into smaller pieces and call send() in smaller chunks all at once. So, it's really a matter how much data you pass to the browser via send() calls at any time. The more you do, the more gets buffered in memory. I'm not really sure what is optimal for chunk size, but I think the real target is about keeping the buffered amount low, but non-zero. Lower means less memory used, but zero means you missed out on bandwidth you could have used. Choosing a chunk size probably doesn't have a large impact on that, but you won't know for sure until you try different sizes. It would be interesting to see an article that experiments with different sizes and different buffered amounts and tests the results. |
|