CDbException error on sending multiple campaigns

Discussion in 'Common issues' started by mailmole, May 16, 2019.

  1. mailmole

    mailmole Member

    Joined:
    Aug 8, 2017
    Messages:
    102
    Likes Received:
    4
    S.E:
    2019-09-13 16:13:27
    L.T:
    Regular
    L.C:
    2
    I've been having issues recently with my mailwizz. I migrated to a new server and allocated ca. 1tb of space for hosting my mailwizz to make sure it has enough resources.

    I left it for a month or so and came back to start testing some campaigns. I started 6 different campaigns on a sample of 15k/each. However, as I started multiple campaigns at the same time, I got the CDbException error. Here's the screenshot:

    [​IMG]

    After a couple of minutes, the page went back to normal and I was able to access my mailwizz again. But only 3 of the 6 campaigns were sending something. The rest had the same status, Sending, but they weren't sending anything for hours.

    I stopped all the campaigns to check and optimize my cron settings. This is what I set it to:

    [​IMG]
    https://i.gyazo.com/441f62c0861f6f06998c441fab9aa9a9.png

    So, with 1k of Campaigns AT Once and PCNTL enabled, I reckoned this would solve the issue.

    I went back to my forntend and resumed all of my campaigns. A minute later I refreshed and got the same old CDbException error. After a few mins, I refreshed again and got my mailwizz campaigns page back on screen. But, again, only 2 of the 6 campaigns were sending any volume. I checked again an hour later and nothing changed.

    This issue has been similar to a few others I have been having over the past few months. I did many things. I changed the server, updated the mailwizz version, got more space. Yet, nothing seems to be helping resolve this issue.

    Has anyone has a similar issue? Where else should I look?
     
  2. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,048
    Likes Received:
    2,344
    Your server simply cannot handle the settings.
    1000 campaigns in parallel with 1000 subscriber batches in parallel is huge, you should not have more than 10 in both places.
    Those 1000x1000 will eat all the file descriptors available on your linux box which will render other processes, like mysql, unusable.
    This is why we have this: https://kb.mailwizz.com/articles/un...ery-settings-and-how-they-impact-performance/

    As i said numerous times, mailwizz works in batches, so lower number will always perform better.
     
  3. mailmole

    mailmole Member

    Joined:
    Aug 8, 2017
    Messages:
    102
    Likes Received:
    4
    S.E:
    2019-09-13 16:13:27
    L.T:
    Regular
    L.C:
    2
    @twisted1919 Thank you for the explanation. I followed your advice yesterday and tested a new setup to no success. Here's the screenshot:

    [​IMG]
    The problem still remains. The system is sending only to 2 out of 6 campaigns. And, that is on a server, not a vps!

    This serious puts me in suspicion that the issue is in the application itself. I hope this is not the case. Can you please help us here? What information do you need from us to give us new ideas for resolving this as this is impacting out business.
     
  4. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,048
    Likes Received:
    2,344
    If i'd had a penny for each time when i heard the issue is the application ... :p
    Anyway, you can try to debug the send campaigns command and see what it says: https://kb.mailwizz.com/articles/debug-send-campaigns-command/
    My advise is to also pause your campaigns, remove the apps/common/runtime/mutex folder then try again. My hunch is that some of the campaigns remained lock from previous attempts when you had high settings, so removing the mutex folder should fix the problem.
     
  5. Vpul Shah

    Vpul Shah Active Member Support Staff

    Joined:
    Feb 23, 2015
    Messages:
    733
    Likes Received:
    116
    S.E:
    2019-12-22 13:03:57
    L.T:
    Regular
    L.C:
    1
    Hi,

    Try to keep Campaigns at once 5, Campaigns in parallel 4 and Subscriber batches 3.
    And see how it works and see resources utilization on server.
     
  6. mailmole

    mailmole Member

    Joined:
    Aug 8, 2017
    Messages:
    102
    Likes Received:
    4
    S.E:
    2019-09-13 16:13:27
    L.T:
    Regular
    L.C:
    2
    @twisted1919 Lol, sorry didn't mean to read as if I came to a definite conclusion. I followed your advice and debugged the send campaigns command. Here's the output:

    root:~# /usr/bin/php -q /var/www/domain.com/apps/console/console.php send-campaigns --verbose=1
    [2019-05-19 21:35:09] - Starting the work for this batch...
    [2019-05-19 21:35:09] - Loading 10 campaigns, starting with offset 0...
    [2019-05-19 21:35:09] - No campaign found, stopping.
    [2019-05-19 21:35:09] - This cycle completed in 0 seconds and used 0 B of memory!
    [2019-05-19 21:35:09] - CPU usage in last minute: 0.27, in last 5 minutes: 0.20, in last 15 minutes: 0.17!


    I also deleted the directory mutex and re-started the campaigns. Unfortunately, none of that helped. We currently have 6 campaigns running at the same time, but only 1-2 have been sending today according to the logs.

    What I noticed is that, when we start all the 6 campaigns, 5 of them will be sending within the first 15 mins. Within the next 30 mins, only 3 of them are sending. And, by the time it's been an hour since they were started, only one or two campaigns are sending. I noticed this pattern pretty consistently over the past 2 days.

    Any further thoughts? Where else shall we look next to resolve this?

    Tried it, didn't work :(
     
    Last edited: May 19, 2019
  7. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,048
    Likes Received:
    2,344
    Did you disable the regular cron job which sends the campaigns? Because the above simply says there's nothing to send, so you need to call that when you have campaigns ready for sending, and then you'll see lots of info not just these few lines.

    try that and let's see how it goes.
     
  8. mailmole

    mailmole Member

    Joined:
    Aug 8, 2017
    Messages:
    102
    Likes Received:
    4
    S.E:
    2019-09-13 16:13:27
    L.T:
    Regular
    L.C:
    2
    @twisted1919 I did exactly as it was mentioned in your previous reply and in the linked article.

    I first paused all the campaigns. Waited a few mins to make sure all stopped in the delivery logs. Then, ran crontab -e, removed the cron for send-campaigns and then ran the usr/bin/php -q command.
     
  9. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,048
    Likes Received:
    2,344
    @mailmole - yeah but the cron job finds nothing to send, which means nothing is scheduled to go out at that point. Maybe schedule a campaign in the past so it starts sending when you manually call the send-campaigns command from command line.
     
  10. mailmole

    mailmole Member

    Joined:
    Aug 8, 2017
    Messages:
    102
    Likes Received:
    4
    S.E:
    2019-09-13 16:13:27
    L.T:
    Regular
    L.C:
    2
    @twisted1919 Here's what I did:

    I created two new campaigns next to the 8 currently running. I proceeded with the 2 new campaigns all the way to the scheduling date and time. Unfortunately, in mailwizz, you can't just schedule. You have set the date and time and then click Send. There's no Save button. So, I clicked Send. Once I went back to my Campaigns, I immediately pressed on Pause so the campaigns never went out. I then paused the rest of the campaigns.

    Then, I went to the command line and stopped the cron. After that I ran /usr/bin/php -q /var/www/mymailwizz.com/apps/console/console.php send-campaigns --verbose=1

    and once again got this

    [2019-05-23 21:40:20] - Starting the work for this batch...
    [2019-05-23 21:40:20] - Loading 10 campaigns, starting with offset 0...
    [2019-05-23 21:40:20] - No campaign found, stopping.
    [2019-05-23 21:40:20] - This cycle completed in 0 seconds and used 0 B of memory!
    [2019-05-23 21:40:20] - CPU usage in last minute: 0.67, in last 5 minutes: 0.33, in last 15 minutes: 0.20!

    All this while following your instruction step by step. If I am missing anything please point this out because I think I did everything you tole me to do and yet no output. Should I now resume the paused campaigns? Or, is there something else I should do next?

    BTW, should we really have all the campaigns stopped and cron disabled? I tried
    * * * * * /usr/bin/php -q /var/www/mymailwizz.com/apps/console/console.php send-campaigns >/dev/null 2>&1
    with cron disabled but campaigns triggered to send in the browser and it starting giving the output.
     
    Last edited: May 23, 2019 at 10:58 PM

Share This Page