By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,689 Members | 1,109 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,689 IT Pros & Developers. It's quick & easy.

Script timed out, error ASP 0113???

P: n/a
I sometimes get this error after about 60 seconds of "waiting for
mazes.com" (but when the page works, it usually loads in less than 12
seconds).
Active Server Pages error 'ASP 0113'
Script timed out
/asp-maze/amazingtest.asp
The maximum amount of time for a script to execute was exceeded. You can
change this limit by specifying a new value for the property Server.ScriptTimeout
or by changing the value in the IIS administration tools.


but if I click refresh, I usually get the page.

There is a very remote chance that there might be a loop causing this
problem, but I don't think so. I've added timer-checks to the loops
that might cause a problem, and have added other escape methods to
other places that I think have caused the problem.

My questions:

1) Can the system be set to tell what line of the program was executing
when it timed out? (This would certainly help figure out if there's a
particular place that is causing an occasional problem). I'd have to
tell my hosting person how to do it, so be specific if you can.

2) Could this be caused by too many people accessing ASP pages at the
same time? How would he increase the number of users allowed to be
loading pages simultaneously?

3) What steps would he use to reduce the time for this parameter, or
should I reduce it. 60 seconds seems awfully long, but I do have
another page that I

John

Jan 12 '06 #1
Share this Question
Share on Google+
11 Replies


P: n/a
www.MessageMazes.com wrote:
I sometimes get this error after about 60 seconds of "waiting for
mazes.com" (but when the page works, it usually loads in less than 12
seconds).
Active Server Pages error 'ASP 0113'
Script timed out
/asp-maze/amazingtest.asp
The maximum amount of time for a script to execute was exceeded. You
can
change this limit by specifying a new value for the property
Server.ScriptTimeout or by changing the value in the IIS
administration tools.
but if I click refresh, I usually get the page.

There is a very remote chance that there might be a loop causing this
problem, but I don't think so. I've added timer-checks to the loops
that might cause a problem, and have added other escape methods to
other places that I think have caused the problem.

My questions:

1) Can the system be set to tell what line of the program was
executing when it timed out?


Not that I know of. You will need to add some logging functionality to your
application so you can see what was happening.
2) Could this be caused by too many people accessing ASP pages at the
same time? How would he increase the number of users allowed to be
loading pages simultaneously?
Maybe. What is occurring in that loop?

3) What steps would he use to reduce the time for this parameter, or
You can do it yourself by adding a
Server.ScriptTimeout = 120

command in your page. Not that I recommend doing this ...
should I reduce it. 60 seconds seems awfully long, but I do have
another page that I


John? John?? Are you ok? OMIGOD, JOHN'S BEEN KIDNAPPED BY ALIENS!! ;-)

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jan 12 '06 #2

P: n/a
Bob Barrows [MVP] wrote:
should I reduce it. 60 seconds seems awfully long, but I do have
another page that I


John? John?? Are you ok? OMIGOD, JOHN'S BEEN KIDNAPPED BY ALIENS!! ;-)


Oh wait. False alarm. He hit another timeout, right?
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jan 12 '06 #3

P: n/a
Dude, have you seen john? It's been like atleast 61 seconds.
I'm beginning to get worried. My cats disappeared in a wind-
storm at the same time he disappeared. -_wierd_- no?
Lets see what an error 0113 is...

maximum amount of time that a script can run before it is
terminated. The error is generated when the processing time
of the script exceeds the maximum value that has been
designated for the ScriptTimeout property.

NOTE: An increase in timeout value can have a negative effect
on server performance. You should design scripts that run
within the default timeout settings. For example, an increase
in script timeout value can keep IIS threads occupied and
reduce the number of users that the server can serve.

Have you tried loading the page, and then not waiting for it
to come back, but rather, hitting F5 about 5 seconds after you
make the first request? Does the second request come back any
faster?

It does not have to be loops... it could be a query that's not
coming back because of a bad or non-existant index or possibly
someone has chosen not to create primary keys on the tables for
that data?

Are there any conditional statements that might block against
another resource? or something that's not casting properly or
is null at the time of comparison?
D?

