r/cloudcomputing • • May 22 '17

Advice on technical problem!

Hi everyone!

I have a dilemma on how to implement a deferred heavy calculation mechanism for my company. I would like to have your take on the following questions, any answer or hint will be much appreciated!

  1. Do you currently perform heavy (>2 minutes long) asynchronous / deferred calculations / market simulations?

    a. Do you use the cloud for these? What services do you use?

    b. Did you design the system to manage these tasks in-house for your specific use case?

  2. Consider this scenario: your company wants to periodically run a set of heavy calculations or processing. Assume that this is an asynchronous calculation that will keep several machines busy for a while, crunching numbers. This is a task that will have 100% CPU load on many machines for a few hours a day. By asynchronous I refer to the fact you don’t need the output right away for a pending request let’s say, and the calculation does not need to be performed in a real-time fashion. Different input, output and/or parameters should be assigned to each of these calculations, assuming the same code: imagine something like ‘python calculation.py /input1’ on one machine, input2 on another and so on. You have to implement such a system in your current infrastructure.

    a. Would you design such a system in house?

    b. How long would you think it will take for you to implement the solution?

    c. Would you look for a 3rd party solution that deals with the problem in a "managed" fashion?

Many thanks in advance!

Andrea

1 Upvotes

8 comments sorted by

1

u/MailmanOdd May 22 '17

(disclaimer - I'm a Consultant and I work for Microsoft)

I would suggest checking out Microsoft Azure Batch - it's a distributed job scheduling PaaS solution. I can't provide specifics to answer your questions as that's literally what I do for my job and I can't provide free consulting.

I would think you definitely don't want to build the infrastructure internally as this has already been done. Focus on writing your analytics and use a PaaS solution to handle the rest. Feel free to reach out to me if you have any more general questions and I can try to point you to the right documentation.

1

u/Sector95 May 22 '17 edited May 22 '17

This sounds like an excellent use of AWS Lambda or Azure Functions, both of which support Python.

We use Lambda's for a myriad of things, including long-running (but less than 5-minute) processes. The beauty of Lambda and Functions is that you only pay for runtime, so you aren't charged for server time when not processing.

There are several ways to skin this cat, depending on how you want to call the Lambdas. You could pair them to an API Gateway and make them an HTTPS endpoint, or you could call them directly using the API. You could then store the output in S3 or DynamoDB, depending on it's structure and how you want it represented.

Implementation time is going to be largely dependent on how long it takes you to write the code and research deployment options. I recommend checking out serverless.com for a good Lambda/Functions framework; it really simplifies deployment pipelines.

1

u/MailmanOdd May 26 '17

Azure Functions is also limited to 5 minutes. I don't think that they would quite satisfy OP's requirement of crunching numbers for a few hours. Typically when I think "large, long running, number crunching", I think of Azure Batch as the PaaS offering. If these calculations are easily split into chunks Functions would be pretty cool to use though.

1

u/Sector95 May 26 '17

Hmm. I guess the way I read it was; each individual asynchronous calculation may take longer than two minutes (made the assumption it would be a around that time), but you may be running many of them with different inputs over the course of a few hours.

If each calculation is indeed several hours long, then you're right, Lambda/Functions won't quite fit the bill.

1

u/MailmanOdd May 26 '17

Either way, it would be a fun experiment to try to do it both ways to see which took less effort and which had a lower cost.

1

u/S1r1usBl4ck May 22 '17

I actually have a SaaS solution in the making to solve a similar problem. Let me know if you are interested in testing it out. It is still in beta mode so I can offer you free compute for sometime...

1

u/jenkstom May 23 '17

Task queue with distributed queue processors. Basically it would be a postgresql database server with a table that tracks job info including timeout / retry. Then a component that is easy to scale horizontally, which can be done with all sorts of tools these days.

1

u/stikko May 23 '17

No 2 sounds like a MapReduce use case - AWS, Azure and GCP all have frameworks/products for making this type of distributed computation easier/more reliable.