question

Dan-4154 avatar image
0 Votes"
Dan-4154 asked ·

PHP-Python Workflow - On Demand


Hi everyone,

I'm looking for some solution design and ideas for a little side project site I'm working on. In brief, the way it works is, PHP will generate a .php file and that file contains instructions to run a python job. The python job should execute, gather the required data, and then return the results to PHP. Next, PHP will run a secondary task, which again requires the execution of a different python job once the data is provided to PHP, PHP will in turn display data to the front end/website, and the workflow is finished.

Now, I got some of this process working on a VM, but the proxy scripts takes 1-2 mins to run on my server, and I need to bring it down to 5 seconds or less. The way for me to bring it down is by having python re-configured to run it's processes via threading 50x. I can't do this locally on the VM server as it doesn't have the resources to run 50 threads simultaneously, so I' thinking about offloading this to a fast and cost efficient solution, ie Azure. If I can have PHP send the request to Azure for processing of the python job, then that may solve my problem and it really shouldn't cost much, especially if I'm billed according to time utilizing the platform (few seconds for each request).

I'm looking for some opinions and ideas, as I'm just trying to learn more about Azure. Can I use containers, logic apps, or functions, etc. If anyone has any suggestions, I can dig deeper on those features and topic.

Additional Note: The python job is not just a single .py file, it's a library which consists of python files, jsons, cfg, etc. Here is an example of what the files look like in one of the python jobs: https://github.com/mirhmousavi/Pois

Thanks!

azure-webappsazure-functionsazure-logic-apps
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MayankBargali-MSFT avatar image
0 Votes"
MayankBargali-MSFT answered ·

Hi @Dan-4154

Welcome to Microsoft Q&A! Thanks for posting the question.

I will suggest you to review the compute decision tree to know what would be the best azure service you can use to migrate your existing application.
If your application is already containerized then the best would be running it on the container instance. Azure function would be the best fit if you can rework your application to make it work with azure functions and at the same time it will be cost effective but for high intensive works continuously you can choose different web apps plans.

· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.