digitalmars.D - std.socket
- Steve Teale (5/5) Nov 02 2011 Who is the resident expert? Sean maybe?
- Jens Mueller (8/14) Nov 02 2011 auto sizeInBytes = 10 * 2^^20;
- Steve Teale (5/9) Nov 02 2011 Yes Jens, that's what I thought, and that approach does indeed change th...
- Regan Heath (13/21) Nov 02 2011 What operating system are you on?
- Steve Teale (9/24) Nov 02 2011 I'm using Ubuntu i386. I just thought that since MySQL talks blithely
- Sean Kelly (6/13) Nov 02 2011 I suspect that MySQL's "packet size" has no relation to TCP packet size....
- Steve Teale (3/13) Nov 02 2011 Yes Sean, I'm sure from what I've seem that that is the case. They're
- Jens Mueller (4/19) Nov 03 2011 Shouldn't we anyway write a bug report for std.socket? Yesterday I tried
- Jens Mueller (11/19) Nov 02 2011 I'm looking into std.socket.setOption at the moment.
- Jens Mueller (6/13) Nov 03 2011 I found what's causing this behavior (see man 7 socket (search for
- Steve Teale (4/10) Nov 03 2011 Yup, I got there too, so I've dropped the idea.
Who is the resident expert? Sean maybe? How do I get the receive buffer size up into the megabytes range for use between the D client and localhost. setOption seems to only get me about 262k. Steve
Nov 02 2011
Steve Teale wrote:Who is the resident expert? Sean maybe? How do I get the receive buffer size up into the megabytes range for use between the D client and localhost. setOption seems to only get me about 262k.How do you do it?From the documentation I would expect thatauto sizeInBytes = 10 * 2^^20; mySocket.setOption(SocketOptionLevel.SOCKET, SocketOption.RCVBUF, sizeInBytes); should set it to 10 MiB; I'm unsure about the socket option level. There is also SocketOptionLevel.IP. Jens
Nov 02 2011
On Wed, 02 Nov 2011 17:17:07 +0100, Jens Mueller wrote:should set it to 10 MiB; I'm unsure about the socket option level. There is also SocketOptionLevel.IP.Yes Jens, that's what I thought, and that approach does indeed change the buffer size, but not by anything close to what you ask for. I've tried both SOCKET and IP. Steve
Nov 02 2011
On Wed, 02 Nov 2011 16:35:25 -0000, Steve Teale <steve.teale britseyeview.com> wrote:On Wed, 02 Nov 2011 17:17:07 +0100, Jens Mueller wrote:What operating system are you on? This may be of interest (even if you're not on windows, as it references some RFCs etc which may have some bearing on how things work on your OS): http://msdn.microsoft.com/en-us/library/ms819736.aspx Also, this thread mentions fpathconf() which I've not heard of before (probably because it's more of a UNIX thing?): http://stackoverflow.com/questions/565804/max-value-for-so-rcvbuf-in-windows .. why do you want/need such a large TCPIP recv buffer? Regan -- Using Opera's revolutionary email client: http://www.opera.com/mail/should set it to 10 MiB; I'm unsure about the socket option level. There is also SocketOptionLevel.IP.Yes Jens, that's what I thought, and that approach does indeed change the buffer size, but not by anything close to what you ask for. I've tried both SOCKET and IP.
Nov 02 2011
On Wed, 02 Nov 2011 16:45:30 +0000, Regan Heath wrote:windowsYes Jens, that's what I thought, and that approach does indeed change the buffer size, but not by anything close to what you ask for. I've tried both SOCKET and IP.What operating system are you on? This may be of interest (even if you're not on windows, as it references some RFCs etc which may have some bearing on how things work on your OS): http://msdn.microsoft.com/en-us/library/ms819736.aspx Also, this thread mentions fpathconf() which I've not heard of before (probably because it's more of a UNIX thing?): http://stackoverflow.com/questions/565804/max-value-for-so-rcvbuf-in-.. why do you want/need such a large TCPIP recv buffer?I'm using Ubuntu i386. I just thought that since MySQL talks blithely about packet sizes of 16mb I would investigate how my protocol interface performs with large buffers and large BLOBS. I believe Ubuntu imposes the buffer size limitation and you have to mess with kernel configuration files to change that. But I don't want to go there and wondered if I was missing some simple point. Steve
Nov 02 2011
On Nov 2, 2011, at 9:59 AM, Steve Teale wrote:On Wed, 02 Nov 2011 16:45:30 +0000, Regan Heath wrote: =20.. why do you want/need such a large TCPIP recv buffer?=20 I'm using Ubuntu i386. I just thought that since MySQL talks blithely=20=about packet sizes of 16mb I would investigate how my protocol =interface=20performs with large buffers and large BLOBS.I suspect that MySQL's "packet size" has no relation to TCP packet size. = Their max_packet_size is probably actually a max_request_size? Even if = you had a huge TCP buffer, the MTU used by the network (typically 1500 = bytes) would break a MySQL "packet" into multiple TCP packets.=
Nov 02 2011
On Wed, 02 Nov 2011 16:17:12 -0700, Sean Kelly wrote:On Nov 2, 2011, at 9:59 AM, Steve Teale wrote:Yes Sean, I'm sure from what I've seem that that is the case. They're logical packets, and I shall stop worrying about it.On Wed, 02 Nov 2011 16:45:30 +0000, Regan Heath wrote:I suspect that MySQL's "packet size" has no relation to TCP packet size. Their max_packet_size is probably actually a max_request_size? Even if you had a huge TCP buffer, the MTU used by the network (typically 1500 bytes) would break a MySQL "packet" into multiple TCP packets... why do you want/need such a large TCPIP recv buffer?
Nov 02 2011
Steve Teale wrote:On Wed, 02 Nov 2011 16:17:12 -0700, Sean Kelly wrote:Shouldn't we anyway write a bug report for std.socket? Yesterday I tried doing it by hand using setsockopt but even that didn't not work. JensOn Nov 2, 2011, at 9:59 AM, Steve Teale wrote:Yes Sean, I'm sure from what I've seem that that is the case. They're logical packets, and I shall stop worrying about it.On Wed, 02 Nov 2011 16:45:30 +0000, Regan Heath wrote:I suspect that MySQL's "packet size" has no relation to TCP packet size. Their max_packet_size is probably actually a max_request_size? Even if you had a huge TCP buffer, the MTU used by the network (typically 1500 bytes) would break a MySQL "packet" into multiple TCP packets... why do you want/need such a large TCPIP recv buffer?
Nov 03 2011
Steve Teale wrote:On Wed, 02 Nov 2011 17:17:07 +0100, Jens Mueller wrote:I'm looking into std.socket.setOption at the moment. There is (&value)[0 .. 1] where value is an int32_t. Then setsockopt is called using this void[] array. I wonder what this code (&value)[0 .. 1] does and I don't how the argument to setsockopt needs to be (need to consult the manual). Maybe it's an endianess issue. In sum, besides the above code setOption is a direct wrapper around setsockopt. Jensshould set it to 10 MiB; I'm unsure about the socket option level. There is also SocketOptionLevel.IP.Yes Jens, that's what I thought, and that approach does indeed change the buffer size, but not by anything close to what you ask for. I've tried both SOCKET and IP.
Nov 02 2011
Steve Teale wrote:Who is the resident expert? Sean maybe? How do I get the receive buffer size up into the megabytes range for use between the D client and localhost. setOption seems to only get me about 262k. SteveI found what's causing this behavior (see man 7 socket (search for SO_RCVBUF)). The maximum value is specified in /proc/sys/net/core/rmem_max. On my system it's 131071. Jens
Nov 03 2011
On Thu, 03 Nov 2011 10:24:19 +0100, Jens Mueller wrote:I found what's causing this behavior (see man 7 socket (search for SO_RCVBUF)). The maximum value is specified in /proc/sys/net/core/rmem_max. On my system it's 131071. JensYup, I got there too, so I've dropped the idea. Thanks for helping. Steve
Nov 03 2011