httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juan Rivera <>
Subject Reusing buffers when reading from socket
Date Thu, 20 Mar 2003 15:08:15 GMT
In the socket_bucket_read function (apr_bucket_socket.c) it reads from the
socket using an 8K buffer.
Now, if you only get 100 bytes, the rest of the buffer is wasted. Right?
I guess HTTP typically gets large chucks of data at a time but when
implementing other protocols this 8K buffer might be inefficient.
I wonder if there could be a generic way to solve this problem. I was
thinking that when the socket bucket gets small chunks of data (<100 bytes),
it will hold that bucket and it will reuse it next time., creating a
refcount bucket pointing to the same buffer but with an offset start.
This way, memory will be used more efficiently when you are getting small
chunks of data at a time. When you get large chunks of data it will behave
just like it does today.
Has anybody looked into this before?


Juan C. Rivera

Citrix Systems, Inc

Tel: (954)229-6391

View raw message