Romper
Romper

Reputation: 2257

Choose Amazon EC2 Instance Types

What Amazon EC2 Instance Types to choose for an application that only receive json, transform, save to database and return a json.

Java(Spring) + PostgreSQL

Expected req/sec 10k.

Upvotes: 1

Views: 888

Answers (2)

Vittorio Ballestra
Vittorio Ballestra

Reputation: 419

Let's say that every request requires 20ms of CPU processing time (thus not taking into account the waits between I/O operations), then each core will be able to process around 50 requests per second. In order to process 10k request per seconds you will need 200 cores, this can be achieved with 16 VCPU with 16 cores each.

Having said that you can then select the right instance for your needs using ec2 selector tool, for instance:

If you have other constraints or if my assumptions weren't correct you can change the filters accordingly and choose the best type that suits your needs.

Upvotes: 0

Amit
Amit

Reputation: 32386

Your application is CPU bound application and you should choose compute optimized instance, C4 is the latest generation instances in the compute optimized instances.

I had similar application requirement and with c4.xlarge , i could get 40k/min on a single server within SLA of 10 ms for each request. you can also benchmark your application by running a stress test on different types of C4 generation instances.

you must check out https://aws.amazon.com/ec2/instance-types/ doc by AWS on different types of instances and their use cases.

you can also check the CPU usage on your instance by looking into the cloud-watch metrics or running the top command on your linux instance.

Make sure that your instance is not having more than 75% CPU utilization

You can start with smaller instance and then gradually increase to large server in C4 category, if you see CPU utilization is becoming the bottleneck.This is how i got the perfect instance type for my application , keeping the SLA within 10 ms on server time.

P.S :- in my case DB was also deployed on the same server , so throughput was less , it wil increase if you have DB server installed on other server.

let me know if you need any other info.

Upvotes: 1

Related Questions