<?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>blognya orang telat ngeblog &#187; server</title>
	<atom:link href="http://wis.nu/category/server/feed" rel="self" type="application/rss+xml" />
	<link>http://wis.nu</link>
	<description>simple life from simple guy</description>
	<lastBuildDate>Wed, 19 May 2010 15:28:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>When Your Dedicated Server Is Not Enough</title>
		<link>http://wis.nu/when-your-dedicated-server-is-not-enough.html</link>
		<comments>http://wis.nu/when-your-dedicated-server-is-not-enough.html#comments</comments>
		<pubDate>Wed, 08 Oct 2008 17:11:56 +0000</pubDate>
		<dc:creator>wisnu</dc:creator>
				<category><![CDATA[server]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://wis.nu/?p=13</guid>
		<description><![CDATA[Having several network websites that have around 200.000 unique visitors and hits 400.000 page views per day could be a dream for webmaster. But it is not. That&#8217;s killing me!
Right now I&#8217;m  using dedicated server with 8-cores Xeon processor and 8Gb RAM. By default, it using Apache 1.3 web server and MySQL 5 for [...]]]></description>
			<content:encoded><![CDATA[<p>Having several network websites that have around 200.000 unique visitors and hits 400.000 page views per day could be a dream for webmaster. But it is not. That&#8217;s killing me!</p>
<p>Right now I&#8217;m  using dedicated server with 8-cores Xeon processor and 8Gb RAM. By default, it using Apache 1.3 web server and MySQL 5 for database server. 2 weeks ago, Apache were restarted almost 10 times a day. From Apache logs, it shows that MaxClient were reach it&#8217;s limit.</p>
<p class="yellow"><code><br />
[root@roninbox ]#tail -f /etc/httpd/logs/error_log<br />
[Wed Oct  8 19:26:56 2008] [error] server reached MaxClients setting, consider raising the MaxClients setting.<br />
[root@roninbox ]# ps aux | grep httpd | wc -l<br />
360<br />
[root@roninbox ]# lsof -u nobody | wc -l<br />
2505<br />
</code></p>
<p>From default httpd.conf I saw that MaxClients value still sets on 150. Let&#8217;s see what it means&#8230;</p>
<p><span id="more-13"></span>
</p>
<p class="yellow"><code><br />
# Limit on total number of servers running, i.e., limit on the number<br />
# of clients who can simultaneously connect --- if this limit is ever<br />
# reached, clients will be LOCKED OUT, so it should NOT BE SET TOO LOW.<br />
# It is intended mainly as a brake to keep a runaway server from taking<br />
# the system with it as it spirals down...</code></p>
<p>Currently I have around 360 httpd process in my server and apache MaxClients still sets on 150, so this is first parameter that I have to change (can be different on each typical server usage). The point is, we have to make sure that we must reduce usage per client slot, and reduce the total number of slots needed to serve a given amount of traffic.
</p>
<p class="yellow"><code><br />
<strong>KeepAliveTimeout 15</strong><br />
#<br />
# Server-pool size regulation.  Rather than making you guess how many<br />
# server processes you need, Apache dynamically adapts to the load it<br />
# sees --- that is, it tries to maintain enough server processes to<br />
# handle the current load, plus a few spare servers to handle transient<br />
# load spikes (e.g., multiple simultaneous requests from a single<br />
# Netscape browser).<br />
#<br />
# It does this by periodically checking how many servers are waiting<br />
# for a request.  If there are fewer than MinSpareServers, it creates<br />
# a new spare.  If there are more than MaxSpareServers, some of the<br />
# spares die off.  The default values are probably OK for most sites.<br />
#<br />
</code></p>
<p><strong>Keepalive Timeout:</strong> This should be low on any site so that clients slots free up for new users quickly. Keepalive timeout is the number of seconds a client slot will be sitting around unused, waiting for new client to make a request before it gives up and allows itself to be used by another clients instead. The advantage to keepalives are that the same client doesn’t have to try to connect to your site over and over again to get multiple resources (images, web pages, etc.). Performance will dropped significantly if you are turned off keepalives entirely.
</p>
<p class="yellow"><code><br />
<strong>Timeout 300</strong><br />
# Timeout: The number of seconds before receives and sends time out.<br />
#</code></p>
<p><strong>Timeout:</strong> The default were sets on 300. This means a client will use 300 seconds client slots without using it. Based google <a title="Google Analytics" href="http://google.com/analytics" target="_blank">analytics</a>, my websites&#8217; visitor usually stay around 2 minutes to read the content. Frankly speaking, 300 seconds connect timeout were too high on my server usage.
</p>
<p class="yellow"><code><br />
<strong>MaxRequestsPerChild 0</strong><br />
#<br />
# MaxRequestsPerChild: the number of requests each child process is<br />
# allowed to process before the child dies.  The child will exit so<br />
# as to avoid problems after prolonged use when Apache (and maybe the<br />
# libraries it uses) leak memory or other resources.  On most systems, this<br />
# isn't really needed, but a few (such as Solaris) do have notable leaks<br />
# in the libraries. For these platforms, set to something like 10000<br />
# or so; a setting of 0 means unlimited.<br />
#<br />
# NOTE: This value does not include keepalive requests after the initial<br />
#       request per connection. For example, if a child process handles<br />
#       an initial request and 10 subsequent "keptalive" requests, it<br />
#       would only count as 1 request towards this limit.<br />
#</code></p>
<p><strong>Max Requests per child:</strong> This should also be a low number. Other apache tuning guides recommend a number in the thousands or tens of thousands. That’s great when ram is not at a premium, or when clients tend not to use more ram as they serve more requests, as it means apache won’t spend much time killing and creating new apache instances. It is important to understand however, what effect this has on memory usage.</p>
<p>When a child apache process starts, most of the ram it takes up is actually shared with other programs (shared pages). As a process changes the data stored in these shared pages, it has to make a copy just for itself. As time goes on, a process will be using more and more real memory, and less shared memory. Therefore, to free up ram (at the cost of some cpu), we will eventually kill off an apache child and replace it with a new one. The more often you do this, the less ram you use, so for our purposes, we want a low requests / child process.</p>
<p>There were still some parameters that I haven&#8217;t modified yet, such as <strong>MaxKeepAliveRequests, MinSpareServers, MaxSpareServers</strong>, and so on. Right now I just want to make simple Apache tweak based on my server needs. Of course next time I will consider about expanding of my server depends on my websites growth.</p>
]]></content:encoded>
			<wfw:commentRss>http://wis.nu/when-your-dedicated-server-is-not-enough.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.240 seconds -->
<!-- Cached page generated by WP-Super-Cache on 2010-07-30 02:31:36 -->
