Is there any performance different between hosting your asp.net in mono on linux and iis on window server?
问题:
回答1:
Of course there is a difference, just like there is a performance difference between Java and .Net. However, it is going to vary widely based on what the application is doing.
There are things where .Net is much faster than Mono. There are things where Mono is much faster than .Net. There are things where they perform roughly equal. The same holds true when comparing applications running on Windows or Linux. The same holds true when comparing applications running on IIS and Apache.
Likely, either can run your application fast enough, and you will find that your performance is going to be driven by your programming techniques. The difference of a few requests per second probably isn't a huge issue unless you have a large server farm, in which case you most likely have the resources to test on both and see which is faster for your particular application.
回答2:
In regards to the suggestion by lextm that publishing the results of perf comparisons is "not possible", the End-User License Agreement (aka EULA) for Windows Vista Ultimate allows it, with conditions.
MICROSOFT .NET BENCHMARK TESTING. The software includes one or more components of the .NET Framework 3.0 (“.NET Components”). You may conduct internal benchmark testing of those components. You may disclose the results of any benchmark test of those components, provided that you comply with the conditions set forth at http://go.microsoft.com/fwlink/?LinkID=66406. Notwithstanding any other agreement you may have with Microsoft, if you disclose such benchmark test results, Microsoft shall have the right to disclose the results of benchmark tests it conducts of your products that compete with the applicable .NET Component, provided it complies with the same conditions set forth at http://go.microsoft.com/fwlink/?LinkID=66406.
The conditions, as I read them, are reasonable disclosure requirements: the source code you used to do the testing, the versions of software you tested, the date you conducted the tests, the configuration and optimizations you made, etc.
The EULA for Windows Server 2003 includes the same provisions. I couldn't find the EULA for Windows Server 2008 (the latest incarnation) but I assume the benchmarking provisions remain.
Addendum: If you look in the EULA for Windows7, you will probably find a no-benchmarking clause, or more accurately a no-publish clause; this is because Win7 is still in pre-release. When it is officially released, expect the standard benchmark publishing conditions to be present.
In the past Microsoft had a more restrictive policy on this topic. Basically: you need permission from us (Microsoft) to disclose performance comparisons. This policy has been relaxed, even retroactively to .NET v1.0 and v1.1, as per the link in the above EULA.
回答3:
Mono sucks!
- http://art-blog.no-ip.info/cppcms/blog/post/27
- http://www.phpvs.net/2008/02/08/benchmarking-mono-aspnet-vs-php-a-slight-problem/
Or more politically correct: Mono is not yet ready for prime time at least for Asp.Net web applications:
- No support of caching
- Performance is terribly unstable and dropping after application start.
EDIT: Added quotes for my post, answer to latest comment.
However, in order to make fair comparison ... I should enable caching ... adding following line at the header of aspx file should help me.
<%@ OutputCache Duration="20" VaryByParam="None" %>
I'd done it — no result! The performance is the same.
Note: after deeper check, the implementation of cache in modo is very limited and poor, after recent checks it still holds in newer versions of mono.
Ok, anyway I did some benchmarks(...)simple clock gives me about 750 pages per second for cached variant and 650 for non cached one. The tests were done under IIS 5.0 on Dual Core Pentium D 3G
The same code ... with mod_mono (under Signle Core AMD Athlon 3000) had given me:
- 350 pages per second.
- Next run had given 300.
- next 200
- and next 150
So, benchmarking is impossible.
Does referring to post is still not augmentative?
No mono is definitely not ready for prime-time.
回答4:
Here is a nice benchmark where someone tested the difference of windows/IIS vs Linux/Apache/Mono(mod_mono). Crazy enough mod_mono (apache's mono plugin) was significantly more performant. Granted I am sure that in certain circumstances it would be different, but given how low profile linux and apache are plus the great job the mono guys have done, it stands to reason that Linux/Apache/Mono is a better way to go. Now that being said, hopefully with the new open source ASP, we will see some super performant Linux .Net servers coming soon (primed and ready for the cloud).
graph of the performance comparison
回答5:
I've run mono apps under mod_mono. From a usability, it functions fine, though I didn't do any benchmarks. Still IIS really is an incredibly convenient environment to work in. Given the choice I'd still hosts my web-server in IIS and use linux mono clients to connect to it.
回答6:
First, it was said that publishing performance statistics to compare CLR implementations (.NET vs Mono) is not possible.I am not sure what is the source, but Mono team only published comparison among Mono versions (1.x, 2.0, 2.2, and 2.4), so I assume the saying is real. Therefore, you can only test the performance in your own environment.
Second, Mono is evolving much faster lately, which gives you a chance to gain performance boost simply by upgrading Mono runtime.
Third, please use a different attitude to judge an open source product. For closed source products, you can do nothing but begging its vendor to improve performance or providing your support on how to tune your applications. For open source projects, you have access to the code base, and you can tailor it to suit your own needs, and fix the issues for your own applications.
As jpobst mentioned, even if you cannot fix issues yourself, you can contact the Mono guys.