Skip to content

"Maximum execution time of 30 seconds exceeded" in Count with 4M documents #1833

@fparareda

Description

@fparareda

Good morning,
I have faced an error: "Maximum execution time of 30 seconds exceeded" after a Count in my MongoDB. My Laravel is a v5.7.22 and I am using your library to use MongoDB as my primary DB (which is awesome, btw).

$amount_companies = CompanyCompaniesBucket::count();

The class I have defined is:

use Jenssegers\Mongodb\Eloquent\Model as Eloquent;

class CompanyCompaniesBucket extends Eloquent { protected $connection = 'mongodb2'; protected $collection = 'companies'; }

I don't know why, but the count reaches 30 seconds when using another tool to explore the MongoDB is only 0.03 seconds (Compass or Robo3T). Do you know what can produce this timeout issue?

Thanks in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions