GithubHelp home page GithubHelp logo

Comments (2)

jamesmh avatar jamesmh commented on June 2, 2024 1

Yes, that's an issue that can come up. This used to be the way Coravel worked, but changed it for throughput reasons. I not sure adding this as an option should be a concern of Coravel proper....

There are other ways around this specific issue.

1

You create a static (or DI injected) class that handles creating all your DB connections. This will pool or just limit how many connections can be used at a given time.

Different interfaces could exist for something like this:

var sqlConnection = await connectionPool.GetOpenConnectionAsync();

Or

await connectionPool.WithSqlConnection(async sqlConnection => {
    await sqlConnetion.ExecuteAsync(SQLString_const);
});

Under the covers, you would probably use a semaphore to limit how many actions can occur concurrently.

2

Another consideration: it might be that your code could be issuing too many SQL connections and that could be optimized.

3

Or, if your code gets a specific exception, you could handle that specific exception and retry in X milliseconds (with backoff, etc.) Many use something like Poly for that.

4

Or, it could be a legit issue where there's some bad code that's not releasing DB connections efficiently. Here's a SO example: https://stackoverflow.com/questions/49748789/max-connection-pool-reached

from coravel.

alandecastros avatar alandecastros commented on June 2, 2024

Thanks @jamesmh ! I'll see my options here!

Regards

from coravel.

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.