Skip to content

Will heavy database query make one of cpu cores idle? #18

@art-in

Description

@art-in

Hi, I'm trying to figure this out, since apparently diesel doesn't support async (nor underlying postgres driver).

You're not explicitly specifying number of workers for HttpServer, which means it will create (number of cpu cores)-threads for handling incoming http requests.

Now, when next http request runs heavy database query through diesel it will block current thread. And for example, if my system has 4 cpu cores, it's enough to run 4 heavy http requests simultaneously to completely DoS entire server.

Is that correct?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions