<?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>PHP vs .Net &#187; Mono</title>
	<atom:link href="http://www.phpvs.net/tag/mono/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.phpvs.net</link>
	<description>ASP.Net and PHP go head to head</description>
	<lastBuildDate>Sat, 24 Dec 2011 18:20:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Benchmarking Mono ASP.Net vs. PHP &#8211; a slight problem</title>
		<link>http://www.phpvs.net/2008/02/08/benchmarking-mono-aspnet-vs-php-a-slight-problem/</link>
		<comments>http://www.phpvs.net/2008/02/08/benchmarking-mono-aspnet-vs-php-a-slight-problem/#comments</comments>
		<pubDate>Fri, 08 Feb 2008 21:53:34 +0000</pubDate>
		<dc:creator>blake</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mono]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ab]]></category>
		<category><![CDATA[benchmarks]]></category>

		<guid isPermaLink="false">http://www.phpvs.net/2008/02/08/benchmarking-mono-aspnet-vs-php-a-slight-problem/</guid>
		<description><![CDATA[We promised some numbers, but I&#039;ve run into a snag that&#039;s slowed down my testing. Originally when we first started toying with the idea of pitting Mono + ASP.Net against PHP, I wrote a quick PHP script that would just make a cheap fopen call to whatever URL you wanted to test, however many times [...]]]></description>
			<content:encoded><![CDATA[<p>We promised some numbers, but I&#039;ve run into a snag that&#039;s slowed down my testing.  Originally when we first started toying with the idea of pitting Mono + ASP.Net against PHP, I wrote a quick PHP script that would just make a cheap <code>fopen </code> call to whatever URL you wanted to test, however many times you wanted to hit it.  This isn&#039;t really load-testing, it&#039;s more like a basic timer, and not a very accurate one at that.  However, it gave me some quick raw numbers to work with.</p>
<p>Now, the cleverer ones amongst you will know that Apache Benchmark, or <code>ab</code>, will do pretty much the exact same thing, plus much more.  This is where I was planning to get my first batch of results from.  But something has happened that is leaving me puzzled as to how I&#039;m going to make these tests fair.</p>
<p>I ran a few benchmarks against a basic PHP page, and it was pretty consistent, within the realms of what you&#039;d expect for a page just coughing up the same content over and over.  When I ran the same benchmark against a similar .aspx page however, things were <em>not</em> consistent!</p>
<h3>Mono benchmarks -- an anomaly</h3>
<p>Without going into a long post about what all results were, here&#039;s a brief summary.  I originally noticed the problem when I ran <code>ab -n 1000 -c 10 [url]</code> from a remote machine that is on the other side of the country.  <code>ab</code> was given a PHP URL and an ASP.Net URL for the test server here on my home network, and dutifully returned results for each.  The PHP page was giving me results similar to the following (results in seconds for total test time, rounded for brevity):</p>
<p><strong>75, 75, 74</strong></p>
<p>Looks good.  Kind of what you want to see in a benchmark.  Predictable load times under a given circumstance means your application code is working predictably as well.  I ran three tests and averaged the results.  So what did I get from Mono?  I restarted apache, hit a page to get rid of the initial .Net load time, then ran three tests.  Check this out:</p>
<p><strong>77, 77, 100</strong></p>
<p>I thought that was kind of weird.  Maybe the server was under some sort of load I didn&#039;t know about, so I thought I&#039;d chuck the third benchmark as anomalous and run some more:</p>
<p><strong>95, 107, 92, 106</strong></p>
<p>Now I had a case of the WTFs.  Thinking something was wrong, I rebooted apache (and hit a single .aspx page for the initial .Net load).  Then I ran some more tests:</p>
<p><strong>restart, 78, 79, 92</strong></p>
<p>There it goes again!  I switched to testing on the server machine itself under my desk to get rid of any network latency that might be occurring cross-continent.  I ran some PHP benchmarks to see what I would get.</p>
<p><strong>51, 51, 66, 52, 51, 51, 51</strong></p>
<p>Looks good, save the spike in the middle.  Back to Mono:</p>
<p><strong>restart 56, 58, 61, 62, 68, 62, 63, restart, 57, 61, 61, 63, 67</strong></p>
<h3>WTF</h3>
<p>It quickly became evident that the Mono environment is accruing some sort of overhead the more I pound on it.  And it&#039;s not getting away from this overhead either.  I left it alone for awhile to gather its thoughts (and maybe its garbage) while I took a break, but when I tried again it still showed much higher benchmark times than it would right after a server restart.  The conclusion I came to over another hour of testing is that <em>Mono would never serve pages as fast as the first benchmark on subsequent benchmarks</em>.</p>
<p>This has delayed my actual collection of benchmark data between PHP and Mono ASP.Net, as I don&#039;t feel that it&#039;s a fair comparison between the two if Mono is accruing performance penalties the more I use it.</p>
<p>I&#039;m going to have to research this a bit more.  Maybe it&#039;s my configuration, maybe it&#039;s Apache, maybe it&#039;s mod_mono, maybe it&#039;s something wrong with the .aspx test page, maybe it&#039;s a spooky goblin.  Maybe it&#039;s Mono itself.  I don&#039;t have enough information at this point to be sure.  I&#039;ll have to try to narrow this down, or continue testing knowing this limitation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpvs.net/2008/02/08/benchmarking-mono-aspnet-vs-php-a-slight-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First impessions of mono</title>
		<link>http://www.phpvs.net/2008/02/03/first-impessions-of-mono/</link>
		<comments>http://www.phpvs.net/2008/02/03/first-impessions-of-mono/#comments</comments>
		<pubDate>Mon, 04 Feb 2008 05:15:46 +0000</pubDate>
		<dc:creator>morgan</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Mono]]></category>

		<guid isPermaLink="false">http://www.phpvs.net/2008/02/03/first-impessions-of-mono/</guid>
		<description><![CDATA[I&#039;ve never really been much of an open source guy, but damn if I&#039;m not ecstatic about mono. I&#039;ve been following the project for a while and loved the concept, so when it came time to re-write this web project I&#039;m working on (originally written in PHP) I though it&#039;s the perfect opportunity. Right now [...]]]></description>
			<content:encoded><![CDATA[<p>I&#039;ve never really been much of an open source guy, but damn if I&#039;m not ecstatic about mono.  I&#039;ve been following the project for a while and loved the concept, so when it came time to re-write this web project I&#039;m working on (originally written in PHP) I though it&#039;s the perfect opportunity.  Right now we&#039;ve got <a href="http://www.mono-project.org" title="Mono Project" target="_blank">mono 1.2.6</a> running on an ancient machine with <a href="http://www.centos.org/" title="CentOS Home Page" target="_blank">CentOS 4.4</a>, and mono itself seems great.</p>
<p>However, the growing pains have been a bit tougher than I expected.  Not that I thought it would be as simple as <em>compile-upload-browse</em> right off the bat, but it did take a few hours to iron everything out, even with some relatively basic pages.  For one, the generation of strongly typed datasets using XSD.exe under mono apparently just doesn&#039;t work.  It took a while to realize that no amount of coercing the utility was going to give the same output as XSD.exe under Windows, so this forces an extra step if you&#039;re developing cross-platform.  You have to manually generate your datasets and transfer them over as a .dll instead of relying on auto-compilation of your App_Code XSD file.</p>
<p>On top of that, I actually discovered my first mono bug.  Say you&#039;ve got a couple of ObjectDataSources on the page.  Under Windows.Net, it&#039;s cool to have a DataList that uses one of them, and inside that DataList you nest a second DataList that references the second ObjectDataSource.  <strong>Doesn&#039;t work in mono.</strong>  I was able to work around it by using nested FormViews instead, but it puzzled me for a few minutes.  Looking around at the mono svn changelogs, it looks like the FormView and DataList components handle the detection of the naming container differently.   If I get a chance I&#039;ll put together a simple test project and submit it to the mono project.    I actually have no idea which is the correct behaviour -- maybe it&#039;s a bug in Windows?</p>
<p>Regardless, I have a lot of confidence in mono.  Partly because of <a href="http://www.codicesoftware.com/xpfront.aspx" title="Plastic SCM" target="_blank">projects like Plastic SCM</a>, partly because I&#039;ve heard other good stories about it, and partly because I just really want it to work for the sake of object oriented web programming.  We&#039;ll see how the rest of the test site goes!</p>
<p>And coming up this week:  our first PHP vs ASP.Net head to head!  We test web server response times and some performance statistics&#8230;..</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpvs.net/2008/02/03/first-impessions-of-mono/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PHP vs .Net &#8211; The Beginning</title>
		<link>http://www.phpvs.net/2008/01/13/php-vs-net-the-beginning/</link>
		<comments>http://www.phpvs.net/2008/01/13/php-vs-net-the-beginning/#comments</comments>
		<pubDate>Mon, 14 Jan 2008 06:29:34 +0000</pubDate>
		<dc:creator>morgan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[Mono]]></category>

		<guid isPermaLink="false">http://www.phpvs.net/2008/01/13/php-vs-net-the-beginning/</guid>
		<description><![CDATA[Blog status: activated! Just in the nick of time too. Or is it? Doing a google search for &#034;PHP vs .Net&#034; brings up -- as result #1 -- an article from SitePoint discussing the merits of the technologies. From&#8230; 2002.  The only blog that makes the Top 10 results bravely states that no one has [...]]]></description>
			<content:encoded><![CDATA[<p>Blog status: activated!</p>
<p>Just in the nick of time too.  Or is it?  Doing a google search for &#034;PHP vs .Net&#034; brings up -- as result #1 -- an article from SitePoint discussing the merits of the technologies.  From&#8230; 2002.  The only <em>blog </em>that makes the Top 10 results bravely states that no one has any idea what they&#039;re talking about, followed by half a paragraph of useless blather and a recommendation for J2EE&#8230; from a post in 2003.</p>
<p>Is our debate irrelevant? Has it been beaten to death?   I&#039;d like to think that the answer to that question is irrelevant.  It&#039;s still pretty frustrating trying to find a useful comparison with hard numbers. Oh, .Net has extreme cache control you say&#8230; but PHP on MySQL can be optimized for extreme database reads?  So which one is better again?  If it&#039;s been beaten to death, they hid the body pretty well.  The point is, we STILL see people confused about these technologies, their differences, and needing a 2 paragraph summary to put in their technical feasibility report that&#039;s due on their bosses desk in 15 minutes.</p>
<p>PHP and ASP.Net are both great languages. Any developer worth their salt knows you choose the right tool for the job.  But in our experience, most development shops are exclusively married to one technology for their web facing projects, and there&#039;s not a lot of professional development going on for people to learn both toolboxes.  So long story short, the context of this blog is to compare and contrast PHP and .Net on projects that we&#039;re working on.</p>
<p>So with grand ceremony, we will start off the journey by documenting the project that birthed the idea of this blog. I&#039;m beginning to rebuild a website that was started with PHP and then abandoned for a while.   I&#039;m building it in ASP.Net and trying to run it on an old honky clunker with CentOS4.4 and Mono 1.2.6. Incidentally, Mono is the technology that will make most of our experiments possible, and will probably have a strong focus here.   We&#039;ve got some great articles coming, including some sciencey type benchmarking tests, but in the meantime I&#039;m still finalizing the blog layout and getting cool people to link to it.  If you&#039;re cool, which seems likely, feel free!</p>
<p>Since all the heavy lifting of starting the blog is done, we&#039;ll be letting the dust settle for the next week or so, inviting the robots take a sniff around, and heading off to Maui for a week.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpvs.net/2008/01/13/php-vs-net-the-beginning/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

