With 4 vCPUs, should I choose Alibaba Cloud ECS c8i, g8i or r8i?
The short answer
The three xlarge models differ in memory: ecs.c8i.xlarge has 8 GiB, ecs.g8i.xlarge has 16 GiB and ecs.r8i.xlarge has 32 GiB. Each has 4 vCPUs, giving ratios of 1:2, 1:4 and 1:8. Choose according to the memory your application actually uses.
In more detail
If processing is the main load and 8 GiB comfortably fits, c8i is a candidate. If you need a balance of CPU and memory, start by testing g8i. If a database, cache or application needs more memory without more vCPUs, evaluate r8i with your expected data size and concurrency.
Check disk and network limits, OS compatibility and regional availability for the exact model as well. Extra RAM will not fix a slow external API or the wrong disk configuration. Compare response times and the complete cost after testing; the model with the most memory is not automatically the fastest for your application.