If you have a strong processor to operate your webserver and your database quickly (or have the dbf on a separate infrastructure) and use SSD, this should work well. You might like to use a cloud setup with autoscaling for flex cpu power, though make sure the IPs are not to cloudy (i.e. floating, which is not good for mail).I'm getting a big server load with requests to Mailwizz's /dswh/{id} I have it set up with Sparkpost.
Is there a way I could optimize this from the Mailwizz side?
That makes sense, but only if there are events to send. By default we create the webhooks for 'bounce', 'spam_complaint', 'list_unsubscribe' and 'link_unsubscribe' events.or maybe even more frequently depending on how many events there are
Only if there are events to process, events that we subscribe too, and we don't subscribe to all of them.o if I have 100 customers, Sparkpost is calling those pages at least 100 times a minute
No, I only checked the 4 events for every customer.Did you checked other events too ?
Based on what Sparkpost was saying, they will still load the page once a minute though.Only if there are events to process, events that we subscribe too, and we don't subscribe to all of them.
So again, i understand that they might send many requests, but they do so when there are events to process, otherwise, they don't do it.
They don't send 10k a minute all the time but as you can see from the graph, it happened in one minute, one time. Unless something else is causing that page to load.it's hard to believe they send 10k requests per minute
What does this do? Or in other words, what won't happen if I comment it out?maybe the only way it can cause processing is the line 998 ( $events = Yii::app()->ioFilter->xssClean($events); ) which you can comment out to see if things get better,
Yes, this is my understanding.You are saying that those pages only get called by Sparkpost if there are events to process
Why? If there's nothing to post, why would they call the endpoint?but Sparkpost is saying they do it once a minute.
It just does input filtering which is fine to disable a bit just to see if that affects things in any way.Above, you mentioned that we could comment out line 998 ( $events = Yii::app()->ioFilter->xssClean($events); ) of /apps/frontend/controllers/DswhController.php. Before I do that, can you explain what this line does so I know what affect it might have?
The only way i can think of, is to simply disable parts of the code till the high load goes away, then you will see what the culprit is and we can pick it from there.Any other thoughts on where to look?
Nope, not once at each 8 hours. We do have a hourly autoresponder, but i don't think that's it since it doesn't do much anyway.Is there something in MW that is happening every about 8 hours that causes those spikes?
It checks the event and the campaign_delivery_log table to make sure the subscriber did not received the email already.Also, how exactly does MW decide if an autoresponder needs to go to a specific subscriber?
Yes it is.Is that part of the cron that runs each minute?
Unfortunately that's not a good logic from a processing standpoint since you would never know when it previously ran and you would also lose the minute granularity of sending, which is very important in many cases. Anyway, the point is that these runs don't cost much in terms of performance, so i don't think that's your problem. Of course, if our findings get us there, we will look into fixing this aspect.My thought is that the autoresponder that goes out at time interval 0 is very important to check frequently but if the time interval is, for example, 7 days, 14 days, etc, that could be checked just a couple times a day.
mwz usually produces the highest server usage spikes when it makes massive requests to the database, while sending poses only a comparatively little strain@twisted1919, I did more testing yesterday & today and here is what I found:
All of this seems to point to the autoresponders being the issue. Is there anything else we can do to pinpoint exactly what's going on?
- commenting out line 998 of /apps/frontend/controllers/DswhController.php had no effect on the server.
- At 3:00 AM I paused all the autoresponders for about 45 minutes to see what would happen. You can see from the graph that when I paused them, my server load average went to 0. When I unpaused them, it shot back up to the typical load average. I then checked to see when Sparkpost made it's POST requests. They made no POST requests from 12:42AM to 5:31AM.
Thanks
View attachment 3986