RE: Getting pages Timed Out

2002-04-18 Thread Dave Watts

 Our ColdFusion Logs show pages getting timed out - it seems 
 to happen at times of high traffic. We would like to be able 
 to troubleshoot the source of the problem.

Well, you're more likely to have timeouts during high traffic. In fact,
there might not even be a problem - for any server (or cluster of servers)
there's a maximum amount of requests that you'll be able to process.
However, it's more likely that your code is not quite optimal, and your
configuration is not quite optimal either, so you should look at both.

In the CF Administrator, you can enable the Log slow pages option to see
which scripts are taking longer than others. You can also load test your
application and find out where the bottlenecks are. Once you've tuned your
application based on the load test results, you can tune your server
environment as well.

 We have set the max number of simultaneous requests in 
 ColdFusion Administrator to 15. Supposing we have a 16th 
 simultaneous user, would they get an error message or 
 would their page time out? How does ColdFusion handle this?

As Mark Kruger has already pointed out, CF can run a set number of requests
simultaneously, and will queue any additional requests. If CF takes too long
to get to a queued request, typically the request will be timed out,
assuming you've enabled that option in the CF Administrator.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

__
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: Getting pages Timed Out

2002-04-17 Thread Mark A. Kruger - CFG

Vishal,

Ok - you caught me on a night when I'm not working and I'm in a chatty mood.

...processed simultaneous request is not  the same as simultaneous users.
It means the number of concurrent requests that CF will process.  Requests
that exceed this number are then placed in a queue and processed in a FIFO
order. So the answer is no, they would not get a timeout message.
Incidentally, 15 is probably too high in any case, unless you are on a quad
processor box. I've seen the rule of thumb written as 2x and no more than
3x the number of processors on your box.  Of course the speed of the procs
and other server resources are important as well.  In any case, another
similar setting restart after n unresponsive requests can cause the server
to restart if there are hanging requests.

As far as timing out, although you can work the administrative angle and
fiddle with your settings , you should probably go and look at the scripts
that are actually timing out and try to figure out why. That will probably
be a much more productive exercise.  Likely candidates are: large or poorly
worded database queries, overtaxed database servers or files, any external
process being used (cffile, cfmail, cfpop, COM objects, CFX etc.) and poor
application code (no locking, overuse of evaluate, nested looping etc.).

Funny anecdotal story regarding server tuning:

I did an emergency call a while back for someone who had a server that had
been responsive but was getting increasingly slower.  We turned on slow page
logging and identified the 3 or four templates that were excessively slow to
execute.  When I loaded the templates in the browser the reason they were
slow  became quickly apparent as soon as I saw the debugging information.  A
single query was taking as much as 2 minutes to complete.

The problem was bad database code. The programmer (really a designer who
dabbled), didn't know how to use the MAX( ) function in a query. To create a
primary key he was using an  integer field.  Every time he served a banner
ad he was logging to the database - but he had to figure out what the
maximum number in the database was, add +1 to it, and use that for the next
PK.

Not knowing anything but a few CF commands, he settled on the following
solution. 1) He grabbed ALL the records from the table ordered by the ID
number,  2) he used valuelist() to create a list from that ID field, and 3)
he grabbed the last item from the list using ListLast( ), and added +1 to
it. This became his new PK on the insert.  This (bad!)  code ran fine for
weeks - up until he had about 5 records in the database... then suddenly
he was bringing all the sites on the server to a screeching halt - because
the query was pulling 5 or more records for every time the page loaded.
By the time they called me in, the query was at 115,000 records - I was
frankly surprised that the database and ODBC driver and CF was even able to
handle that number of records at all (Interbase if you want to know). It was
also nice to know that CF could handle a list variable of more than 100k
(ha).

I fixed the problem by using the MAX function, then I slapped his hands and
told him NOT to program again or I would take away his dream weaver g.
Still, these ISP webmasters had adjusted the settings on the server for days
before forking over a consulting fee to have someone fix in 10 minutes what
they could have figured out for themselves if they had just stopped
administering the server long enough to load up the actual pages causing
the problem.

Wow - that's a long tome... sorry about that. It must have been a triple
scotch ha.

-mk

Mark A. Kruger, MCSE, CFG
www.cfwebtools.com
..no more brochures!





** you wrote *
We have set the max number of simultaneous requests in ColdFusion
Administrator to 15. Supposing we have a 16th simultaneous user, would they
get an error message or would their page time out ? How does ColdFusion
handle this ?

Vishal.


__
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists