原创 Multicore and server side computing

2011-4-28 18:00 2416 19 19 分类: 消费电子

We have seen the challenges of multicore programming in mainstream programming in earlier articles.

The main  challenge is refactoring of the code to multiple parallel threads of execution that can run on different cores and in the process, how to address the issues of synchronization, race conditions effectively.

But if there are no synchronizations needed between the parallel threads, it becomes easy and even natural to adopt parallel programming on multicore.

We have seen some such areas like networking and scientific computing. Server side processing is another such area.

If we look at a  modern web server, it runs a software like Apache on Linux or IIS on Microsoft servers. When a request for reading a web page lands in a server, it  spawns a thread which runs to completion. Since most of the web requests to a server are likely to be reading of pages, the web server can spawn multiple threads in parallel to handle requests.

Now, if the server has a multicore processor like Intel Xeon 7500, it helps. Each thread can be run on a different core. This speeds up the
performance of the web server by many times.

For jobs like responding to HTTP requests or generating dynamic page generation, it speeds up the performance. One such study reports that the quad core CPUs provide 55% more performance for generating the dynamic pages than a similarly-priced pair of dual core CPUs.

But there is a catch here. If the web requests access the database or perform I/O intensive jobs, it could create bottlenecks.  One should not expect 8x performance gains by just moving to an octal core server. After initial performance boost, more number of cores does not necessarily translate to higher performance linearly. One needs to do lots of  tuning of various parameters like number of threads, number of ethernet interfaces, cache sizes, I/O, databases and so on!

To summarize, one can getter better performance by moving to multicore servers and with careful tuning of system parameters one can improve it too!


文章评论0条评论)

登录后参与讨论
我要评论
0
19
关闭 站长推荐上一条 /2 下一条