📄 server-tags.xtp
字号:
<parents>server</parents><p><keepalive-select-thread-timeout> is a short timeout allowingthe select manager to wait for a keepalive before detaching thethread. This value would not normally be changed.d wou</p><default>1s</default></defun><defun title="<keepalive-timeout>" version="Resin 3.1"><parents>server</parents><p><keepalive-timeout> configures how long a keepaliveconnection should wait for a new request before closing. </p><p>Keepalives are used both for HTTP connections and for load-balancing andclustering connections. HTTP connections generally have a single HTML page,followed by a number of image requests. By using keepalives, all the requestscan use a single socket. The <keepalive-timeout> should be longenough to catch all the HTTP burst requests, but can close after theburst is complete. A value of 5s or 10s is generally sufficient.</p><p>The load-balancing and clustering keepalives have a differenttimeout behavior. Since load-balancing sockets are reused for multipleclients, they can have longer timeouts.</p><default>10s</default><example title="keepalive-thread-max in resin.xml"><resin xmlns="http://caucho.com/ns/resin"> <cluster id="web-tier"> <server-default> <http port="80"/> <thread-max>512</thread-max> <keepalive-max>100</keepalive-max> <keepalive-timeout>10s</keepalive-timeout> </server-default> <server id="web-a" address="192.168.0.10"/> ... </cluster></resin></example></defun><defun title="<load-balance-connect-timeout>" version="Resin 3.1"><parents>server</parents><p><load-balance-connect-timeout> configures the maximum timea client connection to a cluster-port shouldtake. The <a href="resin-clustering.xtp">load balance</a> and<a href="config-sessions.xtp">persistent sessions</a> use load-balance-connect-timeoutto connect to backend or peer servers in the cluster.</p><p>Lower values detect failed servers more quickly, but a too-low valuecan timeout too quickly for a live server with some network congestion.</p><default>5s</default><example title="load-balance-connect-timeout"><resin xmlns="http://caucho.com/ns/resin"> <cluster id="app-tier"> <server-default> <load-balance-connect-timeout>2s</load-balance-connect-timeout> </server-default> <server id="a" address="192.168.0.10" port="6800"/> <server id="b" address="192.168.0.11" port="6800"/> <host id=""> ... </cluster></resin></example></defun><defun title="<load-balance-recover-time>" version="Resin 3.1"><parents>server</parents><p><load-balance-recover-time> is the maximum timethe <a href="resin-clustering.xtp">load balancer</a>will consider the server dead after a failure before retryingthe connection.</p><p>Resin uses the load-balance-recover-time to avoid wasting time trying toconnect to an unavailable app-tier server.</p><p>Lower values let the load balancer use a restarted <g>app-tier</g> serverfaster, but lower values also increase the overhead of trying tocontact unavailable servers.</p><default>15s</default><example title="load-balance-recover-time"><resin xmlns="http://caucho.com/ns/resin"> <cluster id="app-tier"> <server-default> <load-balance-recover-time>10s</load-balance-recover-time> </server-default> <server id="a" address="192.168.0.10" port="6800"/> <server id="b" address="192.168.0.11" port="6800"/> <host id=""> ... </cluster></resin></example></defun><defun title="<load-balance-idle-time>" version="Resin 3.1"><parents>server</parents><p><load-balance-idle-time> is the maximum timethe <a href="resin-clustering.xtp">load balancer</a>and <a href="config-sessions.xtp">distributed sessions</a> will leave anidle socket before closing it.</p><p>The default value is normally sufficient, since it tracks thekeepalive of the cluster port.</p><p>load-balance-idle-time must be less than the <var>keepalive</var> value ofthe target <a href="port-tags.xtp#cluster-port">cluster-port</a>.</p><p>The load balancer and distributed sessions reuse sockets to thecluster peer and <g>app-tier</g> servers to improve TCP performance.The load-balance-idle-time limits the amount of time those sockets canremain idle.</p><p>Higher values may improve the socket pooling, but may also increasethe chance of connecting to a closed server.</p><default>keepalive-timeout - 1s</default></defun><defun title="<load-balance-warmup-time>" version="Resin 3.1"><parents>server</parents><p>The time the <a href="resin-clustering.xtp">load balancer</a>uses to throttle connections to an <g>app-tier</g> server that's juststarting up.</p><p>Java web-applications often start slowly while they initialize caches.So a newly-started application will often be slower and consume moreresources than a long-running application. The warmup-time increasesResin's reliability by limiting the number of requests to a newapp-tier server until the server has warmed up.</p><p>Larger values give the application a longer time to warm up.</p><default>60s</default><example title="load-balance-warmup-time"><resin xmlns="http://caucho.com/ns/resin"> <cluster id="app-tier"> <server-default> <load-balance-warmup-time>60s</load-balance-warmup-time> </server-default> <server id="a" address="192.168.0.10" port="6800"/> <server id="b" address="192.168.0.11" port="6800"/> <host id=""> ... </cluster></resin></example></defun><defun title="<load-balance-weight>" version="Resin 3.1"><parents>server</parents><p>load-balance-weight assigns a load-balance weight to a backend server.Servers with higher values get more requests. Servers with lowervalues get fewer requests.</p><p>In some cases, some <g>app-tier</g> servers may be more powerful thanothers. load-balance-weight lets the load-balancer assign more connectionsto the more powerful machines.</p><p>Test and profiling servers can also use load-balance-weight to receive asmall number of connections for profiling purposes.</p><p>Larger values tell the load-balancer to assign more requests tothe app-tier server.</p><default>100</default><example title="load-balance-weight"><resin xmlns="http://caucho.com/ns/resin"> <cluster id="app-tier"> <server id="a" address="192.168.0.10" port="6800"/> <server id="b" address="192.168.0.10" port="6800"/> <server id="test" address="192.168.0.100" port="6800"> <load-balance-weight>1</load-balance-weight> </server> <host id=""> ... </cluster></resin></example></defun><defun title="<memory-free-min>" version="Resin 3.1"><parents>server</parents><p><memory-free-min> improves server reliability by detectinglow-memory situations caused by memory leaks and forcing aclean server restart. Since Resin's <g>watchdog</g> servicereliably restarts the server, a website can improve stability by forcinga restart before memory becomes a major problem. The memory-free-minrestart will also log a warning, notifying the developers thata potential memory leak needs to be resolved.</p><p>When free heap memory gets very low, the garbage collector canrun continually trying to free up extra memory. This continualgarbage collection can send the CPU time to 100%, cause the site tobecome completely unresponsive, and yet take a long time before finallyfailing to an out of memory error (forcing an unclean restart). To avoid thissituation, Resin will detect the low-memory condition and gracefullyrestart the server when free memory becomes too low.</p><p>The ultimate solution to any memory leak issues is to get amemory profiler, find the leaking memory and fix it. <memory-free-min>is just a temporary bandage to keep the site running reliably untilthe memory leak can be found and fixed.</p><default>1m</default><example title="memory-free-min resin.xml"><resin xmlns="http://caucho.com/ns/resin"> <cluster id="web-tier"> <server-default> <thread-max>512</thread-max> <memory-free-min>1m</memory-free-min> </server-default> <server id="web-a" address="192.168.0.10"/> ... </cluster></resin></example></defun><defun title="<port>" version="Resin 3.1"><parents>server</parents><p>The server <port> defines the TCP port for Resincluster communication and load balancing. Most server instanceswill use a common port like 6800, while machines with multipleservers may use multiple ports like 6800 and 6801.</p><default>6800</default><example title="multipl servers on a machine "><resin xmlns="http://caucho.com/ns/resin"> <cluster id="app-tier"> <server id="app-a" address="192.168.1.11" port="6800"/> <server id="app-b" address="192.168.1.11" port="6801"/> <server id="app-b" address="192.168.2.12" port="6800"/> <server id="app-c" address="192.168.2.12" port="6801"/> ... </cluster></resin></example></defun><defun title="<protocol>" version="Resin 3.1"><parents>server</parents><p><protocol> configures custom socket protocols using Resin's threadand connection management.</p><p>The custom protocol will extend from com.caucho.server.port.Protocol.</p><example><resin xmlns="http://caucho.com/ns/resin"><cluster id="web-tier"> <server id="a"> <protocol address="localhost" port="8888"> <type>example.Magic8BallProtocol</type> </port> </server></cluster></resin></example></defun><defun title="<server>" version="Resin 3.1"><parents>cluster</parents><p><server> configures a JVM instance in the cluster.Each <server> is uniquely identified byits <var>id</var> attribute. The <var>id</var> will matchthe -server-id command line argument.</p><p>The server listens to an internal network address,e.g. 192.168.0.10:6800 for clustering, load balancing,and administration.</p><p>The current server is managed with a<a href="javadoc|com.caucho.management.server.ServerMXBean">ServerMXBean</a>.The <g>ObjectName</g> is <var>resin:type=Server</var>.</p><p>Peer servers are managed with <a href="javadoc|com.caucho.management.server.ServerConnectorMXBean">ServerConnectorMXBean</a>. The ObjectName is <var>resin:type=ServerConnector,name=server-id</var>.</p><deftable-childtags><tr><td>id</td> <td>unique server identifier</td> <td>required</td></tr><tr><td>address</td> <td>IP address of the cluster port</td> <td>127.0.0.1</td></tr><tr><td>port</td> <td>The cluster port</td> <td>6800</td></tr></deftable-childtags><example title="server"><resin xmlns="http://caucho.com/ns/resin"> <cluster id="web-tier"> <server id="a" address="192.168.0.10" port="6800"> <http port="8080"/> </server> <server id="b" address="192.168.0.11" server-port="6800"> <http port="8080"/> </server>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -