admin管理员组文章数量:1296421
I was making a http server in c and this came to mind. Im not sure if it's possible to recieve unlimited bytes.
The server just gets the path and sends the requiered file, so in this case i dont think it needs a very big buffer, so i used a c string with the size of 2048 bytes of data for the buffer, but im still in doubth.
I was making a http server in c and this came to mind. Im not sure if it's possible to recieve unlimited bytes.
The server just gets the path and sends the requiered file, so in this case i dont think it needs a very big buffer, so i used a c string with the size of 2048 bytes of data for the buffer, but im still in doubth.
Share asked Feb 11 at 23:34 danilogames220danilogames220 256 bronze badges 1- If you're only receiving GET requests you don't need a bigger buffer. – user207421 Commented Feb 12 at 3:03
1 Answer
Reset to default 0Every server has a maximum length for request lines. I guess per default it is 8 kB and can be configured. For stability and security reasons this is not open. See https://httpd.apache./docs/2.4/mod/core.html#limitrequestfieldsize This buffer is used to read and parse the request.
Just in case your question was more related tot the response: The response buffer just needs to decouple response computing time from response sending time. It is a tradeoff between speed and memory footprint, and you might want to tune it related to your bandwith, available memory and number of parallel requests and the response sizes.
本文标签: webserverwhat is the ideal buffer size to recieve data for a http serverStack Overflow
版权声明:本文标题:webserver - what is the ideal buffer size to recieve data for a http server? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741628975a2389246.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论