JMAConsulting / biz.jmaconsulting.mte

Mandrill Emails Extension for CiviCRM
10 stars 21 forks source link

Performance: reconsider storing each email as an Activity #110

Open xurizaemon opened 7 years ago

xurizaemon commented 7 years ago

Storing each email as an Activity (again?) seems to be done in order to connect the sent Mandrill email back to CiviCRM. But this approach seems quite heavyweight in the DB (our client had a similar situation to #26, where otherwise normal CiviMail usage led to several GB of DB storage being consumed in a few months).

Various options present themselves:

This extension is labelled discontinued, so it's up to the user community to engage this. Opening this issue to get our experience & thoughts out in the open.

JoeMurray commented 7 years ago

@Pradeep could you investigate and discuss with me tomorrow, including options and scope. Thx

xurizaemon commented 7 years ago

Branch @ https://github.com/fuzionnz/biz.jmaconsulting.mte/tree/configure_activity_mailbody (source of this batch of commits) is WIP making the fix proposed in #26 a configurable setting - I am not making this a PR yet, just sharing our work.

JoeMurray commented 7 years ago

Thanks!!

artfulrobot commented 5 years ago

@xurizaemon do you use that patch in production? My client's use of this extension generates 5GB/day after a big mailing! Is there any need to store the whole email body? Can't see advantage?

xurizaemon commented 5 years ago

Yikes! @artfulrobot IDK if this is used in production as I no longer work on the affected site, but no I don't think there's any reason to keep the body of each generated mail in the DB, hence the config option. (Took me a while rereading this to realise I appear to have been making it possible to NOT store that!)

@petednz might be able to answer. (Pete: RM-13550, RM-13554, RM-13562.)

It's been a few years and I presume the extension has had updates since!

JoeMurray commented 5 years ago

I think two activities per email recipient is a problem and likely wasn't in the original behaviour. I would be happy to consider a PR. If it will involve a significant tradeoff in reporting to avoid db bloat then maybe use a setting to allow end users to choose.

artfulrobot commented 5 years ago

@JoeMurray I just wasn't clear why it was creating any activities? Do you know why it does that? It seems to write opens/clicks to the expected tables already, so why the activities?

petednz commented 5 years ago

I won't be able to answer till next week when jitendra is back from leave.

artfulrobot commented 5 years ago

Thanks @petednz . Running this extension on a site that does a lot of mailing has caused MySQL to crash and brought the site down twice now due to its massive data consumption in the civicrm_activity table, so I'm keen to find a solution.

artfulrobot commented 5 years ago

@petednz be great to have a brief chat about this with someone who understands the code, if poss, either here or on mattermost. Do you think anyone might be up for that?

petednz commented 5 years ago

afaik we do not have this patch in use on the only site we still have mandrill running on

artfulrobot commented 5 years ago

FYI Today I released this alternative extension https://github.com/artfulrobot/mandrill

Please see the README for reasons why.