Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-4283

Mongoid slow performance on sidekiq workers

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 12_01_17
    • Affects Version/s: 5.1.3
    • Component/s: None
    • Labels:
      None

      Hello,

      I'm using mongoid v5.1.3 together with sidekiq v4.1.2. Latelly I've noticed a drastic hit on performance, a simple query can take 10 - 20 seconds when running on a sidekiq job. I've checked my mongo db stats, I have 500 connections at the same time (it does not seem a big deal) and it doesn't seem to present locking issues.

      My mongo.yml settings are:

       options:
         connect_timeout: 20
         wait_queue_timeout: 10
         socket_timeout: 10
         read:
            mode: :secondary
            max_pool_size: 3000
      

      My Mongo Database is a replica set with one primary and a secondary server.

      If I ran the same queries on a non sidekiq job I don't see any performance issues. Any idea on what it could cause this slow behavior?

      Thanks in advance,
      António Gorgulho

            Assignee:
            emily.stolfo Emily Stolfo
            Reporter:
            team.dev@getsocial.io Team GetSocial
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: