Page not found error after 30-60 seconds

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
netgezgini
Forum Newbie
Posts: 9
Joined: Mon Aug 17, 2009 1:26 pm

Page not found error after 30-60 seconds

Post 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
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Page not found error after 30-60 seconds

Post 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.
netgezgini
Forum Newbie
Posts: 9
Joined: Mon Aug 17, 2009 1:26 pm

Re: Page not found error after 30-60 seconds

Post by netgezgini »

I already did it, it doesnt give any error message, it just shows "page not found " error message. that's it.
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Page not found error after 30-60 seconds

Post by califdon »

I would say that your script is not generating any output to send to the browser.
netgezgini
Forum Newbie
Posts: 9
Joined: Mon Aug 17, 2009 1:26 pm

Re: Page not found error after 30-60 seconds

Post 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
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: Page not found error after 30-60 seconds

Post 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?
netgezgini
Forum Newbie
Posts: 9
Joined: Mon Aug 17, 2009 1:26 pm

Re: Page not found error after 30-60 seconds

Post 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
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Page not found error after 30-60 seconds

Post by John Cartwright »

post your query, and post the results of EXPLAIN too.
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: Page not found error after 30-60 seconds

Post 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
netgezgini
Forum Newbie
Posts: 9
Joined: Mon Aug 17, 2009 1:26 pm

Re: Page not found error after 30-60 seconds

Post 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.
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: Page not found error after 30-60 seconds

Post 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.
netgezgini
Forum Newbie
Posts: 9
Joined: Mon Aug 17, 2009 1:26 pm

Re: Page not found error after 30-60 seconds

Post 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
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: Page not found error after 30-60 seconds

Post 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.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Page not found error after 30-60 seconds

Post 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:
Post Reply