What is the Net Buffer Length?

Posted on 2008-11-11
Last Modified: 2012-06-22
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!

Question by:rjohnsonjr
    LVL 142

    Accepted Solution

    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:

    LVL 26

    Assisted Solution

    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.
    LVL 6

    Author Closing Comment

    Thanks Guys!  I really appreciate it.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Suggested Solutions

    Title # Comments Views Activity
    query syntax (INNER JOIN) 18 52
    Python mysql Insert data error 3 48
    MySQL 11 46
    duplicate data not insert in mysql 46 33
    All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of.  So the topics of parsing and manipulating XM…
    As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now