Page 1 of 1

Page not found error after 30-60 seconds

Posted: Mon Aug 17, 2009 1:31 pm
by netgezgini
I have very weird problem. if page takes about 30-60 seconds to load, it takes me to "page not found" page. I checked php.ini settings and execution time is 300 seconds and i increased all limits. I dont know whats wrong with it but i realized that it is something with mysql because i get this error message on report pages which have complex and long queries. I checked my indexes and queries to fasten them but everything is ok. I think mysql has something with it but i couldnt find any configuration about it. anyone has idea about how to solve this problem? thanks

Re: Page not found error after 30-60 seconds

Posted: Mon Aug 17, 2009 2:08 pm
by califdon
Let PHP and MySQL help you. Turn on error reporting in PHP and use mysql_error() whenever you send SQL or commands to MySQL. If you don't know how to do this, look it up in the manual or with Google. You can't solve programming problems unless you know what is failing and why.

Re: Page not found error after 30-60 seconds

Posted: Mon Aug 17, 2009 2:13 pm
by netgezgini
I already did it, it doesnt give any error message, it just shows "page not found " error message. that's it.

Re: Page not found error after 30-60 seconds

Posted: Mon Aug 17, 2009 2:28 pm
by califdon
I would say that your script is not generating any output to send to the browser.

Re: Page not found error after 30-60 seconds

Posted: Mon Aug 17, 2009 3:25 pm
by netgezgini
When I limit query like LIMIT 100, it shows the page but when i query all of them without using any limit, it shows loading about 30-60 seconds and then it goes to "page not found" page. if there is any error with script, it won't work with 100 rows either

Re: Page not found error after 30-60 seconds

Posted: Mon Aug 17, 2009 3:27 pm
by Eran
When I limit query like LIMIT 100, it shows the page but when i query all of them without using any limit
warning lights, anyone?

if you've gotten this far, it obviously has something to do that. what is the purpose of that query, and why do you want to retrieve the entire table? (please post the query here as well). Gut feeling tells me this long execution is a very long running loop. Are you iterating over the results of this query perhaps?

Re: Page not found error after 30-60 seconds

Posted: Mon Aug 17, 2009 6:45 pm
by netgezgini
it is not so long but it needs time to complete it, there are about 4000 items and i want to pull sales report. this is just example, i have 3-5 reports like this one. I tried it on my local server and it worked out fine, there is no running loop. probably mysql stops it after 30-60 seconds or something. I tried up to 2000 items and it worked but over it, it doesnt work because it takes more than 60 seconds

Re: Page not found error after 30-60 seconds

Posted: Mon Aug 17, 2009 6:49 pm
by John Cartwright
post your query, and post the results of EXPLAIN too.

Re: Page not found error after 30-60 seconds

Posted: Mon Aug 17, 2009 6:49 pm
by Eran
retrieving 4000 rows by itself shouldn't take very long. it is very likely something in the script that handles the rows. how are you building the reports without iterating over the data?

and please post your query and EXPLAIN results on it

Re: Page not found error after 30-60 seconds

Posted: Mon Aug 17, 2009 9:25 pm
by netgezgini
i wonder why you are so insistent about query. it is not about query. if it was why does it work with 100 rows? i am telling you if it takes less then 60 seconds it works, otherwise it doesnt. i have about 30 reports, 3-5 of them which take over 60 seconds to load have this problem, others work. i think none of you has any idea about it. it is not php coding or mysql query problem. thats why i posted this topic under installation and configuration.

Re: Page not found error after 30-60 seconds

Posted: Mon Aug 17, 2009 9:54 pm
by jackpf
Well if it works for 100 rows, but not more then it obviously is a mysql (or php) problem!!!!!

People here are trying to help you. From what I can see, you're refusing to provide the information requested, and then suggesting you know more about your problem than they do. If that's the case, go and figure it out yourself.

If not, then post the queries pytrin and John Cartwright asked for, and I'm sure they'll try and help.

But 3-5 rows taking 60 seconds makes me believe there is something wrong with your query too. 3 against 1.

Re: Page not found error after 30-60 seconds

Posted: Tue Aug 18, 2009 10:42 am
by netgezgini
I talked to server guy. he said it is for protection. it cuts the transaction after 60 seconds to protect server against hack attacks. he increased it to 180 for my account and now all my reports and QUERIES work fine. 1 against 3. thanks all. i am done here

Re: Page not found error after 30-60 seconds

Posted: Tue Aug 18, 2009 10:59 am
by jackpf
So uhh..it was the queries. They were taking to long. If you weren't so arrogant maybe people here could help you optimise them.

And anyway, how is anyone here supposed to know your server configuration except you?? You're the one at fault here.

Re: Page not found error after 30-60 seconds

Posted: Tue Aug 18, 2009 11:56 am
by John Cartwright
3 minutes for a ~4000 row query is extremely long. Increasing the timeout is a hack at best and should reconsider optimizing your queries.

... to each his own I guess :crazy: