<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>PHP</title><link>http://papelipe.no</link>
    <description></description>
    <language>en-GB</language>
    <item>
      <pubDate>Tue, 17 Apr 2007 09:06:01 GMT</pubDate>
      <title>Optimizing Apache, PHP and APC for Intel based Mac</title><link>http://papelipe.no/tags/php/optimizing_apache_php_and_apc_for_intel_based_mac</link>
      <description>
&lt;p&gt;
I wrote a blog last year about &lt;a href=&quot;http://papelipe.no/tags/php/optimizing_php_for_intel_based_mac&quot;&gt;optimizing Apache, PHP and APC&lt;/a&gt; for the new Macs with Intel CPUs. At that time I could not get the ICC compiler to work in my setup, but now I have gotten the new soon to be released Intel C++ compiler version 10 from the guys at &lt;a href=&quot;http://www.intel.com&quot;&gt;Intel&lt;/a&gt; and things are working much better now. I used the same machine and same setup as in my last post just with the new Intel compiler installed.&lt;br /&gt;The installation itself is quite simple just click through the wizard and when you are done you need to export some environment variables and set the CC compiler variable:&lt;br /&gt;
&lt;/p&gt;
&lt;pre&gt;source /opt/intel/cc/10.0.012/bin/iccvars.sh
export CC=/opt/intel/cc/10.0.012/bin/icc&lt;/pre&gt;
&lt;p&gt;
Then you compile Apache, PHP and APC as normal. I blogged about how to &lt;a href=&quot;http://papelipe.no/tags/php/compiling_apache_and_php_on_mac_os_x&quot;&gt;compile Apache and PHP&lt;/a&gt; earlier.&lt;br /&gt;I did the same basic test as last time but now with &lt;a href=&quot;http://ez.no/ezpublish&quot;&gt;eZ Publish 3.9&lt;/a&gt;. The results when running the system with GCC:&lt;br /&gt;
&lt;/p&gt;
&lt;pre&gt;Requests per second:    26.29 [#/sec] (mean)&lt;/pre&gt;
&lt;p&gt;
With ICC compiled webserver environment I get the following results:
&lt;/p&gt;
&lt;pre&gt;Requests per second:    28.85 [#/sec] (mean)&lt;/pre&gt;
&lt;p&gt;
This is an additional performance improvement of 9.7% with caching enabled. When doing more CPU intensive work the difference is more noticeable so I measured template processing of a complex page before and after and this is the results:
&lt;/p&gt;
&lt;pre&gt;Template processing with GCC: 1.0160sec
Template processing with ICC: 0.8382sec
% difference: 21%&lt;/pre&gt;
&lt;p&gt;
This means that the CPU intensive operations with eZ Publish is boosted about 21% while the more cached operations are boosted about 10%. This is quite good especially when you consider the price Apple charges for a 20% faster CPU. The ICC compiler for Mac &lt;a href=&quot;http://www.intel.com/cd/software/products/asmo-na/eng/compilers/266992.htm&quot;&gt;is selling for $399&lt;/a&gt; so you have to consider the cost of the optimized software vs the cost of hardware.
&lt;/p&gt;

&lt;p&gt;
&lt;b&gt;UPDATE:&lt;/b&gt; I already did some tests with ICC using Linux 32 and 64 bits os:&lt;br /&gt;
&lt;/p&gt;

&lt;ul&gt;

&lt;li&gt;&lt;a href=&quot;http://papelipe.no/tags/ez_publish/benchmark_of_intel_compiled_icc_apache_php_and_apc&quot;&gt;Apache, PHP and APC test on 32bit Linux&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;&lt;a href=&quot;http://papelipe.no/tags/php/benchmark_of_intel_compiled_apache_php_and_apc_on_64bits_server&quot;&gt;Apache, PHP and APC test on 64bit Linux&lt;/a&gt;&lt;/li&gt;

&lt;li&gt;&lt;a href=&quot;http://papelipe.no/tags/ez_publish/ez_publish_faster_running_on_intel_optimized_mysql&quot;&gt;ICC compiled MySQL on Linux&lt;/a&gt;&lt;/li&gt;

&lt;/ul&gt;
</description>
    </item>
    <item>
      <pubDate>Mon, 16 Apr 2007 20:23:49 GMT</pubDate>
      <title>Benchmark of Intel compiled Apache, PHP and APC on 64bits server</title><link>http://papelipe.no/tags/php/benchmark_of_intel_compiled_apache_php_and_apc_on_64bits_server</link>
      <description>
&lt;p&gt;
As a follow up on the ICC optimizations I did on &lt;a href=&quot;http://papelipe.no/tags/ez_publish/benchmark_of_intel_compiled_icc_apache_php_and_apc&quot;&gt;Apache and friends&lt;/a&gt; and &lt;a href=&quot;http://papelipe.no/tags/ez_publish/ez_publish_faster_running_on_intel_optimized_mysql&quot;&gt;MySQL&lt;/a&gt; on 32 bits Intel servers I re-did the tests on 64bits servers. The test was done using Fedora Core 6 for x86_64 on a Dual Xeon 5130 2GHz.&lt;br /&gt;The compilation is actually quite straight forward. You need to download and install the &lt;a href=&quot;http://www.intel.com/cd/software/products/asmo-na/eng/compilers/277618.htm&quot;&gt;Intel C++ for Linux&lt;/a&gt;. I used the current 9.1 release of the ICC compiler. After the installation you need to export some variables:&lt;br /&gt;
&lt;/p&gt;
&lt;pre&gt;export LD_LIBRARY_PATH=/opt/intel/cc/9.1.047/lib
export CC=/opt/intel/cc/9.0/bin/icc&lt;/pre&gt;
&lt;p&gt;
Then you compile Apache, PHP and APC as normal and you are ready to run an ICC accelerated environment on your 64bits architecture.&lt;br /&gt;The testing was done with &lt;a href=&quot;http://ez.no/ezpublish&quot;&gt;eZ Publish Open Source CMS&lt;/a&gt; and the performance improvements was 13.4% in number of pages served and the PHP compilation speed was increased with 14.4%. This is a bit more even results than on 32bit but the overall result is better with 64bit compared to 32bits. I tested with the default &lt;a href=&quot;http://ez.no/download/ez_publish&quot;&gt;download of eZ Publish 3.9.1&lt;/a&gt; and used the standard MySQL that ships with Fedora Core 6. There are more tuning that can be done with the setup and the results might vary when it is tuned even more. I will look into more detailed tuning and see what numbers I can get.&lt;br /&gt;
&lt;/p&gt;
</description>
    </item>
    <item>
      <pubDate>Thu, 19 Oct 2006 10:31:52 GMT</pubDate>
      <title>Optimizing PHP for Intel based Mac</title><link>http://papelipe.no/tags/php/optimizing_php_for_intel_based_mac</link>
      <description>
&lt;p&gt;
Running PHP and eZ publish on PowerPC based Macs have been extreemly slow and now that I have &lt;a href=&quot;http://papelipe.no/tags/php/compiling_apache_and_php_on_mac_os_x&quot;&gt;eZ publish running on the Intel based Mac&lt;/a&gt; I tried to tune it to get maximum performance out of it when running eZ publish as I was not satistied with my &lt;a href=&quot;http://papelipe.no/tags/ez_publish/ez_publish_speed_on_macbook_pro&quot;&gt;previous tests&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
I now have 2GB of memory in the laptop I did a test similar to what I did before. I am using a different eZ publish setup which is a bit more tuned also (Yes, this is going to be released soon enough).
&lt;/p&gt;

&lt;p&gt;
eZ publish 3.8 test before the patch:&lt;br /&gt;
&lt;/p&gt;
&lt;pre&gt;Requests per second:    19.95 [#/sec] (mean)&lt;/pre&gt;
&lt;p&gt;
&lt;a href=&quot;http://lerdorf.com/&quot;&gt;Rasmus&lt;/a&gt; at &lt;a href=&quot;http://www.yahoo.com&quot;&gt;Yahoo!&lt;/a&gt; have been using a patched version of &lt;a href=&quot;http://php.net&quot;&gt;PHP&lt;/a&gt; running on their &lt;a href=&quot;http://www.freebsd.org/&quot;&gt;FreeBSD&lt;/a&gt; boxes. The reason is that PHP generates lots of stat calls which really slows down the system on FreeBSD. Since OS X is based on FreeBSD I have long planned to test this patch on my system to see how it affects &lt;a href=&quot;http://ez.no/products/ez_publish&quot;&gt;eZ publish&lt;/a&gt;. I got a ready patched version from my colleague Ole Marius, thanks ;)
&lt;/p&gt;

&lt;p&gt;
The results from eZ publish after patching the system is:&lt;br /&gt;
&lt;/p&gt;
&lt;pre&gt;Requests per second:    26.06 [#/sec] (mean)&lt;/pre&gt;
&lt;p&gt;
In other words a performance boost of about 30%. Which is quite good.
&lt;/p&gt;

&lt;p&gt;
When I tuned eZ publish for Linux on the Intel based platform I got good results with both &lt;a href=&quot;http://papelipe.no/tags/ez_publish/benchmark_of_intel_compiled_icc_apache_php_and_apc&quot;&gt;Apache, PHP and APC&lt;/a&gt; as well as with &lt;a href=&quot;http://papelipe.no/tags/ez_publish/ez_publish_faster_running_on_intel_optimized_mysql&quot;&gt;MySQL&lt;/a&gt;. So I decided to get the ICC compiler for OS X and give it a shot on the Mac. After tons of warnings during compile it finally stopped with the error during linking:&lt;br /&gt;
&lt;/p&gt;
&lt;pre&gt;icc: Command line error: invalid argument for option &apos;-b&apos;&lt;/pre&gt;
&lt;p&gt;
If anyone knows how to make it link with icc under OS X I would be interested.
&lt;/p&gt;
</description>
    </item>
    <item>
      <pubDate>Thu, 27 Apr 2006 22:17:03 GMT</pubDate>
      <title>Slides for Application Clustering with MySQL &amp; Squid</title><link>http://papelipe.no/tags/php/slides_for_application_clustering_with_mysql_squid</link>
      <description>
&lt;p&gt;
The slides for the talk I presented together with &lt;a href=&quot;http://zak.greant.com&quot;&gt;Zak&lt;/a&gt; on &lt;a href=&quot;http://papelipe.no/content/download/223/785/file/mysq_application_clustering.odp&quot;&gt;Application Clustering with MySQL &amp;amp; Squid&lt;/a&gt; is now &lt;a href=&quot;http://papelipe.no/content/download/223/785/file/mysq_application_clustering.odp&quot;&gt;available&lt;/a&gt;. The slides are in &lt;a href=&quot;http://en.wikipedia.org/wiki/OpenDocument&quot;&gt;OpenDocument&lt;/a&gt; format so you need &lt;a href=&quot;http://www.openoffice.org&quot;&gt;OpenOffice.org&lt;/a&gt; to view them. Any comments or suggestions welcome.&lt;br /&gt;&lt;b&gt;Update:&lt;/b&gt; slides are now also  &lt;a href=&quot;http://www.papelipe.no/content/download/285/1026/file/mysql_application_clustering_edited.pdf&quot;&gt;available in PDF format&lt;/a&gt;.&lt;br /&gt;
&lt;/p&gt;
</description>
    </item>
    <item>
      <pubDate>Fri, 14 Apr 2006 17:06:02 GMT</pubDate>
      <title>Compiling Apache and PHP on Mac OS X</title><link>http://papelipe.no/tags/php/compiling_apache_and_php_on_mac_os_x</link>
      <description>
&lt;p&gt;
Since my recent move to the &lt;a href=&quot;http://www.apple.com/macbookpro/&quot;&gt;Mac&lt;/a&gt; running &lt;a href=&quot;http://www.apple.com/macosx/&quot;&gt;OS X&lt;/a&gt; I have learnt some new stuff about &lt;a href=&quot;http://www.php.net&quot;&gt;PHP&lt;/a&gt; and &lt;a href=&quot;http://www.apache.org&quot;&gt;Apache&lt;/a&gt; the hard way. OS X is shipped with Apache and PHP by default and if you compile Apache and PHP like you normally do under Linux you quickly get surprised. When I compile Apache I always use a prefix so I have it installed under &lt;i&gt;/usr/local/apache&lt;/i&gt; or something like that. I like to have it installed like this so I can quickly change between Apache and PHP versions and configurations. Under OS X you quickly notice that Apache is not completely installed in the directory you added as prefix. The reason for that is that Apache has a different installation layout under OS X. So, you simply have to use the configure parameter &lt;i&gt;--with-layout&lt;/i&gt; to make things work like you are used to.
&lt;/p&gt;

&lt;p&gt;
The compilation switches I use are:
&lt;/p&gt;
&lt;pre&gt;
cd apache_1.3.34
make clean
./configure --prefix=/usr/local/apache \
                    --enable-module=so \
                    --enable-module=rewrite \
                    --with-layout=Apache
make
sudo make install
cd ..
cd php-4.4.2
make clean
./configure --prefix=/usr/local/apache  \
            --enable-mbstring \
            --with-apxs=/usr/local/apache/bin/apxs \
            --enable-cli \
            --enable-exif \
            --with-mysql \
            --with-mbstring
make
sudo make install &lt;/pre&gt;</description>
    </item>
    <item>
      <pubDate>Wed, 29 Mar 2006 17:16:11 GMT</pubDate>
      <title>eZ publish faster running on Intel optimized MySQL</title><link>http://papelipe.no/tags/php/ez_publish_faster_running_on_intel_optimized_mysql</link>
      <description>
&lt;p&gt;
I&apos;ve done some benchmarking today with &lt;a href=&quot;http://ez.no&quot;&gt;eZ publish CMS&lt;/a&gt; and &lt;a href=&quot;http://www.mysql.com&quot;&gt;MySQL&lt;/a&gt; running a process inserting &lt;a href=&quot;http://ez.no/doc/ez_publish/technical_manual/3_6/concepts_and_basics/content_management/the_content_object&quot;&gt;articles (objects)&lt;/a&gt; into the CMS system. I ran the test on both the standard GCC compiled version of MySQL and the &lt;a href=&quot;http://www.intel.com/cd/software/products/asmo-na/eng/compilers/clin/index.htm&quot;&gt;Intel ICC&lt;/a&gt; compiled version. The total process was 11.9% faster and the MySQL part was 20.2% faster. So atleast on heavy write operations the ICC compiled version of MySQL is running faster with eZ publish. This is good news for people running write intensive eZ publish sites. When testing with read queries I did not see that much of a difference, I will do more tests on heavy read intensive operations to find where we can gain performance also here.&lt;br /&gt;
&lt;/p&gt;
</description>
    </item>
    <item>
      <pubDate>Sat, 25 Mar 2006 09:30:53 GMT</pubDate>
      <title>Speaking at the MySQL Users Conference</title><link>http://papelipe.no/tags/php/speaking_at_the_mysql_users_conference</link>
      <description>
&lt;p&gt;
I will be speaking at the &lt;a href=&quot;http://www.mysqluc.com/&quot;&gt;MySQL Users Conference 2006&lt;/a&gt; in Santa Clara on &lt;a href=&quot;http://www.mysqluc.com/pub/w/45/schedule.html#Wednesday&quot;&gt;Wednesday the 26th of April&lt;/a&gt;.The topic of the session is &lt;a href=&quot;http://www.mysqluc.com/cs/mysqluc2006/view/e_sess/8129&quot;&gt;Web Application Clustering with MySQL&lt;/a&gt;. &lt;a href=&quot;http://zak.greant.com/&quot;&gt;Zak Greant&lt;/a&gt; will be co-presenting with me.
&lt;/p&gt;
</description>
    </item>
  </channel>
</rss>