Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which programming language suits web critical application development?

According to this page,it seems that Perl,PHP,Python is 50 times slower than C/C++/Java.

Thus,I think Perl,PHP,Python could not handle critical application(such as >100 million user,>xx million request every second) well.But exceptions are exist,e.g. facebook(it is said facebook is written with PHP entirely),wikipeida.Moreover,I heard google use Python extensively.

So why?Is it the faster hardware fill the big speed gap between C/C++/Java and Perl/PHP/Python?

thanks.

like image 761
Jichao Avatar asked Jan 05 '10 10:01

Jichao


2 Answers

Computational code is the least of my concerns in most heavy usage web applications.

The bottle necks in a typical high availablility web application are (not nessecarility in this order, but most likely):

  1. Database (IO and CPU)
  2. File IO
  3. Network Bandwidth
  4. Memory on the Application Server
  5. Your Java / C++ / PHP / Python code

Your main concerns to make your application scalable are:

  1. Reduce access to the database (caching, with clustering in mind, smart quering)
  2. Distribute your application (clustering)
  3. Eliminate useless synchronization locks between threads (see commons-pool 1.3)
  4. Create the correct DB indexes, data model, and replication to support many users
  5. Reduce the size of your responses, using incremental updates (AJAX)

Only after all of the above are implemented, optimize your code

Please feel free to add more to the list if I missed something

like image 145
Eran Medan Avatar answered Nov 26 '22 14:11

Eran Medan


The page you are linking only tells half the truth. Of course native languages are faster than dynamic ones, but this is critical to applications with high computing requirements. For most web applications this is not so important. A web request is usually served fast. It is more important to have an efficient framework, that manages resources properly and starts new threads to serve requests quickly. Also the timing behaviour is not the only critical aspect. Reliable and error-free applications are probably better achieved with dynamic languages.

And no, faster hardware isn't a solution. In fact Google is famous for using a cluster of inexpensive machines.

like image 36
kgiannakakis Avatar answered Nov 26 '22 12:11

kgiannakakis