Re: mysql_query blocking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





Bastien

Sent from my iPod

On Jun 27, 2009, at 4:13 PM, Daniel Kolbo <kolb0057@xxxxxxx> wrote:

Ashley Sheridan wrote:
On Sat, 2009-06-27 at 16:03 -0400, Daniel Kolbo wrote:
Ashley Sheridan wrote:
On Sat, 2009-06-27 at 15:15 -0400, Daniel Kolbo wrote:
Hello,

When a MySQL table is locked a php call of mysql_query() that requires that table will hang as the request blocks at the MySQL server until the table is unlocked. Is there a way to stop a mysql_query from hanging
(by setting a time limit)?

The php.ini directive max_execution_time does not help b/c:
"Note: The set_time_limit() function and the configuration directive max_execution_time only affect the execution time of the script itself. Any time spent on activity that happens outside the execution of the script such as system calls using system(), stream operations, database queries, etc. is not included when determining the maximum time that the
script has been running."

The my.ini directive table_lock_wait_timeout does not work either b/c
from MySQL:
"This variable currently is unused. "
(I am using mysql v5.1)

I do not want to bluntly stop this from the apache level.

How does one place a time limit on the execution of mysql_query()?

Thanks for your help,
dK


It depends on what type of table you have, MyISAM blocks at table level
for instance, while InnoDB locks at row level.

Thanks
Ash
www.ashleysheridan.co.uk


I'm using InnoDB.
But either way how do you place a time limit on mysql_query()?
Thanks,
dK

I've not seen this done before, but it should only be row locking if
you're using InnoDB. What queries are you running that are affecting a
script that badly?

Thanks
Ash
www.ashleysheridan.co.uk


I issue a 'lock tables tablename write' and do some work. This is to be expected. I want a way that to stop mysql_query() from just waiting for
the mysql server.
`

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Further thought, do you have indexes on the table?


Bastien

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux