You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jessica Johnson <je...@internetmi.com> on 2007/05/29 18:19:52 UTC

error 503 in middle of page with tomcat and jk connector

Hi all,

I finally got a mostly working install of Apache 2.2.4, Tomcat 5.5.23,
and the mod_jk 1.2.22.  In the general case it works fine, but for
pages that take a long time to load, I get the first part of the html,
and then Apache spits out "OK The server is temporarily unable to
service your request due to maintenance downtime or capacity problems.
Please try again later."  It's a reporting system that needs to do
some intensive DB queries and calculations before rendering.

Is there some way I can increase the time Apache waits before giving
the 503 error? Or better yet, what are some strategies for optimizing
my configuration?  I'm a newbie with this type of setup, so I may be
missing something entirely obvious.

There was nothing strange in any of the logs, except this snip from
access.log showing the 503:
196.40.54.218 - - [29/May/2007:10:30:04 -0500] "GET
/reporting/data_reports.jsf?reportStyle=3 HTTP/1.1" 200 90024
196.40.54.218 - - [29/May/2007:10:31:17 -0500] "GET
/reporting/data_reports.jsf?reportStyle=4 HTTP/1.1" 503 90289

Here is my workers.properties file.

[logger]
level=DEBUG
file=C:/Program Files/Apache Software Foundation/Apache2.2/logs/jk2.log
[config]
file=C:/Program Files/Apache Software
Foundation/Apache2.2/conf/workers2.properties
debug=0
debugEnv=0


[shm]
file=C:/Program Files/Apache Software Foundation/Apache2.2/logs/jk2.shm
size=1048576

# socket channel
[channel.socket:localhost:8009]
port=8009
host=127.0.0.1

# worker for the connector
[ajp13:localhost:8009]
channel=channel.socket:localhost:8009

[status:status]

