I am going to develop a web portal. I have an option to choose a technology either PHP or ASP.NET. In terms of performance (not development speed) which will do better.
Coming to webserver, IIS vs Apache, which will perform better?
How many no. of requests/second can be handled by IIS?
How many no. of requests/second can be handled by Apache?
Comparisons of ASP.Net to PHP can be found in these popular questions:
20 answers here: ASP.NET vs. PHP
Some excellent comparisons of speed here: Speed of code execution: ASP.NET-MVC versus PHP
More about the two here: .NET & ASP vs PHP
I hope these help you to assess your choices.
On one of the early Henselminutes podcasts there was an interview with creators of Facebook (I think). And the main idea I took from them was: if your web project will have any kind of success then the only thing that will matter is how easy it will be for you to add more web servers and to scale you database. That’s it.
So, I’d concentrate on the overall design of the system you’re building to ensure it will scale and don’t pick a language because of its performance characteristics.
Well it all depends on the website you are going to develop. Facebook is developed using php and all microsoft sites are in .net. So its up to you to decide which one is better for you.
Apache with php is cheaper for you than iis and .net . ASP.net development can be faster than php.
Number of users depend on the band width and your server and not on the programming languages.
If you can explain what exactly are you trying to develop then we will be able to explain more.
You can even mix up a lot here. It is also possible to run an Apache server on Linux using ASP.NET (using mono). Or run Apache using ASP.NET with Mono under Windows.
Personally I don’t have much experience with PHP but from what I have seen around me is that PHP website have really high maintenance costs when they become large. This is not the case with a programming language that compiles (like C#/ASP.NET).
I have done test with simple logic. ASP.NET excels very well. Whole process is taking only maximum 2 seconds in ASP.NET but in PHP it is taking too much time and it is testing our patience.
Here is ASP.NET code:
<%@ Page Language="C#" %> <% Response.Write(DateTime.Now); Response.Write("<br />"); int t = 0; for (int i = 1; i <= 500000000; i++) t = 100; Response.Write(DateTime.Now); %>
Here is PHP code:
<?php echo date("h:i:s"); echo '<br />'; for($i=1;$i<=500000000;$i++) $t = 100; echo date("h:i:s"); ?>
Both are ‘sane’ choices, but have very different consequences. I know that both setups can have great performance when correctly deployed. The question is, which of the choices are you and the other members of the project more comfortable with? How much time are you willing to spend getting comfortable with either setup?
Most of the performance of either scenario will be lost (or gained) within the project itself. Making the right (or wrong) choices within the code or database setup will make a terrible difference in terms of performance. This is where the best gains can be found – they are in the domain where you have direct influence on what is going on.
Each of these platforms are highly capable, and if you do run into performance bottlenecks with your application, it will likely be for reasons applicable to both, like database access and the efficiency of the code written. One thing to consider about ASP.NET is that you can use any .NET managed language, whereas you’re locked into using PHP on that platform. Choose the language because you’re familiar with it or at least more comfortable with it, the performance difference is negligible in the face of these other things.
If you’re interested, it’s also quite easy to set up IIS to run PHP, which means you can have a chance at comparing the two on a single platform.
I think it really boils down to several factors.
- Your experience with the technology in question.
- The investment already made into the infrastructure. A microsoft technology shop will probably already have the skills and software required to build to asp.net application.
There are technical differences between the two, but depending on the size of your project they may not out weigh the above two factors.