views:

110

answers:

3

Hello Team,

Our client requirement is to develop a WCF which can withstand with 1-2k concurrent website users and response should be around 25 milliseconds.

This service reads couple of columns from database and will be consumed by different vendors.

Can you suggest any architecture or any extra efforts that I need to take while developing. And how do we calculate server hardware configuration to cope up with.

Thanks in advance.

+1  A: 

A few principles:

  1. Test early, test often.
  2. Successful systems get more traffic
  3. Reliability is usually important
  4. Caching is often a key to performance

To elaborate. Build a simple system right now. Even if the business logic is very simplified, if it's a web service and database access you can performance test it. Test with one user. What do you see? Where does the time go? As you develop the system adding in real code keep doing that test. Reasons: a). right now you know if 25ms is even achievable. b). You spot any code changes that hurt performance immediately. Now test with lots of user, what degradation patterns do you hit? This starts to give you and indication of your paltforms capabilities.

I suspect that the outcome will be that a single machine won't cut it for you. And even if it will, if you're successful you get more traffic. So plan to use more than one server.

And anyway for reliability reasons you need more than one server. And all sorts of interesting implementation details fall out when you can't assume a single server - eg. you don't have Singletons any more ;-)

Most times we get good performance using a cache. Will many users ask for the same data? Can you cache it? Are there updates to consider? in which case do you need a distributed cache system with clustered invalidation? That multi-server case emerging again.

djna
Will many users ask for the same data? No, data will be different.Can you cache it?I can catch it according to client connected and their frequent queries.Are there updates to consider?There would be updates but not from service.in which case do you need a distributed cache system with clustered invalidation?I am unclear about clustered invalidation ?
ANIL MANE
A: 

Why do you need WCF?

Could you shift as much of that service as possible into static serving and cache lookups?

If I understand your question 1000s of users will be hitting your website and executing queries on your DB. You should definitely be looking into connection pools on your WCF connections, but your best bet will be to avoid doing DB lookups altogether and have your website returning data from cache hits.

I'd also look into why you couldn't just connect directly to the database for your lookups, do you actually need a WCF service in the way first?

Look into Memcached.

Spence
Why do you need WCF?Because it can be treated as a component for our client's vendor and scalable.
ANIL MANE
And databases aren't?
Spence
+2  A: 

Hardly possible. You need network connection to service, service activation, business logic processing, database connection (another network connection), database query. Because of 2000 concurrent users you need several application servers = network connection is affected by load balancer. I can't imagine network and HW infrastructure which should be able to complete such operation within 25ms for 2000 concurrent users. Such requirement is not realistic.

I guess if you simply try to run the database query from your computer to remote DB you will see that even such simple task will not be completed in 25ms.

Ladislav Mrnka