• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4849
  • Last Modified:

What is the Net Buffer Length?

Hello,  I cannot find any real documentation on the net_buffer_length that explains it to me in a clear concise way.

What is it exactly?  How do I go about setting a decent value for it?

Also what about max_allowed_packet? I did find some docs on that, and it seems to me that it should be set to the max size that could be returned from a query ??

Thank You!

2 Solutions
Guy Hengel [angelIII / a3]Billing EngineerCommented:
as for the mysqldump reference:

that setting defines how much data is prepared into a buffer, to be going over the net, before actually going over the network in a whole.

say your query will return 10K of data, with net_buffer_length set to 2K.
that means mysql will have to fill 5x that buffer, and between each filling, it has to wait for the buffer data being actually send over the net.

so, the larger that value, the less often mysql has to wait for sending.
however, the larger that value, the longer the client has to wait for intermediate data results, eventually.

that setting is a compromise between database and network speed, and is part of the fine-tuning tools.

the default value is 16K:

in regards to the max_allowed_packet:

If 'angellll' has added a comment, then assume that it's more than enough than the actual document.

This is what Manual says about - net_buffer_length

Each client thread is associated with a connection buffer and result buffer. Both begin with a size given by net_buffer_length but are dynamically enlarged up to max_allowed_packet bytes as needed. The result buffer shrinks to net_buffer_length after each SQL statement.

This variable should not normally be changed, but if you have very little memory, you can set it to the expected length of statements sent by clients. If statements exceed this length, the connection buffer is automatically enlarged. The maximum value to which net_buffer_length can be set is 1MB.
rjohnsonjrAuthor Commented:
Thanks Guys!  I really appreciate it.

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now