Revenue Source

Welcome to the Revenue Source affiliate marketing forums.

You are viewing our internet marketing and SEO forums as a guest which gives you limited access to most of our discussions.  By joining our free community, you will have access to post affiliate marketing topics, communicate privately with other members (PM), exchange SEO strategies, and access many other special features.  Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems, please don't hesitate to contact us.

Go Back   Revenue Source > Site Design & Development > Databases
Reload this Page MySQL net_write_timeout vs wait_timeout and protocol notes
Tags: , , , ,

Reply
 
LinkBack Thread Tools Search this Thread
Old
  (#1 (permalink))
Affiliate Blogs is Offline
Revenue Source Veteran
Affiliate Blogs has a brilliant future here!
 
Affiliate Blogs's Avatar
 
Join Date: Oct 2005
Posts: 9,153
Jack of All Trades
CyberSpace United States
   
MySQL net_write_timeout vs wait_timeout and protocol notes - 07-08-2007

In my previous post I mentioned you might need to increase net_write_timeout to avoid connection being aborted and now I think I should have better explained that.
MySQL uses a lot of different timeout variables at different stages. For example when connection is just being established connect_timeout is used. When server waits for another query to be sent to it wait_timeout
(or interactive_timeout for applications which specified they are interactive during connection). This value is rather large as it is rather typical for some applications to have long delays between queries.
If query is being read or result set is being sent back, much shorter net_read_timeout and net_write_timeout are used.
net_read_timeout rarely becomes the problem unless you have extremely poor network, but when you’re in trouble anyway, because in most cases query is generated and sent as single packet to the server and application can’t switch doing something else and leaving server with partial query received.
Result set however comes back in multiple pieces and if you’re using mysql_use_result you can do any work between fetches, which potentially could take a lot of time, so increasing net_write_timeout could be the good idea.
This for example typical cause of aborted connections while using Sphinx with large data sets and large buffers. While indexing Sphinx performs sorts and flushes buffers to the disk every so often which can take long enough to trigger default net_write_timeout on the server side.
You could ask why server does not do any flow control and can’t find out client just is just busy and it is not network issue - well this comes from simplicity of MySQL protocol which does not allow client to talk to the server until full result set is fetched. This is also the reason why you can’t stop fetching for ordinary statements and mysql_free_result will have to complete the fetch internally.
Is there any way to tell the server you need more time besides increasing net_write_timeout ? Not what I know of. You can’t use something like mysql_ping because connection is in the stage of getting the data. You can’t even fetch couple of rows every few seconds to show you’re fetching data because there is buffering happening inside MySQL client library so you never know when real network read will happen.
As net_write_timeout and net_read_timeout are session level variables you can simply change them per connections for connections which could have timeout issues otherwise without affecting the rest of the server, so it seems like fine solution.


MySQL net_write_timeout vs wait_timeout and protocol notes - Read More...
  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads for: MySQL net_write_timeout vs wait_timeout and protocol notes
Thread Thread Starter Forum Replies Last Post
PHP Author Notes Affiliate Blogs Programming Help 0 05-07-2007 05:23 PM
UC2007 Presentation and Notes Affiliate Blogs Databases 0 05-03-2007 05:10 AM
Affiliate Summit On ReveNews Day 5: Last Minute Show Notes Affiliate Blogs Affiliate Marketing 0 01-19-2007 03:34 PM
Zend Developer Zone: Notes from the Web Builder 2.0 Conference Affiliate Blogs Programming Help 0 12-15-2006 03:46 PM
WebReferece.com: How to Use the HTTP Protocol Affiliate Blogs Programming Help 0 11-28-2006 05:08 AM



© 2004-6 RevenueSource.com.  All rights reserved.  Do not duplicate or redistribute in any form.
This website and its logos/design are property of RevenueSource.com.  All rights reserved. vBSEO 3.2.0 RC7


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34