5

this is a question I faced in an interview: A web app is going to go online and the manager want you to find out how many servers the company should purchase. We have one server(used by testers) and some load testing/ performance testing tool. And we assume that xxxx users will visit/use the web app every day. So what are the steps to estimate how many servers is required?

I think first, need to test how many users could be handled with the given server and than try to estimate how many servers we need.

1 Answer 1

4

Your first step is to host the app on as close to a production environment as possible to eliminate "noise" from your load/performance testing. In the case of a test server, you'd want to keep everything else off it, have any database hosted on a separate system if that's your likely production configuration, and then start exploring the application behavior under load.

Some things to consider:

  • You can't actually estimate how many servers you need. What you can do is estimate how many concurrent users and users per hour a given host configuration will be able to handle. If the estimate falls below what you're expecting in traffic, then you'll need to look at load-balanced servers.
  • If you can test to failure, do it (you may find that other elements of your system make this impossible. I know someone who brought down the company intranet with a load test - but the application he was testing didn't blink).
  • Be aware of any other limitations within the application ecosystem: communications with COM objects are subject to a hard limit in queued requests, for instance, and some kinds of interactions can't be multithreaded (I work with a web application that communicates with a mainframe - the mainframe communications are single thread, first in first out). If you have any of these in your application, make sure you explicitly test their limits since they're a likely candidate for bottlenecks.
  • If you're working within your company network, schedule the tests for a time when the intranet isn't heavily loaded. You don't want the company network to be your testing bottleneck (Ideally, you should have the server accessible from outside your company network and use a cloud-based load tool to do the testing - this isn't always possible)
  • Make sure you cover concurrent users (everyone hitting the same thing at the same time) and a user access profile that seems likely for your app. I don't recall the scaling rule of thumb for concurrent users (it's something like 10 concurrent in a 10 minute test = 100 per 10 minutes) but you can probably expect that there will be special events that get you a swarm of concurrent or near-concurrent users. You want to know how well your app handles the different scenarios.

The key thing to remember here (and as an interview question) is that the purpose of load and performance testing isn't to determine what kind of equipment the application needs. It's to locate and eliminate as many bottlenecks as possible. You should never be afraid to tell an interviewer this: if an organization uses load and performance tests for this purpose they run a high risk of over or under-committing resources.

2
  • If I can't estimate how many machines I need to the app to handle a certain traffic, then how companies make such decisions? Sure, they jump into cloud that adapt number of VMs to the traffic but in that cases companies also need to allocate some budget for the max expected number of VMs they want cloud provider to run for them.
    – dzieciou
    May 2, 2015 at 12:27
  • 1
    @dzieciou - the usual method is to base it on their expected user base and scale with growth in users. Load testing indicates whether the system as configured will support the expected user base.
    – Kate Paulk
    May 4, 2015 at 11:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.