Is Azure Right For My Project?

R H 41 Reputation points
2022-11-22T17:23:29.87+00:00

Hello: Am just getting my feet wet with Azure (the initial free subscription) and had some questions as to its capability. I wrote a program in vb.net that has to run through a routine millions of times. I have written it with 4 threads and created an Azure vm (Standard F4s v2) with 4 cores to run it on. On this vm the program is running about 1000 iterations per hour. Thus for just one million iterations that is 1000 hours. Running it on 2 such vms would be 2000 per hour or 500 hours. To get that down to a reasonable time would take many such vms. For instance, to get it down to even 10 hours you would need 100 such vms. Multiple 4 core vms does not seem like the answer to me. Question is whether Azure has any other type of solution that would run something like this in a reasonable amount of time. Would it work for me to run this on multiple 32/64 core vms? Note that this is a Windows program written in vb.net, which is what I know, however if there may be a solution that would work for me requiring a re-write in some other language or O/S, I would learn it. I really need some sort of super-computer type computing power (note that this is just computational intensive. there is little I/O or storage). If Azure isn't it, I would love to hear any opinions as to any other possible ways I might do this. Thank you. I appreciate your interest and help.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,042 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Michael Taylor 60,326 Reputation points
    2022-11-22T17:52:05.88+00:00

    How about you remove the limit of 4 threads and let it use whatever is available on the machine? Then see if it is still slow. In general you should not code for a specific thread count as you have no idea what capabilities the processor has. For example your 4 core machine may support 8 logical threads. Furthermore your work may be a mix of IO and CPU bound work so it is possible while one thread is doing IO another thread can be using one of the CPUs. It is generally best to let the runtime figure out the threading and you just write your code to do the actual work.

    You didn't post how you're breaking up your problem so we'll struggle to provide any guidance but unless you have a very specific need to control what work is done on what threads you might consider using the Dataflow library which allows you to partition large sets of data into smaller sets and work on them in parallel. It completely depends upon the problem you're solving of course but it is a good start.

    1 person found this answer helpful.

  2. kobulloc-MSFT 26,811 Reputation points Microsoft Employee Moderator
    2022-12-01T07:18:23.283+00:00

    Hello, @R H !

    I'd like to second what @Michael Taylor has said--usually if you find yourself looking for supercomputer-level power for a personal project it's a good idea to look at optimization before looking at additional power. Azure does offer this kind of computing power but there's likely a better (and cheaper) way to go about this than by using brute force. I'd like to review some of the services that Azure offers which may be of use.

    Is Azure a good option for my compute intensive workload?
    There are very few scenarios where the cloud is not a better choice than an on-premises solution which is why so many companies have been moving to the cloud. A direct follow up question, however, would be what is the best architecture for your solution and to that end I'm going to include some Azure services that may be of use.

    Advantages of Azure over an on-premises solution
    For your solution, I imagine that cost and hardware availability are core considerations but there are a lot of other benefits that the cloud offers as well.

    • On demand: Solutions can be created on demand and deleted just as easily.
    • Setup time: Creating resources can usually be done within a couple minutes so you can get started quickly.
    • Cost: Pay as you go pricing with no upfront costs and competitive prices that often beat the cost of on-premises solutions (including things like electricity and cooling).
    • Scaling and flexibility: You can scale your workloads based on metrics with a few clicks (even automatically).
    • Power usage (and environmental impact): Heavy computation workloads use a lot of power so the cost of your power usage as well as your environmental impact will be important.
    • Maintenance: You can have Azure take care of your software and security updates leaving you more time to focus on your solution.
    • Reliability: Azure offers SLAs to ensure that your solution has as much uptime as possible.
    • Security: Cloud workloads suffer far fewer security incidents than those in traditional data centers.
    • Remote access and team controls: You can access your solution from practically anywhere, and on several different devices. There are also a lot of tools at your disposal when it comes to working with teams.

    Read more: Cloud storage vs. on-premises servers: 9 things to keep in mind

    Azure services for compute related solutions
    There are a variety of Azure services you can use for your compute related solutions. If VMs aren't cutting it, you may want to look into a couple of the other options. Given the number of hours you are looking at, I might recommend starting at the bottom of the list with the big compute architecture style documentation that covers Azure Batch.

    • Virtual machines: VMs are a great solution for a wide variety of projects and it sounds like you are already experimenting with compute optimized VMs using the F4s v2.
    • Virtual machine scale sets: You can create and deploy thousands of VMs in minutes depending on your needs.
    • Azure Functions: You mentioned that you would be open to other languages and Azure Functions allows you to abstract away the operating system to focus on the code. Several languages are supported, including C#, Java, JavaScript, PowerShell, Python, TypeScript, and Go/Rust.
    • Azure Batch: Used for managing large-scale high-performance computing (HPC) applications.
    • Azure Kubernetes Service (AKS) and Azure Container Instances (ACI): Although these don't sound like a natural fit for your scenario, they may be worth considering for future projects.

    Read more: Big compute architecture style

    265989-image.png

    I hope this helps!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.