⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 server-tags.xtp

📁 RESIN 3.2 最新源码
💻 XTP
📖 第 1 页 / 共 3 页
字号:
        &lt;server id="c" address="192.168.0.12" server-port="6800"&gt;          &lt;http port="8080"/&gt;        &lt;/server&gt;        &lt;host id=""&gt;          ...    &lt;/cluster&gt;&lt;/resin&gt;</example><p>Main configuration for the server, configuring ports,threads and virtual hosts.</p><ul><li>Common resources for all virtual hosts and web-apps.</li><li>Thread pooling</li><li>HTTP and SRUN/Cluster ports</li><li>Caching</li><li>virtual host configuration and common web-app-default</li></ul><p>The &lt;server&gt; will generally contain a &lt;class-loader&gt; configurationwhich loads the resin/lib jars dynamically, allowing for system-wide jarsto be dropped into resin/lib.  &lt;server&gt; configuresthe main dynamic environment.  Database pools common to all virtual hosts,for example, should be configured in the &lt;server&gt; block.</p><p>The &lt;server&gt; configures the &lt;thread-pool&gt; and a setof &lt;http&gt; and &lt;srun&gt; ports which share the thread pool.Requests received on those ports will use worker threads from thethread pool.</p><deftable-childtags><tr><td>alternate-session-url-prefix</td>    <td>a prefix to add the session to the beginning of the URL as a path        prefix instead of the standard ;jsessionid= suffix. For clients like        mobile devices with limited memory, this will allow careful web        designers to minimize the page size.</td>    <td>null</td></tr><tr><td>keepalive-max</td>    <td>the maximum number of keepalive connections</td>    <td>512</td></tr><tr><td>keepalive-thread-timeout</td>    <td>the maximum time a connection is maintained in the keepalive state</td>    <td>120s</td></tr></deftable-childtags><example title="alternate-session-url-prefix">&lt;server&gt;  ...  &lt;alternate-session-url-prefix&gt;/~J=&lt;/alternate-session-url-prefix&gt;  ...</example><s2 name="server-el" title="EL variables and functions"><deftable title="EL variables defined by &lt;server&gt;"><tr><th>variable</th>    <th>corresponding API</th></tr><tr><td>serverId</td>    <td><i>server</i>.getServerId()</td></tr><tr><td>root-dir</td>    <td><i>server</i>.getRootDirectory()</td></tr><tr><td>server-root</td><td><i>server</i>.getRootDirectory()</td></tr></deftable><deftable title="EL functions defined by &lt;server&gt;"><tr><th>function</th>    <th>corresponding API</th></tr><tr><td>jndi</td>    <td><a href="javadoc|com.caucho.naming.Jndi|lookup(String)">Jndi.lookup(String)</a></td></tr></deftable></s2></defun><defun title="&lt;server-default>" version="Resin 3.1"><parents>cluster</parents><p>&lt;server-default> defines default values forall &lt;server&gt; instances.  Since most &lt;server> configurationis identical for all server instances, the shared configuration belongsin a &lt;server-default>.  For example, &lt;http> ports, timeouts,JVM arguments, and keepalives are typically identical for allserver instances and therefore belong in a server-default.</p><example title="server">&lt;resin xmlns="http://caucho.com/ns/resin"&gt;    &lt;cluster id="web-tier"&gt;        &lt;server-default&gt;           &lt;thread-max>512&lt;/thread-max>           &lt;jvm-arg>-Xmx512m -Xss1m&lt;/jvm-arg>           &lt;http port="8080"/&gt;        &lt;/server-default&gt;        &lt;server id="a" address="192.168.0.10" port="6800"/&gt;        &lt;server id="b" address="192.168.0.11" port="6800"/&gt;        &lt;server id="c" address="192.168.0.12" port="6800"/&gt;        &lt;host id=""&gt;          ...    &lt;/cluster&gt;&lt;/resin&gt;</example></defun><defun title="&lt;shutdown-wait-max>" version="Resin 3.0"><parents>server</parents><p>&lt;shutdown-wait-max> configures the maximum time the serverwill wait for the graceful shutdown before forcing an exit.</p><default>60s</default></defun><defun title="&lt;socket-timeout>" version="Resin 3.1"><parents>http, cluster-port, protocol, server</parents><p>&lt;socket-timeout> is the maximum timea socket <a href="resin-clustering.xtp">load balancer</a>and <a href="config-sessions.xtp">distributed sessions</a> will wait fora read or write to a cluster socket.</p><p>Crashed servers may never respond to a read request or accept a write.The socket-timeout lets Resin recover from these kinds of crashes.</p><p>Lower values can detect crashes more quickly, but too-low values mayreport bogus failures when the server machine is just a little slow.</p><default>60s</default><example title="socket-timeout">&lt;resin xmlns="http://caucho.com/ns/resin"&gt;    &lt;cluster id="app-tier"&gt;        &lt;server-default>          &lt;socket-timeout>60s&lt;/socket-timeout>        &lt;/server-default>        &lt;server id="a" address="192.168.0.10" port="6800"/&gt;        &lt;server id="b" address="192.168.0.11" port="6800"/&gt;        &lt;host id=""&gt;          ...    &lt;/cluster&gt;&lt;/resin&gt;</example></defun><defun title="&lt;thread-idle-max>" version="Resin 3.1"><parents>server</parents><p>&lt;thread-idle-max> configures the maximum number of idlethreads in the thread pool.  &lt;thread-idle-max> workswith &lt;thread-idle-min> to maintain a steady number of idlethreads, avoiding the creation or destruction threads when possible.</p><p>&lt;thread-idle-max> should be set high enough beyond&lt;thread-idle-min> so a spiky load will avoidcreating a thread and then  immediately destroying it.</p><default>10</default><example title="thread-idle-max in resin.xml">&lt;resin xmlns="http://caucho.com/ns/resin"&gt;  &lt;cluster id="web-tier"&gt;    &lt;server-default&gt;      &lt;thread-max>512&lt;/thread-max>      &lt;thread-idle-min>10&lt;/thread-idle-min>      &lt;thread-idle-max>20&lt;/thread-idle-max>      &lt;jvm-arg>-Xss1m -Xmx1024m&lt;/jvm-arg>    &lt;/server-default&gt;    &lt;server id="web-a" address="192.168.0.10"/>        ...  &lt;/cluster>&lt;/resin></example></defun><defun title="&lt;thread-idle-min>" version="Resin 3.1"><parents>server</parents><p>&lt;thread-idle-min> configures the minimum number of idlethreads in the thread pool.  &lt;thread-idle-min> helps spiky loads,avoiding delays for thread requests by keeping threads ready for futurerequests.  When the number of idle threads dropsbelow &lt;thread-idle-min>, Resin creates a new thread.</p><p>&lt;thread-idle-min> should be set high enough to deal with loadspikes.  Since idle threads are relatively inexpensive in modern operatingsystems, having a number of idle threads is not a major resource hog,especially since these threads are idle, waiting for a new job.</p><p>&lt;thread-idle-min> works together with &lt;thread-idle-max> toavoid thread allocation thrashing, i.e. avoiding creating a new threadbecause of &lt;thread-idle-min> and then quickly destroying itbecause of &lt;thread-idle-max>.</p><default>5</default><example title="thread-idle-min in resin.xml">&lt;resin xmlns="http://caucho.com/ns/resin"&gt;  &lt;cluster id="web-tier"&gt;    &lt;server-default&gt;      &lt;thread-max>512&lt;/thread-max>      &lt;thread-idle-min>10&lt;/thread-idle-min>      &lt;thread-idle-max>20&lt;/thread-idle-max>      &lt;jvm-arg>-Xss1m -Xmx1024m&lt;/jvm-arg>    &lt;/server-default&gt;    &lt;server id="web-a" address="192.168.0.10"/>        ...  &lt;/cluster>&lt;/resin></example></defun><defun title="&lt;thread-max>" version="Resin 3.1"><parents>server</parents><p>&lt;thread-max> configures the maximum number of threadsmanaged by Resin's thread pool.  Resin's thread pool is usedfor connection threads, timers, and Resin worker threads for JMS, JCAand EJB.  Since Resin's thread pool only manages Resin threads,the actual number of threads in the JVM will be higher.</p><p>Modern operating systems can handle a fairly large number of threads,so values of 512 or 1024 are often reasonable values for thread-max.  Themain limitation for thread-max is virtual memory.  Since each threadtakes up stack space (configured with -Xss), a 32-bit systemmight have a thread limit based on virtual memory.</p><p>For example, on Linux the user space is only 2G.  If the heap memoryis 1024m (-Xmx1024m) and the stack size is 1m (-Xss1m), the maximumnumber of threads is somewhat less than 1024.</p><p>In general, JVMs do not handle running out of threads very well, eitherfreezing or throwing out of memory errors.  Although it may be necessaryto limit the number of threads to avoid running out of memory,&lt;thread-max> should generally be set to a high value.</p><example title="thread-max in resin.xml">&lt;resin xmlns="http://caucho.com/ns/resin"&gt;  &lt;cluster id="web-tier"&gt;    &lt;server-default&gt;      &lt;thread-max>512&lt;/thread-max>      &lt;jvm-arg>-Xss1m -Xmx1024m&lt;/jvm-arg>    &lt;/server-default&gt;    &lt;server id="web-a" address="192.168.0.10"/>        ...  &lt;/cluster>&lt;/resin></example><default>4096</default></defun><defun title="&lt;user-name>" version="Resin 3.1"><parents>server</parents><p>&lt;user-name> configures the operating system user Resin shouldrun as.  Since the HTTP port 80 is protected in Unix, the web serverneeds to start as root to bind to port 80.  For security, Resin shouldswitch to a non-root user after binding to port 80.</p><example title="resin.xml with user-name">&lt;resin xmlns="http://caucho.com/ns/resin">  &lt;cluster id="app-tier">    &lt;server-default>      &lt;http port="80"/>      &lt;user-name>resin&lt;/user-name>    &lt;/server-default>    &lt;server id="web-a"/>    ...  &lt;/cluster>&lt;/resin></example></defun><defun title="&lt;watchdog-arg>" version="Resin 3.1"><parents>server</parents><p>The &lt;watchdog-arg> configures arguments for thewatchdog process.  The watchdog improves reliability bymonitoring the Resin instance, restarting it if necessary.</p><p>The &lt;watchdog-arg> typically is used to enable <g>jconsole</g>for the watchdog JVM.</p><example title="resin.xml">&lt;resin xmlns="http://caucho.com/ns/resin">  &lt;cluster id="app-tier">    &lt;server-default>      &lt;watchdog-arg>-Dcom.sun.management.jmxremote&lt;/watchdog-arg>    &lt;/server-default>    ...         &lt;/cluster>&lt;/resin></example></defun><defun title="&lt;watchdog-port>" version="Resin 3.1"><parents>server</parents><p>&lt;watchdog-port> configures the administration port for thewatchdog JVM.  The watchdog launches the server JVM and monitors itshealth, restarting the JVM when necessary to improve site reliability.The command line arguments use the watchdog-port forthe "start" and "stop" commands to tell the watchdog to start andstop the server JVM.  The administration also uses the watchdog portfor watchdog administration.</p><p>The watchdog port will use the same &lt;address> as the server, so itwill always be an internal network address, never an external internetaddress.</p><default>6700</default></defun></body></document>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -