phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

Setting timeout on individual queries or functions - or...


 
Search this topic... | Search phpBB2 Discussion... | Search Box
Register or Login to Post    Index » phpBB2 Discussion  Previous TopicPrint TopicNext Topic
Author Message
JLA
Board Member



Joined: 30 Apr 2009

Posts: 298
Location: U.S.A


flag
PostPosted: Sat Jul 13, 2013 4:26 pm 
Post subject: Setting timeout on individual queries or functions - or...

Anyway to set (using PHP) a timeout on individual mysql query so

PHP makes query to mysql DB. If no result is returned within 30 seconds, php moves on and and acts if the query is return empty? Don't want to set this globally as there are some queries that might require a longer time. Just would like to do it for individual queries. Also would be good if the query wasn't finished within the timeout period, a kill command would be issued for that query to mysql so the particular connection is close.

If not another option is a way to check for a crashed or otherwise unavailable table that the query would be ran against. If crashed or unavailable, the query is skipped and php moves on.

_________________
http://www.jlaforums.com
Back to top
Dog Cow
Board Member



Joined: 18 Nov 2008

Posts: 378


flag
PostPosted: Mon Jul 15, 2013 10:27 pm 
Post subject: Re: Setting timeout on individual queries or functions - or.

I've tried to research myself how it would be done. My conclusion is that it's impossible to do in PHP which is single-threaded and the mysqli client library where all the queries are blocking requests.

Look into the mysql_unbuffered_query for your further interest, though.

_________________
Moof!
Lincoln's Tomb, Oak Ridge Cemetery, Springfield IL Mac 512K Blog Mac GUI
Back to top
JLA
Board Member



Joined: 30 Apr 2009

Posts: 298
Location: U.S.A


flag
PostPosted: Wed Jul 17, 2013 3:12 am 
Post subject: Re: Setting timeout on individual queries or functions - or.

Dog Cow wrote:
I've tried to research myself how it would be done. My conclusion is that it's impossible to do in PHP which is single-threaded and the mysqli client library where all the queries are blocking requests.

Look into the mysql_unbuffered_query for your further interest, though.


Thanks

_________________
http://www.jlaforums.com
Back to top
Display posts from previous:   
Register or Login to Post    Index » phpBB2 Discussion  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0101 seconds using 15 queries. (SQL 0.0021 Parse 0.0002 Other 0.0078)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo