EasyCFM.COM ColdFusion Forums / ColdFusion Server / CF Server is freezing - "Request timeout"

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: CF Server is freezing - "Request timeout"

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

adrianciocalau
05-17-2007 @ 4:12 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 10
Joined: Jan 2003

Hello everyone,

I am running an application - CF MX7,0,1 Enterprise (DevNet) on a Linux machine with a mySQL database in the background.
For the database connection I am using com.mysql.jdbc.Driver

I have this situation and I couldn't get to any solution so far, so I need your help:

- while browsing the application, on every few pages - maybe on every 5-6 click the CF server is freezing and throwing up this error "The request has exceeded the allowable time limit Tag: cfoutput"

The pages loads very fast (when they load!) but on every 5-6 pages a "request timeout" error occurrs... Like the server is getting a deadlock or something, the page loads forever till this. Sometimes the error comes up on very simple pages with no queries on it, sometimes with just HTML and very basic CF code on it.

I tried the debugger and SQL queries are running in good times... Do you have any clue what is causing this? I was suspecting the JDBC connection to the mySQL db, but I am not sure anymore... Did anyone got this situation before? I tried to optimze the queries, used application scope, query chaching, and so on. I have to mention I am not using CFLOCK at all in my pages, I don't know if this can cause problems like this... PLEASE HELP!

Adrian

Webmaster
05-18-2007 @ 1:54 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Administrator
Posts: 4542
Joined: Jan 2002

Hi Adrian,

  We would need to a know a lot of things before we could give you specific details.

We would need to know things like:

1) Within your CF settings... what is your timeout period defined as? (30 seconds? 60? 5?)

2) Is the database server on the same machine or on a separate machine.

     a) if same then what configurations are in place... (are you using internal IP or external IP calls ot it in the datasource - this dictates if you call internally in your network or if you go out to the internet and then comeback).

    b) if on a separate machine; what type of network for you have... how fast it it between one machine on the other... are you calling it internally using internal IPs or are you calling it externally as i mentioned above.

3) what does your QUERY code look like...

4) What level of troubleshooting have you done.. have you taken that query on a "query analyzer" type tool and ran it on the server... what is the "time to execute" value there?

5) How many records are being returned by the query that is then being output?

6) if you do the query and the DUMP it right after... does that work or does that time out too?


Those are just SOME of the questions that come to mind that we would need answered before we can help you find the issue. Please let us know and I am sure based on that responses we are probably going to have more questions.

Pablo Varando
Senior Application Architect
EasyCFM.COM, LLC.

904.483.1457 \\ mobile
webmaster@easycfm.com \\email

adrianciocalau
05-18-2007 @ 3:06 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 10
Joined: Jan 2003

Hi Pablo, and thanks for your quick answer.

I will try to provide more details, maybe you can come up with some ideas. So:

1) The timeout period is the default one, so 30 sec.
2) The database server is on the same machine as the CF server.
3) I don't think the issue comes from a certain QUERY, and like I wrote before, I am not even sure if the issue comes from the database...
4) I took all the "suspect" queries and run it into analyzer and the times are very good, few seconds each, none of them bigger than 3-4 seconds.
5) One of our biggest table has 20.000 records or something and on a regular basis we pull out 14.000 records. Of course we are using pagination for this, with only 20 on a page.

It's no secret, the website we are talking about here is www.myNETmoto.com and it is an online shop selling motorcycle tyres. Maybe you have 5 minutes to do the following test and see the timeout yourself:

1. Go to

http://www.mynetmoto.com/motorradreifen.cfm/ActiveTab/shopping/ActiveLink/1/Search/1/breite/120/hoehe/70/felge/all/hersteller/all/StartRow/0/motorradreifen.html

This will perform a search for the most common size of motorcycle tyres, and it will return around 200 records.

2. Now, keep clicking NEXT button to go from page to page and let me know after how many clicks you got the timeout. After me, it is working pretty fast when it's not timing out, but at some point something is happening and we get the timeout thing...

Below you can see execution times for one of these pages:

658 ms 658 ms 1  /chroot/home/mynetmot/mynetmoto.com/html/motorradreifen.cfm

4 ms 4 ms 1 /chroot/home/mynetmot/mynetmoto.com/html/Application.cfm

1 ms 1 ms 1 /chroot/home/mynetmot/mynetmoto.com/html/_bottom.cfm

0 ms 0 ms 14 /chroot/home/mynetmot/mynetmoto.com/html/_button.cfm

0 ms 0 ms 2 /chroot/home/mynetmot/mynetmoto.com/html/_button_yellow.cfm

0 ms 0 ms 1 /chroot/home/mynetmot/mynetmoto.com/html/_getStock.cfm

0 ms 0 ms 1 /chroot/home/mynetmot/mynetmoto.com/html/_top.cfm

