Forum Moderators: coopster

Message Too Old, No Replies

Query Timing Out

Can HTACCESS adjust this?

         

inveni0

9:13 pm on Mar 13, 2007 (gmt 0)

10+ Year Member



Does anyone know if HTACCESS can adjust the length of time a server will allow a command to run?

I have a query that stops after 50k rows, and I need it to pull 300k. (I don't care how long it takes...)

coopster

9:18 pm on Mar 13, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



If you are referring to a PHP script, have a look at set_time_limit [php.net].

eelixduppy

9:21 pm on Mar 13, 2007 (gmt 0)



Also make sure to fully optimize your table. Assuming MySQL, here's the doc: Optimization [dev.mysql.com]

inveni0

5:30 pm on Mar 14, 2007 (gmt 0)

10+ Year Member



What if it reaches the max_execution_time value defined in the php.ini?

Can this be 'hacked' with HTACCESS or some other means?

inveni0

6:56 pm on Mar 14, 2007 (gmt 0)

10+ Year Member



I tried:

php_value max_execution_time 10

in a .htaccess file. Didn't shorten the time.

I also tried:

ini_set("max_execution_time", "1000");

at the beginning of the PHP file.

joelgreen

7:59 pm on Mar 14, 2007 (gmt 0)

10+ Year Member



per php documentation set_time_limit does only affect php script. It disregards mysql queries, processes run with exec, etc.

There is some Apache directive which limits, cannot remember it though.

Update:
Apache TimeOut directive will not work. It is for uploads. (by default, timeout is 400 seconds).

I have a query that stops after 50k rows, and I need it to pull 300k. (I don't care how long it takes...)

What are you doing with them? Output to html, saving in php array?
Maybe is is some kind of "memory exhausted" issue.

There is memory_limit directive in php. Maybe script is trying to use more than that?

Mysql could also timeout:
[dev.mysql.com...]

inveni0

6:27 pm on Mar 15, 2007 (gmt 0)

10+ Year Member



Thanks for the info, everyone. Is there a way to alter how long a query can run?