I'm connecting to an API with PHP through a CURL GET and I receive a json with almost 5000 orders. For every order I make another CURL GET and receive the order details (basically 2 foreach). After that I make some inserts and updates in the database (basic stuff) with LARAVEL.
The big problem is that for those 5000 orders I have a loading time of almost one hour. I need to this with a cron every night (and for more than 5000).
I have a cloud solution with 2GB Memory and 2 CoreProcessor.
I tried also Zebra Curl but cannot use that with curl in curl request.
if 2% of the daily jobs (1 of 50 organisations) takes almost 4% of a day you definitely need parallel processing.
There are several solutions for that:
I would probably use the first one: You could have a cron job check (every minute?) which organisations still need to be processed and which organisations are being processed at the moment and pick one if there are any left.
That way each job would still take 1 hour but all would be processed in the time-span of 2 hours each night.