Forum Moderators: phranque

Message Too Old, No Replies

Which server side language is the best for high performance?

I have a big question for Server side language

         

mrglue

6:36 pm on Oct 9, 2009 (gmt 0)

10+ Year Member



Im a newbie in this Forum. This domain is so attratived with me.

I m finding the server side language for my website before building it. I need my site has a good speed like Facebook (Partial with PHP) cause it seems to be a social networking.

A few days ago, I have found C++ Server pages on [snip]. According to the introdution of that site, we can build a website by C++. And I have a test with Fibonaccy function. On C++ it faster 80 - 100 times than PHP. But I really worry about its security.

So I think I will develop my site base on C++ Server Pages. Before I have a final decission I need your advices so much.
1: which language server side is the best for hight performance?
2: What do you think about the C++ Server pages of [snip].
3: Do you have any advices?
Thanks for reading and replying

[edited by: phranque at 9:56 pm (utc) on Oct. 9, 2009]
[edit reason] No urls, please. See TOS [webmasterworld.com] [/edit]

maximillianos

11:48 pm on Oct 9, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Most web applications these days are bottlenecked by the database and limits of Internet connection speeds. Also, with so many server side caching solutions out there, the language performance almost become irrelevent.

choster

1:11 am on Oct 10, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There is no single correct answer, as much depends on your environment— what kind of server processors, how much memory, what other systems your application will connect to, and as maximillianos notes the bottlenecks often lie in hardware limitations such as bandwidth and disk read/write speeds.

Compiled applications will generally run faster than purely interpreted ones, but with caching schemes of various sorts you can eliminate much of the difference. Your example comparing C++ and PHP is unreliable, because with opcode and memory caches active, PHP can be made to run far faster than with a base configuration.

kaled

2:30 am on Oct 10, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Caching strategies will only ever be effective if pages change infrequently. If pages are required to change per user and/or per reload, caching will never work. In this case, using a compiled language may be advantageous but that will still depend on many things such as the number of simultaneous users expected and whether large images are going to be delivered.

Also, bear in mind, that if you choose a compiled language and later decide to change host, your choice will be limited since few allow compiled languages to be used (but I don't understand why).

Kaled.

mrglue

8:17 am on Oct 10, 2009 (gmt 0)

10+ Year Member



We assume that we have the same environments: software, hard ware, sever code... What do you think about C++ Server Pages?

I think, If the code in *.csp (Sever Side extension - C++ & HTML) was definitely builed by pure C++ so the distance (compile, interpreter... whatever) from *.csp code to machine code is shorter than *.php (or another high language).

Just that...
Thanks for following

lammert

8:46 pm on Oct 10, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I need my site has a good speed like Facebook (Partial with PHP) cause it seems to be a social networking.

On a social networking site the performance impact of the database manipulations is more important than the performance impact of the code which generates the HTML pages.

The trick is to have a good scalable database design which doesn't slow down with an increasing number of concurrent connections and queries.

maximillianos

11:28 pm on Oct 11, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Caching strategies will only ever be effective if pages change infrequently.

What is your definition of infrequent? We utilize memcached on our most popular pages. We have programmed logic to update each page in the cache when it is updated, which can be as often as every few minutes.

Now if you are talking about a page that updates every few seconds, that can make caching the entire page difficult, but it does not stop you from caching pieces of the page makeup.

Facebook, YouTube, etc all use caching solutions and they are all updated frequently.

If pages are required to change per user and/or per reload, caching will never work.

Again, you need to be creative. You can cache bits and pieces of a highly dynamic page to take the pressure off the database. You can even cache query results, headers, footers, anything you want. Perhaps you have a complex query that calculates the user's rank among other members. That might be something you display on every page, but does not necessarily need to be "live". Cache it and save yourself tons of processing per page. Maybe update that cache every 5 minutes, or whatever works for you.

The point is, you need to look at caching as a solution beyond just the old school page caching. I've yet to see a page on the internet that could not benefit from some sort of caching.

kaled

9:13 am on Oct 12, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



maximillianos, you are entirely correct. Sometimes, when trying to keep comments brief and simple, it's possible to go a fraction too far.

Kaled.