Bob Barrows [MVP] wrote:
Bob Barrows [MVP] wrote:
should I reduce it. 60 seconds seems awfully long, but I do have
another page that I


John? John?? Are you ok? OMIGOD, JOHN'S BEEN KIDNAPPED BY ALIENS!! ;-)

Oh wait. False alarm. He hit another timeout, right?

Jan 12 '06 #4

P: n/a
Sorry, I didn't realize I hadn't finished my first post. I'd gone off to
do something else, then when I came back, saw I hadn't sent the message,
so I sent it without rereading it.

(You can blame my ADHD)

The pages in question, if anyone cares to try them (and generate your
own maze while you're at it) are

http://www.mazes.com/asp-maze/amazing.asp

but rather than start there, start with one of these feeder pages:

http://www.messagemazes.com/Merit/WebAuthor.htm
http://www.messagemazes.com/Merit/Webmaster.htm
http://www.messagemazes.com/Merit/ComputerGuru.htm

Then you can test the program by putting your name into the box and get
personalized results.

For grins, and because it just occurred to me to try it, I added code to
tell me how many seconds of time it took to generate the code for each
page. The simple maze page is taking on the general order of around one
to four seconds (three tests, 1.5, 3.3 and 3.3 seconds for a 95x59
maze), and the harder maze page took over half-a-minute (two tests, 36.5
and 37.3 seconds) for a 203x93 personalized maze.

So, as you can guess, I don't want to reduce my script timeout much
lower than 60, though when I get the error, it's usually after 120
seconds, so I wonder if it even started running the script or not????

Any ideas will be appreciated.

John
www.MAZES.com
www.MessageMazes.com
www.GodLovesEveryone.org
etcetera

*** Sent via Developersdex http://www.developersdex.com ***
Jan 12 '06 #5

P: n/a
John wrote:
So, as you can guess, I don't want to reduce my script timeout much
lower than 60, though when I get the error, it's usually after 120
seconds, so I wonder if it even started running the script or not????

Any ideas will be appreciated.


Sorry, but without seeing code, we can only guess. You need to narrow it
down to something we can look at in a newsgroup post ... or hire a
consultant.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jan 12 '06 #6

P: n/a
It occurred to me on the way home from various appointments this
afternoon that part of the problem might be that I'm creating all the
HTML code in memory, then writing it with <%=variable%> parameters
inside the actual HTML code at the bottom of the ASP page.

And if it works like some BASIC interpreters I've used in the deep dark
past (I cut my teeth on BASIC in 1977), then it may sometimes stop to do
garbage collection because I keep concatenating one string longer and
longer.

So, I added some code to see what parts of my program were taking how
long:

http:
(Seconds)
0.00 to 0.00: Various initializations
0:00 to 0:02: Read and Write various files
0:02 to 0:05: Block the word pixels into the numeric array
(I don't expect that statement to make sense to you)
0:05 to 0.99: Create the numeric maze array
0:99 to 3.34: CREATE MAZE AS HTML IN MEMORY
3.34 to 3.36: Create other values that will be written
TOTAL TIME: 3.355469 seconds

It was similar when I tried the same thing with the program that creates
a maze with an area over three times bigger:

0.00 to 0.03: Initialize, read and write various files
0.03 to 0.11: Putting word pixels into numeric array
0.11 to 3.09: Create numeric maze array
3.09 to 35.41: CREATE MAZE AS HTML IN MEMORY
35.41 to 35.42: Everything else, down to just before </BODY>
(which I assume includes putting HTML into the stream down to the user?)

Obviously, my slowest routine is creating the HTML and holding it in
memory. Would I be better off actually sending the code into the web
page stream instead of holding it in memory and putting it out with
<%=variablename%>?

And how should I do that if that makes more sense? I hadn't gotten
around to learning that yet. I've been teaching myself ASP by trial and
error, looking some stuff up at
http://msdn.microsoft.com/library/de.../en-us/script5
6/html/ddfa5183-d458-41bc-a489-070296ced968.asp and just really getting
into it in October.

Thanks for all the great advice so far.

John
www.MAZES.com
www.MessageMazes.com
www.GodLovesEveryone.org
etcetera
(John {at} any of these domains)

*** Sent via Developersdex http://www.developersdex.com ***
Jan 13 '06 #7

P: n/a
I hit the search engine, and am guessing that

Response.Write

is what I should be studying next, just in case someone was getting
ready to tell this idiot that he should have learned that in a "hello
world" application, which he skipped.

John
www.MAZES.com
www.MessageMazes.com
www.GodLovesEveryone.org
etcetera

*** Sent via Developersdex http://www.developersdex.com ***
Jan 13 '06 #8

P: n/a
SUCCESS!!!!!

Response.Write

was exactly what I needed to learn next.

The test page at
http://mazes.com/asp-maze/amazingwri...ster&cat=merit

says that it did all the processing in 2.3125 seconds, and that was for
the HARDER maze.

Later tonight, I'll work on updating the other ASP pages to do it the
same way.

Thanks for all the advice, and if you have any other ideas for me, feel
free to shoot them my way.

John
www.MAZES.com
www.MessageMazes.com
www.GodLovesEveryone.org
etcetera

*** Sent via Developersdex http://www.developersdex.com ***
Jan 13 '06 #9

P: n/a
John wrote:
It occurred to me on the way home from various appointments this
afternoon that part of the problem might be that I'm creating all the
HTML code in memory, then writing it with <%=variable%>
parameters inside the actual HTML code at the bottom of the ASP page.

And if it works like some BASIC interpreters I've used in the deep
dark past (I cut my teeth on BASIC in 1977), then it may sometimes
stop to do garbage collection because I keep concatenating one string
longer and longer.


VB/VBA/vbscript are notoriously inefficient where this is concerned. A
better method is to initialize an array large enough to contain all the
strings you will will need, add the strings to the array and then, use
Join() to put them together when you write the html to response.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jan 13 '06 #10

P: n/a
<< VB/VBA/vbscript are notoriously inefficient where this is concerned.
A better method is to initialize an array large enough to contain all
the strings you will will need, add the strings to the array and then,
use Join() to put them together when you write the html to response. >>

Hi, Bob,

That sounds partially like what I intended, though I made one
improvement since yesterday that brings it closer to what you said.

Here is what I have for that part of the logic right now (you should
have seen how complicated it was ten minutes ago before I moved part of
the logic into the c1c2 array):

FOR r = 1 TO mazeh + 1 STEP 2
FOR c = 0 TO mazew
:Response.Write imagesource(c1c2(g(r,c)),c1c2(g(r+1,c)))
:NEXT: Response.Write"<BR>"
NEXT

If I were creating a "Bob Is An Amazing Webmaster" maze with my hollow
alphabet
(http://mazes.com/asp-maze/amazing15....t=merit&firstn
ame=bob), the inner statements would be executed 7,379 times because
that particular puzzle is 156 cells wide by 93 cells tall.

I finally found JOIN (was looking under statements until I reread your
statement and saw that it's a function), but it looks like it won't help
me here. I wish the example was better at msdn.

I use this as my source for syntax:
http://msdn.microsoft.com/library/de.../en-us/script5
6/html/ddfa5183-d458-41bc-a489-070296ced968.asp
Do you recommend a better source?

I did see that the WRITE method allows multiple strings:
Debug.Write([str1 [, str2 [, ... [, strN]]]])


So am I guessing correctly that:

Response.Write text1, text2, text3

works identically, as far as the final result is concerned, as:

Response.Write text1 & text2 & text3

and that the first would probably be faster?

I'm also happy to see that there is a WriteLine as there are a few cases
where a new line character is apparently required in code, like when
using Google Adsense code.

John
www.MAZES.com
www.MessageMazes.com
www.GodLovesEveryone.org
etcetera

*** Sent via Developersdex http://www.developersdex.com ***
Jan 13 '06 #11

P: n/a
I found out, by trial and error that

1) WriteLine does not work with Response

2) Response.Write may only have one item to write

So much for that idea. Fortunately, I only tested it with 11 lines of
code, so it was easy to put back to the way it was.

John
www.MAZES.com
www.MessageMazes.com
www.GodLovesEveryone.org
etcetera

*** Sent via Developersdex http://www.developersdex.com ***
Jan 13 '06 #12

This discussion thread is closed

Replies have been disabled for this discussion.