[uri:/status/*]
worker=status:status

[uri:/jsp-examples/*.jsp]
worker=ajp13:localhost:8009

[uri:/reporting/*.jsp]
worker=ajp13:localhost:8009

[uri:/*.jsp]
worker=ajp13:localhost:8009

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: error 503 in middle of page with tomcat and jk connector

Posted by Jessica Johnson <je...@internetmi.com>.
I just noticed something strange.  It isn't exactly that the HTML is
cut off.  All of the parts match the output on my dev server.  But it
looks like the HTML has been chunked up and mixed up, for lack of a
better way to describe it.  For example one of the pages has two head
tags, but is missing some of the other chunks.

Here's an example line from the dev server:

<tr class="standardTable_Row1" onmouseout="restorColors(this,8)"
onmouseover="changeColors(this)"><td
class="standardTable_ColumnRight">Snapnames
             </td><td class="standardTable_ColumnRight">223</td><td
class="standardTable_ColumnRight">1.79%</td><td
class="standardTable_ColumnRight">4</td><td
class="standardTable_ColumnRight">50.00%</td><td
class="standardTable_ColumnRight">2</td><td
class="standardTable_ColumnRight">$1.00</td><td
class="standardTable_ColumnRight">$2.00</td><td
class="standardTable_ColumnRight">$4.00</td><td
class="standardTable_ColumnRight">2</td></tr>

And here is the same line from production server:

<tr class="standardTable_Row1" onmouseout="restorColors(this,8)"
onmouseover="changeColors(this)"><td
class="standardTable_ColumnRight">Snapnames
             </td><td class="standardTable_ColumnRight">223</td><td
class="standardTable_ColumnRight">1.79%</td><td
class="standardTable_ColumnRight">4</td><td
class="standardTable_ColumnRight">50.00%</td><td
class="standardTable_ColumnRight">2</td><td
class="standardTable_ColumnRight">$1.00</td><td
class="standardTable_ColumnRight">$2.00</td><td
class="standardTable_ColumnRight">$4.00</td><td
class="standardTable_ColumnRight">2</tlumns:</span></td></tr>

That is the first place where the html deviates.  After that follows
another chunk of html that should appear further down the page.  I'm
baffled.  Anyone know what could be causing it?

The problem seems to appear only on longer pages.  I haven't gotten
the 503 error lately, the TimeOut and KeepAliveTimeout directives
might have fixed it.

jessica

On 5/29/07, Jessica Johnson <je...@internetmi.com> wrote:
>
>
>
> On 5/29/07, Rainer Jung <ra...@kippdata.de> wrote:
>
>
>
>
> > Although I don't know your actual configs, I assume your problem happens
> > when requests take longer than 300 seconds, which is the default request
> > timeout with Apache. You can increase this with Apache Timeout
> > directive. You can measure response times by adding "%D" to your
> >  LogFormat (microseconds response time).
>
>
> I added
> TimeOut 1200
> KeepAliveTimeout 30
>
> To the end of httpd.conf which didn't fix the original 503 problem.  I also noticed that sometimes I don't get the error at all, but the html response is incomplete.  I will experiment some with %D and see if I can learn more about the problem.  In the meantime, I would appreciate any ideas you all might have.
>
> Thanks,
>
> jessica
>
>
>
> > Regards,
> >
> > Rainer
> >
> > Jessica Johnson wrote:
> > > Hi all,
> > >
> > > I finally got a mostly working install of Apache 2.2.4, Tomcat 5.5.23,
> > > and the mod_jk 1.2.22.  In the general case it works fine, but for
> > > pages that take a long time to load, I get the first part of the html,
> > > and then Apache spits out "OK The server is temporarily unable to
> > > service your request due to maintenance downtime or capacity problems.
> > > Please try again later."  It's a reporting system that needs to do
> > > some intensive DB queries and calculations before rendering.
> > >
> > > Is there some way I can increase the time Apache waits before giving
> > > the 503 error? Or better yet, what are some strategies for optimizing
> > > my configuration?  I'm a newbie with this type of setup, so I may be
> > > missing something entirely obvious.
> > >
> > > There was nothing strange in any of the logs, except this snip from
> > > access.log  showing the 503:
> > > 196.40.54.218 - - [29/May/2007:10:30:04 -0500] "GET
> > > /reporting/data_reports.jsf?reportStyle=3 HTTP/1.1" 200 90024
> > >  196.40.54.218 - - [29/May/2007:10:31:17 -0500] "GET
> > > /reporting/data_reports.jsf?reportStyle=4 HTTP/1.1" 503 90289
> > >
> > > Here is my workers.properties file.
> > >
> > > [logger]
> > > level=DEBUG
> > > file=C:/Program Files/Apache Software Foundation/Apache2.2/logs/jk2.log
> > > [config]
> > > file=C:/Program Files/Apache Software
> > > Foundation/Apache2.2/conf/workers2.properties
> > > debug=0
> > > debugEnv=0
> > >
> > >
> > > [shm]
> > > file=C:/Program Files/Apache Software Foundation/Apache2.2/logs/jk2.shm
> > > size=1048576
> > >
> > > # socket channel
> > > [channel.socket:localhost:8009]
> > > port=8009
> > > host=127.0.0.1
> > >
> > > # worker for the connector
> > > [ajp13:localhost:8009]
> > > channel=channel.socket:localhost:8009
> > >
> > > [status:status]
> > >
> > > [uri:/status/*]
> > > worker=status:status
> > >
> > > [uri:/jsp-examples/*.jsp]
> > > worker=ajp13:localhost:8009
> > >
> > > [uri:/reporting/*.jsp]
> > > worker=ajp13:localhost:8009
> > >
> > > [uri:/*.jsp]
> > > worker=ajp13:localhost:8009
> >
> > ---------------------------------------------------------------------
> > To start a new topic, e-mail: users@tomcat.apache.org
> > To unsubscribe, e-mail:  users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >
>
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: error 503 in middle of page with tomcat and jk connector

Posted by Jessica Johnson <je...@internetmi.com>.
Thanks Rainer,

I updated the workers.properties with your suggestions, and verified
that there is only one timeout directive in httpd.conf.  Afterwards, I
found some interesting things poking through the logs.

mod_jk.log
<snip>
[Tue May 29 17:44:55 2007] [1060:1860] [debug] mod_jk.c (452): written
8184 out of 8184
[Tue May 29 17:44:55 2007] [1060:1860] [info]  jk_ajp_common.c (945):
(worker2) Tomcat has forced a connection close for socket 2432
[Tue May 29 17:44:55 2007] [1060:1860] [error] jk_ajp_common.c (1618):
(worker2) Tomcat is down or network problems. Part of the response has
already been sent to the client
[Tue May 29 17:44:55 2007] [1060:1860] [info]  jk_ajp_common.c (1902):
(worker2) receiving from tomcat failed, recoverable operation
attempt=1
[Tue May 29 17:44:55 2007] [1060:1860] [info]  jk_ajp_common.c (1941):
(worker2) sending request to tomcat failed,  recoverable operation
attempt=2
[Tue May 29 17:44:55 2007] [1060:1860] [error] jk_ajp_common.c (1953):
(worker2) Connecting to tomcat failed. Tomcat is probably not started
or is listening on the wrong port
[Tue May 29 17:44:55 2007] [1060:1860] [debug] jk_ajp_common.c (2286):
recycling connection pool slot=0 for worker worker2
[Tue May 29 17:44:55 2007] [1060:1860] [info]  mod_jk.c (2254):
Service error=0 for worker=worker2
[Tue May 29 17:45:36 2007] [1060:1860] [debug] jk_uri_worker_map.c
(589): Attempting to map URI '/reporting/data_reports.jsf' from 4 maps
[Tue May 29 17:45:36 2007] [1060:1860] [debug] jk_uri_worker_map.c
(601): Attempting to map context URI '/*/servlet/=worker2' source
'JkMount'
[Tue May 29 17:45:36 2007] [1060:1860] [debug] jk_uri_worker_map.c
(601): Attempting to map context URI '/jsp-examples/*=worker2' source
'JkMount'
[Tue May 29 17:45:36 2007] [1060:1860] [debug] jk_uri_worker_map.c
(601): Attempting to map context URI '/reporting/*=worker2' source
'JkMount'
[Tue May 29 17:45:36 2007] [1060:1860] [debug] jk_uri_worker_map.c
(616): Found a wildchar match '/reporting/*=worker2'
[Tue May 29 17:45:36 2007] [1060:1860] [debug] mod_jk.c (2111): Into
handler jakarta-servlet worker=worker2 r->proxyreq=0
[Tue May 29 17:45:36 2007] [1060:1860] [debug] jk_worker.c (114):
found a worker worker2
[Tue May 29 17:45:36 2007] [1060:1860] [debug] jk_worker.c (321):
Maintaining worker worker2
[Tue May 29 17:45:36 2007] [1060:1860] [debug] jk_ajp_common.c (2416):
reached pool min size 125 from 250 cache slots
[Tue May 29 17:45:36 2007] [1060:1860] [debug] jk_ajp_common.c (2424):
recycled 0 sockets in 0 seconds from 250 pool slots
[Tue May 29 17:45:36 2007] [1060:1860] [debug] jk_worker.c (321):
Maintaining worker worker4
[Tue May 29 17:45:36 2007] [1060:1860] [debug] jk_ajp_common.c (2416):
reached pool min size 125 from 250 cache slots
[Tue May 29 17:45:36 2007] [1060:1860] [debug] jk_ajp_common.c (2424):
recycled 0 sockets in 0 seconds from 250 pool slots
[Tue May 29 17:45:36 2007] [1060:1860] [debug] jk_lb_worker.c (543):
decay with 2^1
[Tue May 29 17:45:36 2007] [1060:1860] [debug] jk_worker.c (290):
Found worker type 'ajp13'
[Tue May 29 17:45:36 2007] [1060:1860] [debug] mod_jk.c (607): Service
protocol=HTTP/1.1 method=GET host=(null) addr=196.40.33.120
name=semoptimizer.com port=80 auth=(null) user=(null)
laddr=72.3.224.97 raddr=196.40.33.120
[Tue May 29 17:45:36 2007] [1060:1860] [debug] jk_ajp_common.c (2343):
acquired connection pool slot=0
[Tue May 29 17:45:36 2007] [1060:1860] [debug] jk_ajp_common.c (548):
ajp marshaling done
[Tue May 29 17:45:36 2007] [1060:1860] [debug] jk_ajp_common.c (1796):
processing worker2 with 2 retries
[Tue May 29 17:45:36 2007] [1060:1860] [debug] jk_connect.c (335):
socket TCP_NODELAY set to On
[Tue May 29 17:45:36 2007] [1060:1860] [debug] jk_connect.c (348):
socket SO_KEEPALIVE set to On
[Tue May 29 17:45:36 2007] [1060:1860] [debug] jk_connect.c (433):
trying to connect socket 2432 to 127.0.0.1:8009
[Tue May 29 17:45:36 2007] [1060:1860] [debug] jk_connect.c (459):
socket 2432 connected to 127.0.0.1:8009
[Tue May 29 17:45:36 2007] [1060:1860] [debug] jk_ajp_common.c (850):
Connected socket 2432 to (127.0.0.1:8009)
[Tue May 29 17:45:36 2007] [1060:1860] [debug] jk_ajp_common.c (896):
sending to ajp13 pos=4 len=536 max=8192
</snip>

So maybe Tomcat is down...but why is it going down? I didn't see
anything in the Tomcat logs to indicate that it was going down.

And why "reached pool min size 125 from 250 cache slots?" I'm the only
one going to the pages.  I would think it would take more than just
one browser to use up 125 cache slots.

I have so far only been able to reproduce this problem on my
workstation, which has an internet connection from the stone age
(128Kb).  A friend was able to see the pages fine, and remoting in to
the server and accessing the pages from there works (using both the
domain name and localhost.)

Here's my new workers.properties:

# Define some properties
workers.apache_log="C:\Program Files\Apache Software
Foundation\Apache2.2\logs\error.log"
workers.tomcat_home="C:\Program Files\Apache Software Foundation\Tomcat 5.5"
workers.java_home="C:\Program Files\Java\jrockit-R27.2.0-jre1.5.0_10"
ps=\
# Define 2 workers, 1 real workers using ajp13, the last one being a
loadbalancing worker
worker.list=worker2, worker4

# Set properties for worker2 (ajp13)
worker.worker2.type=ajp13
worker.worker2.host=127.0.0.1
worker.worker2.port=8009
worker.worker2.lbfactor=1
worker.worker2.connection_pool_timeout=600
worker.worker2.socket_keepalive=1
#worker.worker2.socket_timeout=60

# Set properties for worker4 (lb) which use worker2
worker.worker4.type=lb
worker.worker4.balance_workers=worker2


On 5/29/07, Rainer Jung <ra...@kippdata.de> wrote:
> Jessica Johnson wrote:
> > On 5/29/07, Rainer Jung <ra...@kippdata.de> wrote:
> >>
> >> Hi Jessica,
> >>
> >> your information looks strange. You are talking about mod_jk 1.2.22, but
> >> you present a configuration for mod_jk2, which is deprecated. mod_jk
> >> will not work with this configuration, because mod_jk uses a very
> >> different config syntax.
> >
> >
> > Strangely enough it did work - I don't know how.  But I changed configs to
> > the below in case that was part of the problem.  Everything is still
> > working
> > the same as far as I can tell.
> >
> > I don't know if I need the load balancer since I only have one other
> > worker.  Will the load balancer affect performance?
> >
> > workers.properties
> > # Define some properties
> > workers.apache_log="C:\Program Files\Apache Software
> > Foundation\Apache2.2\logs"
>
> That doesn't exist and will be ignored.
>
> > workers.tomcat_home="C:\Program Files\Apache Software Foundation\Tomcat
> > 5.5"
> > workers.java_home="C:\Program Files\Java\jrockit-R27.2.0-jre1.5.0_10"
> > ps=\
>
> Those three are generally not needed and will be ignored
>
> > # Define 2 workers, 1 real workers using ajp13, the last one being a
> > loadbalancing worker
> > worker.list=worker2, worker4
> >
> > # Set properties for worker2 (ajp13)
> > worker.worker2.type=ajp13
> > worker.worker2.host=127.0.0.1
> > worker.worker2.port=8009
> > worker.worker2.lbfactor=1
> > worker.worker2.connection_pool_timeout=600
> > worker.worker2.socket_keepalive=1
> > worker.worker2.socket_timeout=60
>
> Don't use a socket_timeout if you expect long waiting intervals, at
> least not on your first try.
>
> > # Set properties for worker4 (lb) which use worker2
> > worker.worker4.balance_workers=worker2
> >
>
> This will be ignored unless you add worker.worker4.type=lb
>
> > httpd.conf exerpt:
> >
> > # Config for mod_jk
> > <IfModule !mod_jk.c>
> >  LoadModule jk_module "C:/Program Files/Apache Software
> > Foundation/Apache2.2/modules/mod_jk.so"
> > </IfModule>
> >
> > JkWorkersFile "C:/Program Files/Apache Software Foundation/Tomcat 5.5
> > /conf/jk/workers.properties"
> > JkLogFile "C:/Program Files/Apache Software Foundation/Tomcat 5.5
> > /logs/mod_jk.log"
> > JkLogLevel    info
>
> You can try JkLogLevel debug or even trace, once you can reproduce your
> problem with low load.
>
> > JkMount /*.jsp worker2
> > JkMount /*/servlet/ worker2
> > JkMount /jsp-examples/* worker2
> > JkMount /reporting/* worker2
> >
> > Although I don't know your actual configs, I assume your problem happens
> >> when requests take longer than 300 seconds, which is the default request
> >> timeout with Apache. You can increase this with Apache Timeout
> >> directive. You can measure response times by adding "%D" to your
> >> LogFormat (microseconds response time).
> >
> >
> > I added
> > TimeOut 1200
> > KeepAliveTimeout 30
> >
> > To the end of httpd.conf which didn't fix the original 503 problem.  I also
> > noticed that sometimes I don't get the error at all, but the html response
> > is incomplete.  I will experiment some with %D and see if I can learn more
> > about the problem.  In the meantime, I would appreciate any ideas you all
> > might have.
>
> Good luck. BTW: usually there already is a Timeout directive in
> httpd.conf, so you might have now two ones with inconsistent values ...
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: error 503 in middle of page with tomcat and jk connector

Posted by Rainer Jung <ra...@kippdata.de>.
Jessica Johnson wrote:
> On 5/29/07, Rainer Jung <ra...@kippdata.de> wrote:
>>
>> Hi Jessica,
>>
>> your information looks strange. You are talking about mod_jk 1.2.22, but
>> you present a configuration for mod_jk2, which is deprecated. mod_jk
>> will not work with this configuration, because mod_jk uses a very
>> different config syntax.
> 
> 
> Strangely enough it did work - I don't know how.  But I changed configs to
> the below in case that was part of the problem.  Everything is still 
> working
> the same as far as I can tell.
> 
> I don't know if I need the load balancer since I only have one other
> worker.  Will the load balancer affect performance?
> 
> workers.properties
> # Define some properties
> workers.apache_log="C:\Program Files\Apache Software
> Foundation\Apache2.2\logs"

That doesn't exist and will be ignored.

> workers.tomcat_home="C:\Program Files\Apache Software Foundation\Tomcat 
> 5.5"
> workers.java_home="C:\Program Files\Java\jrockit-R27.2.0-jre1.5.0_10"
> ps=\

Those three are generally not needed and will be ignored

> # Define 2 workers, 1 real workers using ajp13, the last one being a
> loadbalancing worker
> worker.list=worker2, worker4
> 
> # Set properties for worker2 (ajp13)
> worker.worker2.type=ajp13
> worker.worker2.host=127.0.0.1
> worker.worker2.port=8009
> worker.worker2.lbfactor=1
> worker.worker2.connection_pool_timeout=600
> worker.worker2.socket_keepalive=1
> worker.worker2.socket_timeout=60

Don't use a socket_timeout if you expect long waiting intervals, at 
least not on your first try.

> # Set properties for worker4 (lb) which use worker2
> worker.worker4.balance_workers=worker2
> 

This will be ignored unless you add worker.worker4.type=lb

> httpd.conf exerpt:
> 
> # Config for mod_jk
> <IfModule !mod_jk.c>
>  LoadModule jk_module "C:/Program Files/Apache Software
> Foundation/Apache2.2/modules/mod_jk.so"
> </IfModule>
> 
> JkWorkersFile "C:/Program Files/Apache Software Foundation/Tomcat 5.5
> /conf/jk/workers.properties"
> JkLogFile "C:/Program Files/Apache Software Foundation/Tomcat 5.5
> /logs/mod_jk.log"
> JkLogLevel    info

You can try JkLogLevel debug or even trace, once you can reproduce your 
problem with low load.

> JkMount /*.jsp worker2
> JkMount /*/servlet/ worker2
> JkMount /jsp-examples/* worker2
> JkMount /reporting/* worker2
> 
> Although I don't know your actual configs, I assume your problem happens
>> when requests take longer than 300 seconds, which is the default request
>> timeout with Apache. You can increase this with Apache Timeout
>> directive. You can measure response times by adding "%D" to your
>> LogFormat (microseconds response time).
> 
> 
> I added
> TimeOut 1200
> KeepAliveTimeout 30
> 
> To the end of httpd.conf which didn't fix the original 503 problem.  I also
> noticed that sometimes I don't get the error at all, but the html response
> is incomplete.  I will experiment some with %D and see if I can learn more
> about the problem.  In the meantime, I would appreciate any ideas you all
> might have.

Good luck. BTW: usually there already is a Timeout directive in 
httpd.conf, so you might have now two ones with inconsistent values ...


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: error 503 in middle of page with tomcat and jk connector

Posted by Jessica Johnson <je...@internetmi.com>.
On 5/29/07, Rainer Jung <ra...@kippdata.de> wrote:
>
> Hi Jessica,
>
> your information looks strange. You are talking about mod_jk 1.2.22, but
> you present a configuration for mod_jk2, which is deprecated. mod_jk
> will not work with this configuration, because mod_jk uses a very
> different config syntax.


Strangely enough it did work - I don't know how.  But I changed configs to
the below in case that was part of the problem.  Everything is still working
the same as far as I can tell.

I don't know if I need the load balancer since I only have one other
worker.  Will the load balancer affect performance?

workers.properties
 # Define some properties
workers.apache_log="C:\Program Files\Apache Software
Foundation\Apache2.2\logs"
workers.tomcat_home="C:\Program Files\Apache Software Foundation\Tomcat 5.5"
workers.java_home="C:\Program Files\Java\jrockit-R27.2.0-jre1.5.0_10"
ps=\
# Define 2 workers, 1 real workers using ajp13, the last one being a
loadbalancing worker
worker.list=worker2, worker4

# Set properties for worker2 (ajp13)
worker.worker2.type=ajp13
worker.worker2.host=127.0.0.1
worker.worker2.port=8009
worker.worker2.lbfactor=1
worker.worker2.connection_pool_timeout=600
worker.worker2.socket_keepalive=1
worker.worker2.socket_timeout=60

# Set properties for worker4 (lb) which use worker2
worker.worker4.balance_workers=worker2




httpd.conf exerpt:

# Config for mod_jk
<IfModule !mod_jk.c>
  LoadModule jk_module "C:/Program Files/Apache Software
Foundation/Apache2.2/modules/mod_jk.so"
</IfModule>

JkWorkersFile "C:/Program Files/Apache Software Foundation/Tomcat 5.5
/conf/jk/workers.properties"
JkLogFile "C:/Program Files/Apache Software Foundation/Tomcat 5.5
/logs/mod_jk.log"
JkLogLevel    info

JkMount /*.jsp worker2
JkMount /*/servlet/ worker2
JkMount /jsp-examples/* worker2
JkMount /reporting/* worker2



Although I don't know your actual configs, I assume your problem happens
> when requests take longer than 300 seconds, which is the default request
> timeout with Apache. You can increase this with Apache Timeout
> directive. You can measure response times by adding "%D" to your
> LogFormat (microseconds response time).


I added
TimeOut 1200
KeepAliveTimeout 30

To the end of httpd.conf which didn't fix the original 503 problem.  I also
noticed that sometimes I don't get the error at all, but the html response
is incomplete.  I will experiment some with %D and see if I can learn more
about the problem.  In the meantime, I would appreciate any ideas you all
might have.

Thanks,

jessica

Regards,
>
> Rainer
>
> Jessica Johnson wrote:
> > Hi all,
> >
> > I finally got a mostly working install of Apache 2.2.4, Tomcat 5.5.23,
> > and the mod_jk 1.2.22.  In the general case it works fine, but for
> > pages that take a long time to load, I get the first part of the html,
> > and then Apache spits out "OK The server is temporarily unable to
> > service your request due to maintenance downtime or capacity problems.
> > Please try again later."  It's a reporting system that needs to do
> > some intensive DB queries and calculations before rendering.
> >
> > Is there some way I can increase the time Apache waits before giving
> > the 503 error? Or better yet, what are some strategies for optimizing
> > my configuration?  I'm a newbie with this type of setup, so I may be
> > missing something entirely obvious.
> >
> > There was nothing strange in any of the logs, except this snip from
> > access.log showing the 503:
> > 196.40.54.218 - - [29/May/2007:10:30:04 -0500] "GET
> > /reporting/data_reports.jsf?reportStyle=3 HTTP/1.1" 200 90024
> > 196.40.54.218 - - [29/May/2007:10:31:17 -0500] "GET
> > /reporting/data_reports.jsf?reportStyle=4 HTTP/1.1" 503 90289
> >
> > Here is my workers.properties file.
> >
> > [logger]
> > level=DEBUG
> > file=C:/Program Files/Apache Software Foundation/Apache2.2/logs/jk2.log
> > [config]
> > file=C:/Program Files/Apache Software
> > Foundation/Apache2.2/conf/workers2.properties
> > debug=0
> > debugEnv=0
> >
> >
> > [shm]
> > file=C:/Program Files/Apache Software Foundation/Apache2.2/logs/jk2.shm
> > size=1048576
> >
> > # socket channel
> > [channel.socket:localhost:8009]
> > port=8009
> > host=127.0.0.1
> >
> > # worker for the connector
> > [ajp13:localhost:8009]
> > channel=channel.socket:localhost:8009
> >
> > [status:status]
> >
> > [uri:/status/*]
> > worker=status:status
> >
> > [uri:/jsp-examples/*.jsp]
> > worker=ajp13:localhost:8009
> >
> > [uri:/reporting/*.jsp]
> > worker=ajp13:localhost:8009
> >
> > [uri:/*.jsp]
> > worker=ajp13:localhost:8009
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: error 503 in middle of page with tomcat and jk connector

Posted by Rainer Jung <ra...@kippdata.de>.
Hi Jessica,

your information looks strange. You are talking about mod_jk 1.2.22, but 
you present a configuration for mod_jk2, which is deprecated. mod_jk 
will not work with this configuration, because mod_jk uses a very 
different config syntax.

Although I don't know your actual configs, I assume your problem happens 
when requests take longer than 300 seconds, which is the default request 
timeout with Apache. You can increase this with Apache Timeout 
directive. You can measure response times by adding "%D" to your 
LogFormat (microseconds response time).

Regards,

Rainer

Jessica Johnson wrote:
> Hi all,
> 
> I finally got a mostly working install of Apache 2.2.4, Tomcat 5.5.23,
> and the mod_jk 1.2.22.  In the general case it works fine, but for
> pages that take a long time to load, I get the first part of the html,
> and then Apache spits out "OK The server is temporarily unable to
> service your request due to maintenance downtime or capacity problems.
> Please try again later."  It's a reporting system that needs to do
> some intensive DB queries and calculations before rendering.
> 
> Is there some way I can increase the time Apache waits before giving
> the 503 error? Or better yet, what are some strategies for optimizing
> my configuration?  I'm a newbie with this type of setup, so I may be
> missing something entirely obvious.
> 
> There was nothing strange in any of the logs, except this snip from
> access.log showing the 503:
> 196.40.54.218 - - [29/May/2007:10:30:04 -0500] "GET
> /reporting/data_reports.jsf?reportStyle=3 HTTP/1.1" 200 90024
> 196.40.54.218 - - [29/May/2007:10:31:17 -0500] "GET
> /reporting/data_reports.jsf?reportStyle=4 HTTP/1.1" 503 90289
> 
> Here is my workers.properties file.
> 
> [logger]
> level=DEBUG
> file=C:/Program Files/Apache Software Foundation/Apache2.2/logs/jk2.log
> [config]
> file=C:/Program Files/Apache Software
> Foundation/Apache2.2/conf/workers2.properties
> debug=0
> debugEnv=0
> 
> 
> [shm]
> file=C:/Program Files/Apache Software Foundation/Apache2.2/logs/jk2.shm
> size=1048576
> 
> # socket channel
> [channel.socket:localhost:8009]
> port=8009
> host=127.0.0.1
> 
> # worker for the connector
> [ajp13:localhost:8009]
> channel=channel.socket:localhost:8009
> 
> [status:status]
> 
> [uri:/status/*]
> worker=status:status
> 
> [uri:/jsp-examples/*.jsp]
> worker=ajp13:localhost:8009
> 
> [uri:/reporting/*.jsp]
> worker=ajp13:localhost:8009
> 
> [uri:/*.jsp]
> worker=ajp13:localhost:8009

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: error 503 in middle of page with tomcat and jk connector

Posted by Mladen Turk <ml...@gmail.com>.
Jessica Johnson wrote:
> Hi all,
> 
> I finally got a mostly working install of Apache 2.2.4, Tomcat 5.5.23,
> and the mod_jk 1.2.22.
> 

That's hard to believe, because (see below)

> Here is my workers.properties file.
> 
> [logger]
> level=DEBUG
> file=C:/Program Files/Apache Software Foundation/Apache2.2/logs/jk2.log
> [config]
> file=C:/Program Files/Apache Software
> Foundation/Apache2.2/conf/workers2.properties
> debug=0
> debugEnv=0
> 
> 
> [shm]
> file=C:/Program Files/Apache Software Foundation/Apache2.2/logs/jk2.shm
> size=1048576
>


You are using JK2 config with mod_jk.

The workers.properties for mod_jk should look
like this:
http://tomcat.apache.org/connectors-doc/generic_howto/workers.html


Regards,
Mladen.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org