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

📄 resin-admin.xtp

📁 RESIN 3.2 最新源码
💻 XTP
📖 第 1 页 / 共 2 页
字号:
<document>  <header>    <product>resin</product>    <title>Resin Administration</title>    <type>contents</type>    <description><p>The /resin-admin web-app provides an administration overview of aResin server.  Resin-Pro users can obtain information across the entirecluster, profile a running Resin instance, and obtain thread dumps andheap dumps.</p><p>All Resin users should familiarize themselves with the thread dump,profile, and heap capabilities.</p>    </description>  </header>  <body><localtoc/><s1 title="/resin-admin web-app"><p>The /resin-admin web-app provides an administration overview of aResin server.  Resin-Pro users can obtain information across the entirecluster, profile a running Resin instance, and obtain thread dumps andheap dumps.</p><s2 title="Configuring /resin-admin"><p>Since /resin-admin is just a web-app implemented with Quercus/PHP,enabling it is just adding an appropriate &lt;web-app> tag.</p><p>For security, you will also need to add a &lt;user> tothe &lt;management> section of the resin.xml.  The password will bea MD5 hash.  By default, the /resin-admin web-app provides a formfor generating the hash codes.  You will need to copy the generatedpassword into the resin.xml.  This guarantees that you have accessto the resin.xml itself to add any users.  In other words, the configurationis very cautious about security issues to enable the administration.</p><example title="resin.xml /resin-admin configuration">&lt;resin xmlns="http://caucho.com/ns/resin"       xmlns:resin="http://caucho.com/ns/resin/core"&gt;  &lt;management>     &lt;user name="harry" password="MD5HASH=="/>  &lt;/management>&lt;cluster id="">&lt;host id="">  &lt;web-app id="/resin-admin" root-directory="${resin.home}/php/admin">     &lt;prologue>        &lt;resin:set var="resin_admin_external" value="false"/>        &lt;resin:set var="resin_admin_insecure" value="true"/>     &lt;/prologue>  &lt;/web-app>&lt;/host>&lt;/cluster>&lt;/resin></example></s2><s2 title="/resin-admin summary tab"><p>The summary tab provides a basic overview of the Resin instance.Resin-Pro users can see the summary page of each server in a cluster.</p><p>The overview section shows basic configuration informationlike the server-id, Resin version, Resin home, memory information,and how long the instance has been up.  It's useful as a basiccheck to verify the configuration and see if the server is having anyproblems.</p><s3 title="Thread pool"><p>The thread pool give the current state of Resin's threads.</p></s3><s3 title="TCP ports"><p>The TCP ports gives information about the HTTP, HTTPS, and cluster ports,showing how many threads are active and also how many connections arein various keepalive states.</p></s3><s3 title="Server Connectors - Load Balancing"><p>The Server Connectors section is the main section for load balancing.It will give an overview of any failures in connecting to the backendservers, showing the latency and load.</p></s3><s3 title="Connection pools - Database pooling"><p>The connection pool section shows the state and history of the databasepools.</p></s3><s3 title="WebApps"><p>The WebApps shows the current state of the active web-apps foreach virtual host.  In particular, it will show the time and number ofany 500 errors, letting you track down errors in the log files.</p></s3></s2><s2 title="/resin-admin config tab"><p>The config tag summarizes Resin's internal configuration.  This tabcan be useful to double-check that the values in the resin.xml andweb.xml match the expected values.</p></s2><s2 title="/resin-admin threads tab"><p>The threads tab is a critical debugging tab.  It shows the stateand stack trace of every thread in the JVM, grouped by functionality.If the server ever freezes or moves slowly, use the thread tab as yourfirst resource for figuring out what's going on in the system.</p><p>All Resin users should familiarize themselves with the thread dumpfor their application.  It's very important to understand thenormal, baseline status, so if something does go wrong, you'll knowwhat looks different.</p><p>In particular, any freeze or slowness of Resin should immediatelysuggest looking at the thread page.</p></s2><s2 title="/resin-admin cpu profile tab"><p>The cpu profile tab lets you gather basic profiling information ona running Resin server.  Because the overhead is low, it's even possibleto run a profile on a deployment server, which will give much betterinformation about the performance of your system than any artificialbenchmarks.</p><p>With Resin's integrated profiling, there's no excuse to skip theprofiling step for your application.</p></s2><s2 title="/resin-admin heap dump tab"><p>The heap dump tab lets you gather a heap memory information at anytime, giving you critical information at times when you may not havea dedicated profiler available.</p></s2></s1><s1 title="Admin topics"><s2 title="Interpreting the proxy cache hit ratio"><p>The proxy cache is Resin's internal proxy cache (in Resin Pro).The hit ratio marks what percentage of requests are served out of thecache, i.e. quickly, and which percentage are taking the full time.</p><p>The proxy cache hit ratio is useful for seeing if you can improve yourapplication's performance with better caching.  For example, if you hada news site like www.cnn.com, you should have a high hit rate to makesure you're not overtaxing the database.</p><p>If you have a low value, you might want to look at your heavily usedpages to see if you can cache more.</p></s2></s1><s1 title="Resin's JMX Interfaces"><p>See <a href="http://caucho.com/resin-javadoc/com/caucho/management/server/package-summary.html">com.caucho.management.server JavaDoc</a>.</p><ul><li><a href="http://caucho.com/resin-javadoc/com/caucho/management/server/BlockManagerMXBean">BlockManagerMXBean</a>- performance data for the proxy cache, clustered sessions,and JMS queues.</li><li><a href="http://caucho.com/resin-javadoc/com/caucho/management/server/ConnectionPoolMXBean">ConnectionPoolMXBean</a>- JDBC database pools.</li><li><a href="http://caucho.com/resin-javadoc/com/caucho/management/server/HostMXBean">HostPoolMXBean</a>- virtual host management.</li><li><a href="http://caucho.com/resin-javadoc/com/caucho/management/server/JmsQueueMXBean">JmsQueueMXBean</a>- jms queue management.</li><li><a href="http://caucho.com/resin-javadoc/com/caucho/management/server/JmsTopicMXBean">JmsTopicMXBean</a>- jms topic management.</li><li><a href="http://caucho.com/resin-javadoc/com/caucho/management/server/LoggerMXBean">LoggerMXBean</a>- java.util.logging management.</li><li><a href="http://caucho.com/resin-javadoc/com/caucho/management/server/PortMXBean">PortMXBean</a>- http, https, and custom TCP ports.</li><li><a href="http://caucho.com/resin-javadoc/com/caucho/management/server/ProxyCacheMXBean">ProxyCacheMXBean</a>- Resin's integrated proxy cache.</li><li><a href="http://caucho.com/resin-javadoc/com/caucho/management/server/ResinMXBean">ResinMXBean</a>- Parent MXBean for Resin corresponding to the &lt;resin> configuration tag.</li><li><a href="http://caucho.com/resin-javadoc/com/caucho/management/server/ServerConnectorMXBean">ServerConnectorMXBean</a>- client view of a peer server in a cluster.</li><li><a href="http://caucho.com/resin-javadoc/com/caucho/management/server/ServerMXBean">ServerMXBean</a>- information about the JVM <a href="http://wiki.caucho.com/Server">server</a> instance.</li><li><a href="http://caucho.com/resin-javadoc/com/caucho/management/server/SessionManagerMXBean">SessionManagerMXBean</a>- information about a web-app's session manager.</li><li><a href="http://caucho.com/resin-javadoc/com/caucho/management/server/ThreadPoolMXBean">ThreadPoolMXBean</a>- information about Resin's internal thread pool.</li><li><a href="http://caucho.com/resin-javadoc/com/caucho/management/server/WebAppMXBean">WebAppMXBean</a>- information about a Resin web-app.</li></ul></s1><s1 title="JMX Instrumenting Beans"><p>Resin's IoC container can register the application's serviceswith JMX automatically.  The registered beans will then be availablein a JMX application like jconsole or through PHP or Java.</p><ol><li>For a class <code>MyFoo</code>, create aninterface <code>MyFooXMBean</code> with the management interface.</li><li>Class <code>MyFoo</code> needs to implementthe <code>MyFooMBean</code> interface.</li><li>When Resin handles the &lt;bean> tag, it willregister <code>MyFoo</code> with the JMX server.</li></ol><s2 title="Instrumenting a bean"><p>Resin will automatically register any servlet whichimplements an MBean interface.  By default, the JMX name will be:</p><def>resin:name=<var>name</var>,type=<var>type</var>,Host=<var>name</var>,WebApp=<var>name</var></def><deftable title="ObjectName attributes"><tr>  <th>Attribute</th>  <th>Value</th></tr><tr>  <td>type</td>  <td>The FooMBean name minus the MBean, e.g. "Foo"</td></tr><tr>  <td>name</td>  <td>the bean's name value</td></tr><tr>  <td>Host</td>  <td>the virtual host name</td></tr><tr>  <td>WebApp</td>  <td>the web-app's context path</td></tr></deftable><p>The domain is <var>web-app</var>, the type propertyis calculated from the MBean class name and the name property is the valueof &lt;name&gt;.</p><p>JMX clients will use the name to manage the bean.  For example,a client might use the pattern <var>web-app:type=Foo,*</var>to retrieve the bean.</p><example title="MyServiceMBean.java">package test;public interface MyServiceMBean {  public int getCount();}</example><example title="MyServlet.java">package test;import java.io.*;import javax.servlet.*;public class MyService implements MyServiceMBean{  private int _count;  public int getCount()  {    return _count;  }  public void doStuff()  {    _count++;  }}</example></s2><s2 title="PHP: Displaying and Managing Resources"><p>The easiest way to display and manage JMX is with PHP.  The /resin-adminweb-app provides several examples of getting JMX data.</p><example title="PHP: Getting the Count attribute">&lt;php?$mbean_server = new MBeanServer();$service = $mbean_server->query("resin:*,type=MyService");echo "Service.count: " . $service[0]->Count . "\n";?></example></s2></s1><s1 title="JMX Console"><p>JDK 5.0 includes a JMX implementation that is used to provide local and remote administration of a Resin server.  The JVM willexpose JMX if it's started with appropriate <var>-D</var>system properties.  For example, <var>-Dcom.sun.management.jmxremote</var>will expose JMX to the local machine.</p><p>To configure the JVM arguments for Resin, you'll add a &lt;jvm-arg>to the resin.xml.  When Resin's <ahref="http://wiki.caucho.com/Watchdog">Watchdog</a> process starts Resin,it will pass along the configured arguments, enabling JMX administration.</p><example title="Start Resin and allow local JMX administration">&lt;resin xmlns="http://caucho.com/ns/resin">&lt;cluster id="">  &lt;server-default>    &lt;jvm-arg>-Dcom.sun.management.jmxremote&lt;/jvm-arg>  &lt;/server-default>  ...&lt;/cluster>&lt;/resin></example><example title="Start jconsole">win&gt; jconsole.exeunix&gt; jconsole

⌨️ 快捷键说明

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