Web-development – How to calculate server requirement for a web application

programming practicesprogramming-languagesproject-managementweb-applicationsweb-development

I am developing a backend where in I will be exposing APIs for my mobile application. Users can register,add products,share the links of products through email/sms/anywhere and others can click on it and buy the product. This is the simple workflow of the mobile application. The app is an image intensive app which will have image uploads and retrieval which will be done by third party cloud service. SO the image part is not handled by my backend.

Now I am from the development team and have little experience on hardware server side. When I gave the requirement for the infrastructure, they have given asked me the following questions.

  1. Application/Storage Throughput
  2. Application throughput (No. of concurrent connections in 3 months , 6
    months and 1 year)
  3. Storage throughput (Data growth in 3 months , 6 months and 1 year)
  4. HA requirement
  5. DR requirement

I am not sure how do I forecast the above 3 points. How are through puts calculated? I will on an estimate will be having 10000 users registering on my application in the first month out of which 5000 will be active users. On an average login to application there will be 10 API hits per user which will lead to 5000*10 = 50,000 hits per month which would be 1 API hit per minute,ie ~2 concurrent connections in first month.

Is the calculation goes like this? and how do I calculate the data growth ? Does it mean, a user registers,creates product and if I total the database size consumed for that, is that what is called data growth?

This question would seem pathetic, but I genuinely need help in figuring out how throughputs are calculated for server requirements.

Best Answer

The first three points are capacity planning. The organization is trying to budget and predict for the future. Alas, there is no simple or accepted way to predict performance and scalability. Each application and environment is different. Therefore, the best way to answer this is to measure.

Specifically:

  1. Discuss with your management or product owners what the likely growth in users will be and the types of different users. If they do not know, guess but document that these are guesses.
  2. Create an automated run through of common paths of your application. You can record activity or enter your own into load testing applications like JMeter.
  3. Create a test environment that matches your current or projected hardware. Pay close attention to things like bandwidth, storage, SSL, logging or other frequently forgotten aspects that could affect performance. Mock out the third party image service if you can, using smaller or representative images.
  4. Use the load testing application to create the proposed for the projected numbers of users at different times.
  5. Use an application performance management tool, like AppDynamics or DynaTrace, to measure performance and identify bottlenecks.

In addition to above requirements, this can help you:

  1. Confirm your environment supports the requested load.
  2. Find the maximum load your environment supports.
  3. Find the bottleneck(s) limiting your performance or scalability.
  4. Experiment with different configurations to see how the perform or scale.
  5. Observe how the system copes when you trigger failures.

The last two points, HA requirement (high availability) and DR (disaster recovery, presumably RPO (recovery point objective) and RTO (recovery time objective)), are harder to predict as these are really business requirements. Discuss with your management or product owners the likely failures and how much they will cost to mitigate or fix. If both of you are new to this, expect lots of guessing and late nights on your part.