<rss version="2.0">
		<channel>
			<title>Slicehost Forum - apache and mod_php</title>
			<lastBuildDate>Thu, 09 Sep 2010 19:15:17 +0000</lastBuildDate>
			<link>http://forum.slicehost.com/</link>
			<description></description>
			<generator>Lussumo Vanilla 1.1.8</generator>
			<item>
		<title>apache and mod_php</title>
		<link>http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18750#Comment_18750</link>
		<guid isPermaLink="false">http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18750#Comment_18750</guid>
		<pubDate>Wed, 01 Apr 2009 19:07:06 +0000</pubDate>
		<author>mandric</author>
		<description>
			<![CDATA[<p>I have some re-architecting to do with my current setup.  Right now on a 2G slice, I can only run 50 apache
processes, and that seems to hit its limit every couple of days where
there are 50 processes all serving requests which I can see with
/server-status, and service gets highly degraded.</p>

<p>I would like to run a threaded Apache but I do not
know if that is stable with mod_php.  If it's not then I will likely need
to do a nginx proxy, which I'm trying to avoid just because of the
extra configuration, etc, needed to maintain it. I'm really trying to avoid nginx since apache has served me greatly and I think this is a mod_php issue that can be handled.  Also the apps I'm currently supporting, one of them drupal based, has media files all over the place, so configured another server to intercept media requests would be more of an art than a science.</p>

<p>I've been happy with
a streamlined apache but that is near impossible with mod_php and
apache prefork.    I'm not sure if
it's a configuration problem or if it's just a result of the
architecture I've chosen.  An alternative I've had limited success with php is mod_fcgi, or fastcgi. I've had great success with my django apps using mod_fcgi but php has been unstable.  But I haven't run it on a production site yet ...  Ideally I would use mod_fcgi for my php apps and mod_wsgi for my python apps.  This keeps Apache quite lean and on top of that if it's threaded then it should be able to handle lots of traffic without the memory limitations that apache prefork has.  So this is my dilemma, I may need to invest in a new slice to play around with a threaded apache and then migrate stuff.  But this is at least a week of work, any advice is appreciated.</p>
]]>
		</description>
	</item>
	<item>
		<title>apache and mod_php</title>
		<link>http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18781#Comment_18781</link>
		<guid isPermaLink="false">http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18781#Comment_18781</guid>
		<pubDate>Thu, 02 Apr 2009 18:27:08 +0000</pubDate>
		<author>mandric</author>
		<description>
			<![CDATA[<p>well i got more responses on HN than here ... so add your bits there.</p>

<p>http://news.ycombinator.com/item?id=543614</p>
]]>
		</description>
	</item>
	<item>
		<title>apache and mod_php</title>
		<link>http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18784#Comment_18784</link>
		<guid isPermaLink="false">http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18784#Comment_18784</guid>
		<pubDate>Thu, 02 Apr 2009 18:31:51 +0000</pubDate>
		<author>blender</author>
		<description>
			<![CDATA[Pretty hard to come to any conclusions.<br /><br />Maybe you're waiting on disk I/O?<br /><br />What's your iowait under this load?<br /><br />Cheers]]>
		</description>
	</item>
	<item>
		<title>apache and mod_php</title>
		<link>http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18786#Comment_18786</link>
		<guid isPermaLink="false">http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18786#Comment_18786</guid>
		<pubDate>Thu, 02 Apr 2009 18:45:23 +0000</pubDate>
		<author>mandric</author>
		<description>
			<![CDATA[<p>I don't know never used iowait... I'll look into it.  What command do I use?</p>
]]>
		</description>
	</item>
	<item>
		<title>apache and mod_php</title>
		<link>http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18787#Comment_18787</link>
		<guid isPermaLink="false">http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18787#Comment_18787</guid>
		<pubDate>Thu, 02 Apr 2009 18:45:33 +0000</pubDate>
		<author>blender</author>
		<description>
			<![CDATA[Your comment from HN: <br /><br />"I don't know what the bottleneck is really, that is part of the problem. But I know that every now and then when we we get bursts of traffic I can find with a /server-status that 50 apache processing are in a write state."<br /><br />I think you do know what the problem is ;-)<br /><br />What is your PHP Error handling and logging set to? How big are your Apache access_log and error_log files?<br /><br />Cheers]]>
		</description>
	</item>
	<item>
		<title>apache and mod_php</title>
		<link>http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18788#Comment_18788</link>
		<guid isPermaLink="false">http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18788#Comment_18788</guid>
		<pubDate>Thu, 02 Apr 2009 18:51:58 +0000</pubDate>
		<author>blender</author>
		<description>
			<![CDATA[You can use top and look at % "wa" or something like <br /><br />iostat -x 3<br /><br />Which will give you lots of disk related info including %iowait<br /><br />That particular command will give you the stats every 3 seconds until you Ctrl-C out of it.<br /><br />Cheers]]>
		</description>
	</item>
	<item>
		<title>apache and mod_php</title>
		<link>http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18790#Comment_18790</link>
		<guid isPermaLink="false">http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18790#Comment_18790</guid>
		<pubDate>Thu, 02 Apr 2009 19:04:17 +0000</pubDate>
		<author>mandric</author>
		<description>
			<![CDATA[<p>Well all my log files are rotating normally as far as I know ... here's the global log files. I love logrotate.d.</p>

<pre><code>slice:~# ls -al /var/log/apache2/error.log
-rw-r----- 1 root adm 280975 Apr  2 12:05 /var/log/apache2/error.log
slice:~# ls -al /var/log/apache2/access.log
-rw-r----- 1 root adm 1190895 Apr  2 13:50 /var/log/apache2/access.log
</code></pre>

<p>The only bottleneck I have seen is in mysql ... which is hard to debug.</p>

<p>http://andric.us/load/localdomain/localhost.localdomain.html</p>

<p>So you think there is definitely something that is hanging up the apache processes.  So my next question is,if it happens again, is there a way to poke apache to figure out what is the processes doing besides /server-status which just tells me they are all in W (writing) mode?</p>
]]>
		</description>
	</item>
	<item>
		<title>apache and mod_php</title>
		<link>http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18793#Comment_18793</link>
		<guid isPermaLink="false">http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18793#Comment_18793</guid>
		<pubDate>Thu, 02 Apr 2009 19:25:08 +0000</pubDate>
		<author>blender</author>
		<description>
			<![CDATA["So you think there is definitely something that is hanging up the apache processes."<br /><br />Not necessarily.<br /><br />The overall impression I get from your munin stats is that your bottleneck is the disk.<br /><br />You do have iowait - look at the pink in the CPU Usage graphs.<br /><br />High interrupts for blkif - which is some block device driver for Xen I gather.<br /><br />One thing you might want to look at is temporary tables created on disk by MySQL - this can really hurt an application.<br /><br />Run this:<br /><br />mysqladmin -u root -p ext -ri 30 | grep Created_tmp_disk<br /><br />First run will tell you how many on-disk temporary tables were created since last restart of MySQL. Then it will tell you how many are created in the 30 seconds time window (until you Control-C out of it).<br /><br />Cheers]]>
		</description>
	</item>
	<item>
		<title>apache and mod_php</title>
		<link>http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18794#Comment_18794</link>
		<guid isPermaLink="false">http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18794#Comment_18794</guid>
		<pubDate>Thu, 02 Apr 2009 19:36:33 +0000</pubDate>
		<author>mandric</author>
		<description>
			<![CDATA[<p>here's the output I let it run for a couple mins</p>

<pre><code> slice:~# mysqladmin -u root -p ext -ri 30 | grep Created_tmp_disk
 Enter password: 
 | Created_tmp_disk_tables           | 130498      |
 | Created_tmp_disk_tables           | 32          |
 | Created_tmp_disk_tables           | 11          |
 | Created_tmp_disk_tables           | 19          |
 | Created_tmp_disk_tables           | 10          |
</code></pre>
]]>
		</description>
	</item>
	<item>
		<title>apache and mod_php</title>
		<link>http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18796#Comment_18796</link>
		<guid isPermaLink="false">http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18796#Comment_18796</guid>
		<pubDate>Thu, 02 Apr 2009 19:50:46 +0000</pubDate>
		<author>blender</author>
		<description>
			<![CDATA[I would recommend that you run the MySQL tmpdir on a RAM based file system (e.g. tmpfs)<br /><br />Note there is a current MySQL bug (<a href="http://bugs.mysql.com/bug.php?id=30287" target="_blank" rel="nofollow">http://bugs.mysql.com/bug.php?id=30287</a>) that doesn't honor the tmpdir variable - so make sure you are using a version of MySQL that isn't affected.<br /><br />Look into what I'm suggesting here - I think it will help you a lot.<br /><br />Cheers]]>
		</description>
	</item>
	<item>
		<title>apache and mod_php</title>
		<link>http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18840#Comment_18840</link>
		<guid isPermaLink="false">http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18840#Comment_18840</guid>
		<pubDate>Fri, 03 Apr 2009 21:23:46 +0000</pubDate>
		<author>mandric</author>
		<description>
			<![CDATA[<p>So the problem is mysql.  http://andric.us/load/localdomain/localhost.localdomain.html</p>

<p>I get these slow queries every now and then, probably from the insane drupal install, and then apache gets hung up.  Either because of IO or db.  So I can do a mysqlslowqueries ... here's some of the output.</p>

<p>Count: 1  Time=46.00s (46s)  Lock=0.00s (0s)  Rows=5.0 (5), windyc[windyc]@local
host</p>

<p>SELECT * FROM node n  LEFT JOIN radioactivity dn ON n.nid = dn.id   LEFT JOIN 
drigg_node dn2 ON dn2.dnid = n.nid  WHERE ( N=N  AND !(n.type='S' AND dn2.killed
=N ) ) AND ( n.type='S' AND  status=N AND promote=N ) ORDER BY dn.energy DESC LIMIT N</p>

<p>I will look into the radioactivity module then on one of the drupal installs i guess.</p>
]]>
		</description>
	</item>
	<item>
		<title>apache and mod_php</title>
		<link>http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18853#Comment_18853</link>
		<guid isPermaLink="false">http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18853#Comment_18853</guid>
		<pubDate>Sat, 04 Apr 2009 14:59:55 +0000</pubDate>
		<author>blender</author>
		<description>
			<![CDATA[Well, I think it's pretty clear it is I/O as a result of the DB. Look at the load average too - it pretty much mirrors the high interrupts on the blkif device.<br /><br />The MySQL tmpdir on tmpfs will help but it is treating the symptom - you are right to investigate the queries.<br /><br /><a href="http://dev.mysql.com/doc/refman/5.0/en/internal-temporary-tables.html" target="_blank" rel="nofollow">http://dev.mysql.com/doc/refman/5.0/en/internal-temporary-tables.html</a><br /><br />We run Drupal too and it is highly relational. Another thing you might consider to speed it up is use the memcache module and get the cache tables out of the DB.<br /><br />Cheers<br /><br />Cheers]]>
		</description>
	</item>
	<item>
		<title>apache and mod_php</title>
		<link>http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18857#Comment_18857</link>
		<guid isPermaLink="false">http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18857#Comment_18857</guid>
		<pubDate>Sat, 04 Apr 2009 22:40:49 +0000</pubDate>
		<author>mandric</author>
		<description>
			<![CDATA[<p>Yep sounds good.  Unfortunately I'm running etch so ...</p>

<pre><code>slice:~# apt-cache policy mysql-server
mysql-server:
  Installed: 5.0.32-7etch1
  Candidate: 5.0.32-7etch8
  Version table:
     5.0.51a-24~bpo40+1 0
          1 http://www.backports.org etch-backports/main Packages
     5.0.32-7etch8 0
        500 http://ftp.us.debian.org etch/main Packages
        500 http://security.debian.org etch/updates/main Packages
 *** 5.0.32-7etch1 0
        100 /var/lib/dpkg/status
</code></pre>

<p>I may have to go with a backport or move off etch to get the mysql tmpfs patch you mentioned.</p>
]]>
		</description>
	</item>
	<item>
		<title>apache and mod_php</title>
		<link>http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18866#Comment_18866</link>
		<guid isPermaLink="false">http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18866#Comment_18866</guid>
		<pubDate>Sun, 05 Apr 2009 14:54:24 +0000</pubDate>
		<author>alangiv</author>
		<description>
			<![CDATA[You can get MySQL 5.1.32 from <a href="http://www.dotdeb.org/" target="_blank" rel="nofollow">http://www.dotdeb.org/</a> Just add the appropriate repository to Apt.  I installed it on Ubuntu 8.04 without any problems.  MySQL, Apache, etc not being updated via the regular repositories sure is a real pain.]]>
		</description>
	</item>
	<item>
		<title>apache and mod_php</title>
		<link>http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18873#Comment_18873</link>
		<guid isPermaLink="false">http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18873#Comment_18873</guid>
		<pubDate>Sun, 05 Apr 2009 20:10:54 +0000</pubDate>
		<author>mandric</author>
		<description>
			<![CDATA[<p>Are there any issues with upgrading from mysql 5.0 to 5.1?  Just a minor rev right, my dbs won't break?</p>
]]>
		</description>
	</item>
	<item>
		<title>apache and mod_php</title>
		<link>http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18885#Comment_18885</link>
		<guid isPermaLink="false">http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18885#Comment_18885</guid>
		<pubDate>Mon, 06 Apr 2009 09:34:41 +0000</pubDate>
		<author>alangiv</author>
		<description>
			<![CDATA[I had no issue upgrading from 5.0 to 5.1.  I backed up all user databases and the system databases just for safety, also expecting that I would need to restore them afterward, however they were upgraded in-place.<br /><br />After configuring the correct repositories from dotdeb.org, I ran "apt-get -y install mysql-server-5.1" and had no problems at all.  Not bad considering other people have had issues with upgrading Ubuntu specifically - the repositories were designed for Etch and Lenny.]]>
		</description>
	</item>
	<item>
		<title>apache and mod_php</title>
		<link>http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18891#Comment_18891</link>
		<guid isPermaLink="false">http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18891#Comment_18891</guid>
		<pubDate>Mon, 06 Apr 2009 15:53:56 +0000</pubDate>
		<author>blender</author>
		<description>
			<![CDATA[According to the MySQL bug it "has been introduced in version 5.0.44"<br /><br />So you should be okay with your current MySQL.<br /><br />Cheers]]>
		</description>
	</item>
	<item>
		<title>apache and mod_php</title>
		<link>http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18893#Comment_18893</link>
		<guid isPermaLink="false">http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18893#Comment_18893</guid>
		<pubDate>Mon, 06 Apr 2009 17:10:19 +0000</pubDate>
		<author>mandric</author>
		<description>
			<![CDATA[<p>Hah!  Sorry for the noise ... ok back to tmpfs and memcache then!</p>
]]>
		</description>
	</item>
	<item>
		<title>apache and mod_php</title>
		<link>http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18895#Comment_18895</link>
		<guid isPermaLink="false">http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18895#Comment_18895</guid>
		<pubDate>Mon, 06 Apr 2009 17:44:20 +0000</pubDate>
		<author>mandric</author>
		<description>
			<![CDATA[<p>blender, so you mentioned "Another thing you might consider to speed it up is use the memcache module and get the cache tables out of the DB", I just want to clarify what you meant by this.  Am I right in thinking that I can configure mysql to use memcached as its tmpfs rather than disk?   what did you mean by "memcache module"? I assumed http://danga.com/memcached/ .</p>
]]>
		</description>
	</item>
	<item>
		<title>apache and mod_php</title>
		<link>http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18937#Comment_18937</link>
		<guid isPermaLink="false">http://forum.slicehost.com/comments.php?DiscussionID=3373&amp;Focus=18937#Comment_18937</guid>
		<pubDate>Tue, 07 Apr 2009 19:35:33 +0000</pubDate>
		<author>blender</author>
		<description>
			<![CDATA[Sorry, by memcache module I meant the Drupal memcache module:<br /><br /><a href="http://drupal.org/project/memcache" target="_blank" rel="nofollow">http://drupal.org/project/memcache</a><br /><br />You do need to run memcached so that the Drupal module can use it for the cache tables (i.e. cache, cache_block, cache_filter, etc.) instead of MySQL.<br /><br />Cheers]]>
		</description>
	</item>
	
		</channel>
	</rss>