0 ms 0 ms 10 /chroot/home/mynetmot/mynetmoto.com/html/_traffic.cfm

0 ms 0 ms 1 /chroot/home/mynetmot/mynetmoto.com/html/_warenkorb.cfm

0 ms 0 ms 1 /chroot/home/mynetmot/mynetmoto.com/html/en/lang.cfm

0 ms 0 ms 1 /chroot/home/mynetmot/mynetmoto.com/html/includes/checksessions.cfm

0 ms 0 ms 1 /chroot/home/mynetmot/mynetmoto.com/html/includes/copyright.cfm

0 ms 0 ms 1 /chroot/home/mynetmot/mynetmoto.com/html/includes/functions.cfm

0 ms 0 ms 1 /chroot/home/mynetmot/mynetmoto.com/html/sesconverter.cfm

4 ms   STARTUP, PARSING, COMPILING, LOADING, & SHUTDOWN

666 ms   TOTAL EXECUTION TIME

And the biggest QUERY execution time was:
- execution time     134ms

SirRawlins
05-18-2007 @ 4:13 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 951
Joined: Mar 2006

Hey buddy,

I've just given that a go, and you're right, I got as far as page 9 before it fell over, gave it a quick refresh and it was fine. Now, A couple of small observations I'd like to make about your comments above.

'One of our biggest table has 20.000 records or something and on a regular basis we pull out 14.000 records. Of course we are using pagination for this, with only 20 on a page.'

Can you just clarify for me how the pagination is working here? are you pulling all 14,000 records in the query and then using cf to crop that down to the selection you want? from the way you worded that it sounds to be that way, in which case you may want to consider only pulling the 20 or so records you need for each page, that'll take a massive strain off of the cf server.

Next, on the page when i got the time out, in the example of the <cfoutput> code that was causing you beef, it also showed a cfprocessingdirective tag, is there any particular reason this is in there? I've not used that tag before for anything other than whitespace suppression, is there any reason to suggest that maybe THAT is whats hanging your output block?

Rob

adrianciocalau
05-18-2007 @ 4:40 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 10
Joined: Jan 2003

I am using SQL ... LIMIT x,y tag followed by a SELECT COUNT to do the pagination, so don't worry, I am not pulling out all the records from the database and just display part of them.

About the CFPROCESSINGDIRECTIVE, I am using this because the website is working in so many languages and for some of them - like German, Finish, and few others - you need to specify the encoding for every page in order to get the special characters displayed correctly.

Adrian.

SirRawlins
05-18-2007 @ 6:14 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 951
Joined: Mar 2006

Ok, great,

Well that rules out a few potential problems. I'd be keen to see a little more of your code. The <cfoutput> that it showed as causing the issue didnt appear to have a 'query' attribute, is it definitly the output of the query thats causing the issue? are you outputing an complicated math on any data?

It would help to see a little more of your code i think. Also, is it only when viewing the product catalouge that you get this issue? or does it happen on other areas of the site? just helps narrow down which exact template is causing the problem.

Thanks,

Rob

adrianciocalau
05-18-2007 @ 6:41 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 10
Joined: Jan 2003

That's the problem... I don't know for sure which file is causing the problem. And I didn't say for sure a query is causing the problem. Is not always stopping on a query tag.

The website is on production so maybe is possible that other user request is causing the server to freeze and your request is affected, too?

I don't know how bad is this, but I use to <cfoutput></cfoutput> the entire page content... So I usually open <cfoutput> on top and close it at the end of the page, or I close it just before a <cfoutput query=""> and open a new one after the closing output tag of the query loop.

Adrian.

This message was edited by adrianciocalau on 5-18-07 @ 6:48 AM

SirRawlins
05-18-2007 @ 11:44 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 951
Joined: Mar 2006

Well this is only my thoughts, but I generaly dont just cfoutput the entire page, I'm a sure there is probably a reason why you shouldnt do this, but i wouldnt have thought it is whats causing your issue.

I'm also quite sure now that this isnt a query issue as when I was running it I definatly got issues with a cfoutput tag.

It's hard to be able to diagnose this any further without seeing any code, but at the moment the most important thing would be to narrow down which template is causing your problems, start by commenting out all the non essential includes, such as navicgation and things like that, keep going as far as you can untill the problem stops, you'll then have pin-pointed the problem, this is really the only way to diagnose a problem like this.

Rob

adrianciocalau
05-21-2007 @ 3:57 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 10
Joined: Jan 2003

Hey,

I finally find and fixed the problem! Everything was related to the fact I was not LOCKING the APPLICATION variables when setting and reading.

I had three or four queries - used very often and changed very rare - stored in APPLICATION variables. I was setting up them in the Application.cfm then use them all over. After I used the CFLOCK tag in Application.cfm and a small trick found on the Google, everything is working perfect.

Adrian.


Website Designed and Developed by Pablo Varando.