calculate CPU, Memory, Network usage in a multithreaded application

180 views Asked by At

I would like to have some guidance on how to calculate vCPU, Memory and Network usage for an application that uses multi threads to perform an action every 60 sec.

Let assume I have program that creates multiple thread, and each thread every 60 secs perform a ping to a resource (ip). Let's assume 1,000 ips

Pseudo code:

Class Thread

method start_thread(ip):
  while true
    if ping(ip) is down
      send alert()
    wait(60 sec)

How can I estimate the vCPU, memory and network consumption to safely size the application in a scale out configuration?

Thanks

1

There are 1 answers

0
Juraj Martinka On

Try multiple configurations, gather performance metrics, and evaluate. Besides that, it's a wild speculation. It's likely that the threads won't consume much CPU (most time spent blocked waiting on network IO) but if you want to have 1,000 threads that may put a lot of pressure on the system and require more RAM.