<?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 Sysadmin Blog &#187; Drupal performance</title>
	<atom:link href="http://linuxsysadminblog.com/category/drupal-performance/feed/" rel="self" type="application/rss+xml" />
	<link>http://linuxsysadminblog.com</link>
	<description></description>
	<lastBuildDate>Tue, 10 May 2011 03:23:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>APC should be enabled by default</title>
		<link>http://linuxsysadminblog.com/2011/04/apc-should-be-enabled-by-default/</link>
		<comments>http://linuxsysadminblog.com/2011/04/apc-should-be-enabled-by-default/#comments</comments>
		<pubDate>Fri, 01 Apr 2011 19:36:15 +0000</pubDate>
		<dc:creator>Marius</dc:creator>
				<category><![CDATA[Drupal performance]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[apc]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://linuxsysadminblog.com/?p=1261</guid>
		<description><![CDATA[PHP is slow. This should not be a huge revelation for any of us, and this is not because PHP is a bad programing language, or because Python or Ruby are better. This is because it is an interpreted language. Every time you execute a PHP script it is going to do the exact same [...]]]></description>
			<content:encoded><![CDATA[<p><strong>PHP is slow</strong>. This should not be a huge revelation for any of us, and this is not because PHP is a bad programing language, or because Python or Ruby are better. This is because it is an <a href="http://en.wikipedia.org/wiki/Interpreted_language" target="_blank"><em>interpreted language</em></a>. Every time you execute a PHP script it is going to do the exact same thing and interpret your code and then execute it over and over. This is obviously slow and doesn&#8217;t compare with any compiled language like C++ for example. But we don&#8217;t want to write in C++ for our webapps, right? and we would like to use the PHP simplicity as many other open source products and developers; what can we do then? We can very easily enable any of the opcode cache available: <a href="http://pecl.php.net/package/APC" target="_blank"><strong>APC</strong></a>, <a href="http://eaccelerator.net/" target="_blank"><strong>eaccelerator</strong></a> or <a href="http://xcache.lighttpd.net/" target="_blank"><strong>xcache</strong></a> (I&#8217;m not aware of something similar for python or ruby, but if it exists you should probably use it also). An <strong>opcode cache</strong> or <strong>PHP accelerator</strong>, will cache the compiled form of the php scripts speeding up dramatically their execution time. Many people have done this a long time as they needed to improve the performance of their sites, and get results up to 20x speed up from plain PHP. A very simple step-by-step intro on how you can install APC can be found on this <a href="http://linuxsysadminblog.com/2010/03/enabledisable-apc-on-virtual-host-level/" target="_blank">older post</a>.<br />
<span id="more-1261"></span><br />
Now here is the question a good friend of mine asked me a while ago: <strong>why is APC not enabled by default?</strong> Why do people have to do an extra step to install an external module for this (that many don&#8217;t). And my answer at that time was that opcode caches are not perfect, and depending by how you write your code they might cause problems and have it no longer functioning correctly. I think I was quite happy with my answer as myself I would always install an opcode cache on any high traffic site I managed from day one (most of the time APC, but also eaccelerator) and many time even running comparisons between them to see if one of them is faster. Still even today, in most of the <strong>performance projects</strong> we completed, we found people don&#8217;t do this, and they <strong>don&#8217;t have APC installed and enabled</strong>. There are some tricks on how to tune APC and improve even better its performance but here I&#8217;m talking just to have it installed. This is why I think that APC should be enabled by default everywhere (not only by &#8216;high traffic&#8217; sites). It should give PHP scripts a boost of performance and if you really have problems with it you can disable it on a vhost or directory level very simple just by adding in .htaccess:<br />
<code>php_flag apc.cache_by_default On<br />
</code></p>
<p>I&#8217;m hoping more and more people will do this so we can focus on more serious performance problems in our PHP webapps. I don&#8217;t see why not, because this is very simple and there are plenty of <a href="http://www.google.com/search?q=howto+php+apc" target="_blank">howto&#8217;s</a> available. Still if you need help, and you would like us to do it for you, please <a href="http://www.prometsource.com/contact" target="_blank">contact us</a> and let us speed up your site.</p>
<p>Note: if you have done this many years ago and want somethign even faster for your PHP code you should take a look at <a href="https://github.com/facebook/hiphop-php/wiki/" target="_blank"><strong>HipHop</strong></a> the project from Facebook to <strong>compile your php scripts</strong> (actually transforms PHP source code into highly optimized C++ and then uses g++ to compile it to machine code) and run them as executables (but this is going to be much harder to implement, but still a very interesting project to keep an eye).</p>
]]></content:encoded>
			<wfw:commentRss>http://linuxsysadminblog.com/2011/04/apc-should-be-enabled-by-default/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install Apache Solr and Tomcat for Drupal</title>
		<link>http://linuxsysadminblog.com/2010/10/install-apache-solr-and-tomcat-for-drupal/</link>
		<comments>http://linuxsysadminblog.com/2010/10/install-apache-solr-and-tomcat-for-drupal/#comments</comments>
		<pubDate>Sun, 17 Oct 2010 10:10:55 +0000</pubDate>
		<dc:creator>gerold</dc:creator>
				<category><![CDATA[Centos]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[Drupal performance]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[apachesolr]]></category>
		<category><![CDATA[solr]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://linuxsysadminblog.com/?p=1129</guid>
		<description><![CDATA[Here&#8217;s my quick install guide for Solr, Tomcat, and Drupal ApacheSolr module for multiple sites. Mostly I based the steps below from the following sites: wiki.apache.org and drupalconnect.com. Detailed Setup: Drupal 6.19 ApacheSolr module 6-1.1 Apache Solr PHP Client Library: Rev.22 Solr 1.4.1 Tomcat 6.0.29 SunJDK 6update21 RHEL5.5&#215;64 Install Process: Tomcat Create solr user Download [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s my quick install guide for Solr, Tomcat, and Drupal ApacheSolr module for multiple sites.  Mostly I based the steps below from the following sites: <a href="http://wiki.apache.org/solr/SolrTomcat">wiki.apache.org</a> and <a href="http://www.drupalconnect.com/blog/steve/configuring-apache-solr-multi-core-drupal-and-tomcat-ubuntu-910">drupalconnect.com</a>.</p>
<p><strong>Detailed Setup:</strong></p>
<ul>
<li>Drupal 6.19</li>
<li>ApacheSolr module 6-1.1</li>
<li>Apache Solr PHP Client Library: Rev.22</li>
<li>Solr 1.4.1</li>
<li>Tomcat 6.0.29</li>
<li>SunJDK 6update21</li>
<li>RHEL5.5&#215;64</li>
</ul>
<p><strong>Install Process: Tomcat</strong></p>
<ul>
<li>Create <em>solr</em> user</li>
<li>Download <a href="http://tomcat.apache.org/download-60.cgi">Tomcat6</a></li>
<li>Extract to <em>/opt/tomcat</em>  <em>**this will be the $CATALINA_HOME directory, you can use any dir you want</em></li>
<li>Edit <em>/opt/tomcat/conf/tomcat-users.xml</em> to enable Tomcat login.  See comments in this file.</li>
</ul>
<p><code>&lt;role rolename="manager"/&gt;<br />
&lt;role rolename="admin"/&gt;<br />
&lt;user username="tomcat" password="tomcat" roles="manager,admin"/&gt;</code><br />
<span id="more-1129"></span>
<ul>
<li>Test run your Tomcat:  <em>/opt/tomcat/bin/catalina.sh run</em>.  Chown all Tomcat files to <em>solr</em> user (<code>chown -R solr.solr /opt/tomcat</code>).  Default server setting will use <em>port 8080</em>, to customized edit the file <em>/opt/tomcat/conf/server.xml</em>.  If you encounter error on &#8220;<em>BASEDIR environment variable is not defined correctly&#8230;</em>&#8220;, check permissions of <em>.sh</em> files inside <em>/opt/tomcat/bin/</em> and make them executable (<code>chmod 755 /opt/tomcat/bin/*.sh</code>).</li>
<li>Add startup (init) script.  Copy this <a href="http://wiki.apache.org/solr/SolrTomcat?action=AttachFile&amp;do=view&amp;target=tomcat6">Tomcat6 init file</a> from Apache.org to <em>/etc/init.d/tomcat6</em>.  Check and update variables like Java home, Tomcat directory, etc, if needed.  Add to startup <code>/sbin/chkconfig --add tomcat6</code> and <code>/sbin/chkconfig tomcat6 on</code>.  Dependencies: redhat-lsb (or lsb-base?)
</li>
<li>Visit your Tomcat Admin page.  ex <em>http://localhost:8080</em></li>
</ul>
<p><strong>Install Process: Solr</strong></p>
<ul>
<li>Download <a href="http://mirrors.igsobe.com/apache/lucene/solr/">Solr</a></li>
<li>Extract to temporary location, ex: <em>/opt/apache-solr-1.4.1</em></li>
<li>Copy <em>/opt/apache-solr-1.4.1/dist/apache-solr-1.4.1.war</em> to <em>/opt/tomcat/webapps/solr.war</em></li>
<li>Copy <em>/opt/apache-solr-1.4.1/example/solr</em> directory to <em>/opt/tomcat/solr  **this will be the $SOLR_HOME directory, you can use any dir you want</em></li>
<li>Create file <em>/opt/tomcat/conf/Catalina/localhost/solr.xml</em> with the following configuration.  Make sure paths are correct.</li>
</ul>
<p><code>&lt;Context docBase="/opt/tomcat/webapps/solr.war" debug="0" privileged="true" allowLinking="true" crossContext="true"&gt;<br />
&lt;Environment name="solr/home" type="java.lang.String" value="/opt/tomcat/solr" override="true" /&gt;<br />
&lt;/Context&gt;<br />
</code><br />
<strong>Install Process: ApacheSolr Drupal module and SolrPHP client</strong></p>
<ul>
<li> Install/enable <a href="http://drupal.org/project/apachesolr">Drupal ApacheSolr</a> module. Drush, CVS, or traditional install &#8211; whatever you want.  Example: <em>/var/www/site1/sites/all/modules/apachesolr</em></li>
<li> Download <a href="http://code.google.com/p/solr-php-client/">SolrPHP client library</a></li>
</ul>
<p><strong>Configure Solr for Multi-Core Setup</strong></p>
<ul>
<li>Copy <em>/var/www/site1/sites/all/modules/apachesolr/schema.xml</em> to <em>/opt/tomcat/solr/conf/schema.xml</em></li>
<li>Copy <em>/var/www/site1/sites/all/modules/apachesolr/solrconfig.xml</em> to <em>/opt/tomcat/solr/conf/solrconfig.xml</em></li>
<li>Copy <em>/opt/apache-solr-1.4.1/example/multicore/solr.xml</em> to <em>/opt/tomcat/solr/solr.xml</em></li>
<li>Create directory for each site and copy <em>/opt/tomcat/solr/conf </em> directory to each of them. Example:</li>
</ul>
<p><code>mkdir /opt/tomcat/solr/site1<br />
mkdir /opt/tomcat/solr/site2<br />
cp -r /opt/tomcat/solr/conf /opt/tomcat/solr/site1/<br />
cp -r /opt/tomcat/solr/conf /opt/tomcat/solr/site2/</code></p>
<ul>
<li> Edit <em>/opt/tomcat/solr/solr.xml</em> with the following config:</li>
</ul>
<p><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;<br />
&lt;solr persistent="false"&gt;<br />
&lt;cores adminPath="/admin/cores"&gt;<br />
&lt;core name="site1" instanceDir="site1" /&gt;<br />
&lt;core name="site1" instanceDir="site2" /&gt;<br />
&lt;/cores&gt;<br />
&lt;/solr&gt;</code></p>
<ul>
<li>Start or Restart Tomcat: <em>/etc/init.d/tomcat6 start</em></li>
<li>Visit <em>http://localhost:8080/</em> and go to you Solr App</li>
</ul>
<p><strong>Configure Drupal site:</strong></p>
<ul>
<li>Go to ApacheSolr settings <em>http://localhost/admin/settings/apachesolr</em></li>
<li>Save your config and if all is good you&#8217;ll see message: <em>Your site has contacted the Apache Solr server.</em></li>
</ul>
<p><code>Solr host name: localhost<br />
Solr port: 8080<br />
Solr path (for site1): /solr/site1<br />
</code>
<ul>
<li> Configure your search index.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://linuxsysadminblog.com/2010/10/install-apache-solr-and-tomcat-for-drupal/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Drupal Performance improvement for the drupal admins presentation</title>
		<link>http://linuxsysadminblog.com/2010/02/drupal-performance-improvement-for-the-layment-presentation/</link>
		<comments>http://linuxsysadminblog.com/2010/02/drupal-performance-improvement-for-the-layment-presentation/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 22:24:57 +0000</pubDate>
		<dc:creator>andrew</dc:creator>
				<category><![CDATA[Drupal performance]]></category>

		<guid isPermaLink="false">http://linuxsysadminblog.com/?p=1026</guid>
		<description><![CDATA[Last December I gave a talk at the Chicago Drupal Meet Up on increasing your Drupal site&#8217;s performance.  I thought I would share the slides from that presentation with everyone &#8211; so here it is.  I tried to cover a fairly wide array of topics at a high level.  We started with page load performance [...]]]></description>
			<content:encoded><![CDATA[<p>Last December I gave a talk at the Chicago Drupal Meet Up on increasing your Drupal site&#8217;s performance.  I thought I would share the slides from that presentation with everyone &#8211; so here it is.  I tried to cover a fairly wide array of topics at a high level.  We started with page load performance definition, identifying the differences between the high availability and scalability concepts and then we jumped into page load performance.  The talk was very drupal specific in terms of load page improvement recommendations, and we covered a few MySQL drupal performance tweaks, some apache modules and tools, such as YSLOW, Google page speed and JMeter.</p>
<p><a href="http://linuxsysadminblog.com/wp-content/uploads/2010/02/Drupal.org-MakingDrupalFaster.v4.pdf">Drupal.org-MakingDrupalFaster.v4</a></p>
]]></content:encoded>
			<wfw:commentRss>http://linuxsysadminblog.com/2010/02/drupal-performance-improvement-for-the-layment-presentation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

