File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat 6.0 / Multiple CPU processes out of order

 
Greg Werner
Ranch Hand
Posts: 54
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all, I am not sure if I have the right forum but here we go. I have a j2ee web app running on Tomcat 6.0 on a 2 processor machine and I am doing several html submits in a certain sequence. Let us say I am doing 3 submits. 2 submits are done using jQuery post. The other 1 submit is done using javscript document.forms[0].submit(). On my machine, the 3 submits always occur in the proper order, regardless of whether 1 or 2 processors are used to handle this sequence.

When I go to another multi-CPU machine with Tomcat 6.0 and same app, when two processors have these submits divided between them, the 3 submits occur out of sequence. One of the processors comes in horribly late compared to the other processor which started the work. I need the second processor to begin its part earlier if two processors are to be used for this sequence.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13048
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What exactly is "our of order"?
If these submits are all HTTP requests done by the client browser, doesn't the browser work the same every time?
Or are you referring to the order in which the responses are completed?

Bill
 
Greg Werner
Ranch Hand
Posts: 54
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
William Brogden wrote:What exactly is "our of order"?
If these submits are all HTTP requests done by the client browser, doesn't the browser work the same every time?
Or are you referring to the order in which the responses are completed?

Bill


If I have (jQuery)Post A, (jQuery)Post B, (javascript submit()) Post C performed on a single jsp, I need the order they are executed in the servlet layer to be doPost() of A doPost() of B and doPost() of C. I know they are independent threads, but I would like to somehow impose ordering for the 3 requests or force the use of a single processor for the 3 requests since I consider them a single atomic item (like I really would want the 3 requests to be a single thread). I posted here because I was thinking maybe there was some way of tinkering with the ThreadPool or something to impose ordering.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64192
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ummm, no. You'll either need to chain them on the client, or combine them into a single request.

This waves a huge red flag. What are you really trying to accomplish?

 
Kris Schneider
Ranch Hand
Posts: 71
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:You'll either need to chain them on the client...


Never used these, but you get the idea...

http://code.google.com/p/jquery-ajaxq/
http://www.protofunc.com/scripts/jquery/ajaxManager/
http://plugins.jquery.com/project/ajaxqueue
 
Greg Werner
Ranch Hand
Posts: 54
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Ummm, no. You'll either need to chain them on the client, or combine them into a single request.

This waves a huge red flag. What are you really trying to accomplish?



Acutally Bear this is sort of in conjunction with another forum topic I posted in here before. The fundamental task I am trying to accomplish is passing tons and tons of data between jsp pages. I think if I set maxPostSize="0" in my Tomcat server.xml file that would do it? I was trying to come up with away of working around some kind of post length limit i was running into. I can do a single request if I can overcome the post length limit I am running across, and I think that might be why posts of a certain length I was reaching were failing. I just did not discover that feature of Tomcat until now because I am more familiar professionally with oc4j.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17627
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Both Tomcat and the popular web browsers run multiple concurrent threads, so if you want synchronicity, you'll have to explicitly enforce it on the client side. Although you're seeing this in a multi-CPU environment, even in a single-core system you have the same risk.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13048
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, now I am curious about your working environment - what is this "post length limit" and where is it enforced?

The phrase:

passing tons and tons of data between jsp pages.


is rather alarming - are you really using JSP to process tons of data?

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic