Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to set timeouts in tomcat?

Can I set timeouts for JSP pages in tomcat either on a per page or server level?

like image 563
timdisney Avatar asked Mar 01 '23 06:03

timdisney


2 Answers

In the Tomcat server.xml file, the Connector element also has a connectionTimeout attribute in milliseconds.

Example:

<Connector
    URIEncoding="UTF-8"
    acceptCount="100"
    connectionTimeout="20000"
    disableUploadTimeout="true"
    enableLookups="false"
    maxHttpHeaderSize="8192"
    maxSpareThreads="75"
    maxThreads="150"
    minSpareThreads="25"
    port="7777"
    redirectPort="8443" />
like image 111
Mojo Avatar answered Mar 07 '23 08:03

Mojo


For server level, you can try this.
you have to change catalina.bat / catalina.sh file

jvm OPTIONS : -Dsun.net.client.defaultConnectTimeout=60000 -Dsun.net.client.defaultReadTimeout=60000 
like image 23
anjanb Avatar answered Mar 07 '23 08:03

anjanb