⚠ [SOLVED] E-Mails (sending) are delayed (including notifications)

Infos:

  • Used Zammad version: 4.0
  • Used Zammad installation source: package
  • Operating system: Debian
  • Browser + version: irrelevant

Expected behavior:

  • E-Mails should be sent immediately

Actual behavior:

  • E-Mails (including notifications) get sent with a long delay

Steps to reproduce the behavior:

  • We had a internet outage over the weekend and one systems (KIX installation) sent failure notifications as hell :frowning:
    All the messages were immediately received and processed by our zammad instance :+1:
  • But now notification emails are dripping in one by one on a 2 minutes interval. (We have received about 300 failure messages…)
    Additionally all outgoing emails will not be sent at the moment and we assume this is due to pending notifications…

image

any suggestions are very much appreciated.

BR wucherpfennig

Overall information (adaptions to the system due to other threads):

  • only a few overviews
  • only a few agents (15)
  • CPU load almost no load
  • 64 GB ram
  • elastic search options set to:
-Xms8g
-Xmx8g
  • no errors in var/log/production.log to be found
  • restart zammad service no solution
  • output of delayed job
zammad run rails r "p Delayed::Job.count"
3008 (this number droped to 2974 within 1! hour)

zammad run rails r "p Delayed::Job.first"
#<Delayed::Backend::ActiveRecord::Job id: 1592573, priority: 300, attempts: 0, handler: "--- !ruby/object:ActiveJob::QueueAdapters::Delayed...", last_error: nil, run_at: "2021-03-29 04:53:23", locked_at: nil, failed_at: nil, locked_by: nil, queue: "default", created_at: "2021-03-29 04:53:23", updated_at: "2021-03-29 04:53:23">

zammad run rails r "p Delayed::Job.last"
#<Delayed::Backend::ActiveRecord::Job id: 1595774, priority: 200, attempts: 0, handler: "--- !ruby/object:ActiveJob::QueueAdapters::Delayed...", last_error: nil, run_at: "2021-03-29 10:38:31", locked_at: nil, failed_at: nil, locked_by: nil, queue: "default", created_at: "2021-03-29 10:38:31", updated_at: "2021-03-29 10:38:31">
  • adjusted variables
zammad config:set WEB_CONCURRENCY=4
zammad config:set ZAMMAD_SESSION_JOBS_CONCURRENT=8

observations

INFO -- : Performed TransactionJob (Job ID: 0505c248-d3aa-4d9d-bc25-0bc39ad26f4d) from DelayedJob(default) in 120289.16ms

Similar issues:

Hi, I have tried as many information as I could. It is very frustrating as the CPU is most of the time doing excatly nothing and still there is this “hard coded” two minutes delay with everything. Worst thing: every new mail (to be sent by agents / notification) will scheduled after the existing ones…

Honestly this issue drives me nuts and makes the whole system unusable…

So any help is higly appreciated!

I guess I have solved the issue. After checking in the mail logs I found that there was always a message:

“My unqualified host name (foo.bar) unknown”

Solution: https://serverfault.com/a/58366

A small side note on above setting as the documentation (Configuration via Environment Variables — Zammad System Documentation documentation) doesn’t seem to state that clearly enough:

This setting is only relevant to user sessions.
Setting this to 1 or 2 should be fairly enough for e.g. 15 users.
Using this setting will allow your scheduler main process to have more time for delayed jobs and other timed tasks.

It can be perfectly normal for a Zammad installation to have spiking numbers of delayed jobs, however, they should decrease in a timely manner. This sometimes isn’t exactly possible if e.g. thirdparty systems like mail servers are delaying sendouts etc.

Glad you could solve your issue.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.