Code Monkey home page Code Monkey logo

Comments (3)

liebig avatar liebig commented on July 16, 2024

Hi Norrin,

thanks for your request. This issue sounds really strange and I will try to help you. Since PHP can handle multiple requests, running jobs and calling the website has to work at the same time. Somewhere in your code has to be something which doesn't work asynchronous. How do you make the 20 requests to the URI? Can you provide us an code snippet? And please remove Cron for a test: Just call your 20 requests to the URIs directly without Cron in a Route definition and test if you can make a request to any page of your laravel site. If this doesn't work either, it would not be a problem with Cron. But in this case, I will still try to help you.

Thank you.

from cron.

norrin77 avatar norrin77 commented on July 16, 2024

Hi again

Yes you are right. This problem is not related to your bundle. I've programmed the same job with crontab and it works flawlessly. Moreover, I've tested with two simple web pages (one with a loop taking a very long time) which are requested at almost the same time (first the one with the big loop) and the second request must wait to be processed.

It seems that Laravel is locking the session somehow and thus serializing the execution of multiple parallel requests. I'm trying with a different session driver (memcached) but I still can't figure out what is going on.

Thanks for your help and sorry for any inconvenience.

from cron.

liebig avatar liebig commented on July 16, 2024

Hi Norrin,

I am glad to hear that this issue is not related to Cron. For making asynchronous requests with PHP have a look at this links:
https://bensmann.no/parallel-curl-php/
https://github.com/stil/curl-easy

Thank you.

from cron.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.