Ajax How to set timeout (one action performed 2 times) _ajax related

Source: Internet
Author: User
Tags tomcat

Today in the test project found that an action performed 2 times, this operation takes approximately 5 minutes to complete, engineering environment apache2+tomcat6.0.

The online search found several places to set timeouts:

1.ajax syntax to set the unit millisecond, for example:

$.ajax ({ 
url:xxx, 
timeout:600000, 
type: ' POST ', 
data: { 
}, 
error:function () { 
Show_ Fail_meg ("Boot system failed!) "); 
} 
});

2.tomcat Configuration server.xml Unit milliseconds

Connector port= "8080" protocol= "http/1.1" connectiontimeout= "20000" redirectport= "8443" 
UTF-8 "/>

3.apache configuration file httpd.conf, unit seconds

# 
# timeout:the number of seconds before receives and sends time out. 
# 
Timeout 60

Modify the above several places, found still not effective, and finally positioned in the MOD_JK module,

MOD_JK abbreviation JK is an pluggable module of the Apache server that provides the ability to handle jsp/servlet for Apache or IIS servers.

That is, JK settings may overwrite the settings of Apache2 and Tomcat as well as Ajax.

The contents of JK's configuration file/etc/httpd/conf/workers.properties are as follows:

worker.master.socket_timeout=300

Sure enough to see this number is exactly 5 minutes, with the exception of the same phenomenon, after the reboot, normal!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.