You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by andrew mercer <an...@sundayta.com> on 2002/10/01 15:46:31 UTC

Help - why is tomcat so slow in displaying each page?

Hi,

I have recently had to convert from Jetty to tomcat for one of our 
customers.

The application is run from a war file that has in it among other things 
java classes and webmacro templates.

The main browser views are currently created using frames.

When I run the war file using jetty everything runs perfectly and fast.

However when I run using tomcat the frames take about 40 - 50 seconds to 
load.

The first frame loads fast but then I am waiting for the rest.

Once open if I then click a link that loads one template (with no 
frames) via a servlet into one of the visible frames then this can also 
take between 30 - 45 seconds.

Is there a way round this?

Is it someting to do with the configuaration.?

I could not see anything obvoius in the xml files nor could I see a 
similar question in the old mailing lists.

Thnks for your help in advance

Andrew Mercer
Software Developer


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Error 400 getting thrown

Posted by Ben Ricker <br...@wellinx.com>.
I am having a problem setting up a Tomcat installation using multiple
Tomcats (two to be exact) being load balanced from one Apache. Mod_jk is
being loaded correctly. I created a file called index.jsp with the
following code:

<html>
<body bgcolor="red">
<center>
<%= request.getSession().getId() %>
<h1>Tomcat 1</h1>
</body>
</html>

When I access index.jsp, I get a white page in the browser. Here is what
I get in the mod_jk log in debug mode:

[Tue Oct 01 11:01:11 2002]  [jk_uri_worker_map.c (460)]: Into jk_uri_worker_map_t::map_uri_to_worker
[Tue Oct 01 11:01:11 2002]  [jk_uri_worker_map.c (477)]: Attempting to map URI '/index.jsp'
[Tue Oct 01 11:01:11 2002]  [jk_uri_worker_map.c (558)]: jk_uri_worker_map_t::map_uri_to_worker, Found a suffix match loadbalancer -> *.jsp
[Tue Oct 01 11:01:11 2002]  [jk_worker.c (132)]: Into wc_get_worker_for_name loadbalancer
[Tue Oct 01 11:01:11 2002]  [jk_worker.c (136)]: wc_get_worker_for_name, done  found a worker
[Tue Oct 01 11:01:11 2002]  [jk_lb_worker.c (527)]: Into jk_worker_t::get_endpoint
[Tue Oct 01 11:01:11 2002]  [jk_lb_worker.c (310)]: Into jk_endpoint_t::service
[Tue Oct 01 11:01:11 2002]  [jk_ajp_common.c (1355)]: Into jk_worker_t::get_endpoint
[Tue Oct 01 11:01:11 2002]  [jk_ajp_common.c (1079)]: Into jk_endpoint_t::service
[Tue Oct 01 11:01:11 2002]  [jk_ajp_common.c (280)]: Into ajp_marshal_into_msgb
[Tue Oct 01 11:01:11 2002]  [jk_ajp_common.c (413)]: ajp_marshal_into_msgb - Done
[Tue Oct 01 11:01:11 2002]  [jk_connect.c (116)]: Into jk_open_socket
[Tue Oct 01 11:01:11 2002]  [jk_connect.c (123)]: jk_open_socket, try to connect socket = 8
[Tue Oct 01 11:01:11 2002]  [jk_connect.c (132)]: jk_open_socket, after connect ret = 0
[Tue Oct 01 11:01:11 2002]  [jk_connect.c (140)]: jk_open_socket, set TCP_NODELAY to on
[Tue Oct 01 11:01:11 2002]  [jk_connect.c (148)]: jk_open_socket, return, sd = 8
[Tue Oct 01 11:01:11 2002]  [jk_ajp_common.c (589)]: In jk_endpoint_t::ajp_connect_to_endpoint, connected sd = 8
[Tue Oct 01 11:01:11 2002]  [jk_ajp_common.c (613)]: sending to ajp13 #462
[Tue Oct 01 11:01:11 2002]  [jk_ajp_common.c (854)]: ajp_send_request 2: request body to send 0 - request body to resend 0
[Tue Oct 01 11:01:11 2002]  [jk_ajp_common.c (699)]: received from ajp13 #33
[Tue Oct 01 11:01:11 2002]  [jk_ajp_common.c (462)]: ajp_unmarshal_response: status = 400
[Tue Oct 01 11:01:11 2002]  [jk_ajp_common.c (467)]: ajp_unmarshal_response: Number of headers is = 1
[Tue Oct 01 11:01:11 2002]  [jk_ajp_common.c (507)]: ajp_unmarshal_response: Header[0] [Content-Type] = [text/html]
[Tue Oct 01 11:01:11 2002]  [jk_ajp_common.c (699)]: received from ajp13 #2
[Tue Oct 01 11:01:11 2002]  [jk_ajp_common.c (1333)]: Into jk_endpoint_t::done, recycling connection
[Tue Oct 01 11:01:11 2002]  [jk_lb_worker.c (389)]: Into jk_endpoint_t::done


What exactly is the Error 400 showing? Error 400 is a "Bad Request".
Below are snippets of some conf files. Let me know if I need to show
anyone the server.xml file.

Thanks,

Ben Ricker

I have the following in httpd.conf:

#
# Set up loadbalncer for JkMount
#
JkMount /*.jsp loadbalancer
JkMount /servlets/* loadbalancer

#
# Configure mod_jk
#
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkLogLevel info

Here is the workers.properties:

#
# workers.properties
#

# In Unix, we use forward slashes:
ps=/

# list the workers by name

worker.list=tomcat1, tomcat2, loadbalancer

# ------------------------
# First tomcat server
# ------------------------
worker.tomcat1.port=11009
worker.tomcat1.host=dev.wellinx.com
worker.tomcat1.type=ajp13

# Specify the size of the open connection cache.
#worker.tomcat1.cachesize

#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
#  ----> lbfactor must be > 0
#  ----> Low lbfactor means less work done by the worker.
worker.tomcat1.lbfactor=100


# ------------------------
# Second tomcat server
# ------------------------
worker.tomcat2.port=12009
worker.tomcat2.host=dev.wellinx.com
worker.tomcat2.type=ajp13

# Specify the size of the open connection cache.
#worker.tomcat2.cachesize

#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
#  ----> lbfactor must be > 0
#  ----> Low lbfactor means less work done by the worker.
worker.tomcat2.lbfactor=100


# ------------------------
# Load Balancer worker
# ------------------------

#
# The loadbalancer (type lb) worker performs weighted round-robin
# load balancing with sticky sessions.
# Note:
#  ----> If a worker dies, the load balancer will check its state
#        once in a while. Until then all work is redirected to peer
#        worker.
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=tomcat1, tomcat2

#
# END workers.properties
#



-- 
Ben Ricker <br...@wellinx.com>
Wellinx.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Help - why is tomcat so slow in displaying each page?

Posted by "Sexton, George" <gs...@mhsoftware.com>.
So, shooting in the dark, do you have log hosts names turned on for tomcat?
If so, is your host name resolvable?

-----Original Message-----
From: andrew mercer [mailto:andrew@sundayta.com]
Sent: 01 October, 2002 7:47 AM
To: tomcat-user@jakarta.apache.org
Subject: Help - why is tomcat so slow in displaying each page?


Hi,

I have recently had to convert from Jetty to tomcat for one of our
customers.

The application is run from a war file that has in it among other things
java classes and webmacro templates.

The main browser views are currently created using frames.

When I run the war file using jetty everything runs perfectly and fast.

However when I run using tomcat the frames take about 40 - 50 seconds to
load.

The first frame loads fast but then I am waiting for the rest.

Once open if I then click a link that loads one template (with no
frames) via a servlet into one of the visible frames then this can also
take between 30 - 45 seconds.

Is there a way round this?

Is it someting to do with the configuaration.?

I could not see anything obvoius in the xml files nor could I see a
similar question in the old mailing lists.

Thnks for your help in advance

Andrew Mercer
Software Developer


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>