Support

Home Forums Event Espresso Premium Cron Jobs Help

Cron Jobs Help

Posted: May 1, 2020 at 2:32 am


Jarred

May 1, 2020 at 2:32 am

Hey guys,
I have been having major memory problems becuase to many cron jobs executing is what Siteground told me.

So I am looking at cron events and I see over 120 from EE transaction scheduled. Is this correct?

They told me I should setup a “real” cron job on cpanel.

Right now we have been closed for over a month and not planning to reopen for another few weeks so its good time to clean up.

But when we are busy, I always want to make sure that the customer can get their tickets emailed to them right when they buy AND we have Woocommerce as well and I will want them to get their login/register and buy emails instantly.

If I setup a “real” cron job, will that affect Event Espresso from sending emails instantly when a customer registers and buys?

Here is screenshot of what I see. This screenshot isn’t all of them but there are over 120 of the exact same thing.

http://prntscr.com/s938q9


Jarred

May 1, 2020 at 2:50 am

i see this on site health saying its late to run, but all of those cron jobs on the image above are scheduled for the future.

Is there a way to reset Event Espresso and still save all of our registrations and information from the last 4 years? Im wondering if some options tables are missing or something becuase siteground had to reload a backup a few days ago after their staging environment wasn’t working correctly.

http://prntscr.com/s93gij

I can grant access to backend so someone can see if options or tables are missing?

And if there is a way I can get extra-special-support with a token where you could clean up my event espresso for me like all tables and options and stuff BUT still keep all the customer and registrations information that would be great.

Example, old events, do we need to keep old events forever? We cant delete old events that had people registered.

Sorry rambling now its late. Hopefully someone can understand what I mean.

Thanks


Tony

  • Support Staff

May 1, 2020 at 6:40 am

Hi Jarred,

Before working through all of your points, I just want to clarify something:

Right now we have been closed for over a month and not planning to reopen for another few weeks so its good time to clean up.

So your events are closed right now, right?

The cron jobs in your screenshot are created each time a ticket selector submission is added so that EE can check on the ‘status’ of a registration. For example if something starts a registration and then closes the page, we need some way to know that the ticket they selected should be ‘released’ back for sale, so we add a cron to do so.

But your have crowns from ‘now’ and you’re getting them every so many seconds, meaning something (likely a bot) is submitting the ticket selector(s) on your site to create them… but then if you are closed, why do you have active ticket selectors on the site? (I’m wondering if something else is triggering the cron with a submission)

Do you have reCaptcha enabled on the site?

If I setup a “real” cron job, will that affect Event Espresso from sending emails instantly when a customer registers and buys?

EE emails are separate from the crons you’ve listed and depending on your settings they may use WP_CRON to work through the queue…. however, if your site was set to use your users wouldn’t be receiving emails instantly anyway, that would take at least up to 10 mins to work through message queue to send.

You could set up a cron to run every 5 mins, which would match EE’s timeframe for messages, but again, it sounds like you aren’t using the message queue.

Go to Event Espresso -> Messages -> Settings.

At the bottom there is the option ‘Generate and send all messages:’, what is that set to?

i see this on site health saying its late to run, but all of those cron jobs on the image above are scheduled for the future.

Can you post the specific message it shows that shows its running late?

Is there a way to reset Event Espresso and still save all of our registrations and information from the last 4 years?

Not really, as its all related. More on this below.

Im wondering if some options tables are missing or something becuase siteground had to reload a backup a few days ago after their staging environment wasn’t working correctly.

EE will automatically check for its tables and if any are missing it will throw a notice and automatically fix it (with a new table) but you would know if this was happening as you’d have missing/broken data everywhere.

And if there is a way I can get extra-special-support with a token where you could clean up my event espresso for me like all tables and options and stuff BUT still keep all the customer and registrations information that would be great.

This isn’t something we would normally do and would take a lot longer than the 30mins allocated for a support token.

You can’t remove ‘some’ data from the site and keep other data related to it.

For example you want to keep registration data, but registrations have relationships to Event, Datetimes, Tickets (which again all have their own relationships) so you can’t remove any of that related data, or you break the relationship and when EE tried to view a registration, then pull its datetime data, which is pulled from the event, in short, everything breaks.


Jarred

May 1, 2020 at 4:48 pm

Okay thanks.

Those multiple crons dissapeared now so thats good. I think I know what caused it now, there was an error yesterday that caused the ajax to spin for a long time.

For my message settings.is set to “on same request”

So, if I do decide to follow siteground tutorial for creating real cron job, they tell me to deactivate WP Cron with a code.

So if I use a 30 min cron job on my cpanel, but have messages set to “on same request, AND have WPcron turned off” will messages still go out instantly since the settings are “on request for event espresso” ?

Does a “real cron job” just basically run all pending wp crons every 30 minutes (if thats my setting) which in turn puts some relief on server memory since it will stop WP cron running every minute like it does now becuase of a Mailchimp WooCOmmerce plugin?

Or is it not a good idea to setup a real cron job since I am using EE AND Woocommerce? Meaning I should let WPcron do its thing so that all emails and user info is always up to date while using cache plugin?

Yes I do have recaptcha set on WP Login and my contact forms. But I dont use recaptcha on EE.

Lastly, I noticed I have the Message settings set to “FOREVER” meaning it keeps the message processed forver. Im sure that could be cleaned out to save some space. If I change the setting to 12 months, will it delete all the messages sent before the 12 months?

Thanks


Tony

  • Support Staff

May 4, 2020 at 7:49 am

Those multiple crons dissapeared now so thats good.

They are set to run when the session expired and wp_cron is triggered, so by default would run around 1 hour after the ticket selections were submitted but if you increased the session lifespan that could be longer.

I think I know what caused it now, there was an error yesterday that caused the ajax to spin for a long time.

Oh, so you were submitting multiple test registrations to troubleshoot this? That would create multiple entries.

For my message settings.is set to “on same request”

So, if I do decide to follow siteground tutorial for creating real cron job, they tell me to deactivate WP Cron with a code.

So if I use a 30 min cron job on my cpanel, but have messages set to “on same request, AND have WPcron turned off” will messages still go out instantly since the settings are “on request for event espresso” ?

Yes. ‘On same request’ does not use WP_Cron.

Does a “real cron job” just basically run all pending wp crons every 30 minutes (if thats my setting) which in turn puts some relief on server memory since it will stop WP cron running every minute like it does now becuase of a Mailchimp WooCOmmerce plugin?

WP_CRON is not running every minute because of that plugin, that plugin is hooking into WP_CRON to run a callback function every minute, but thats not ‘causing’ WP_CRON to run.

To give you an idea of what is happening, WP_CRON runs on every request made on your site and it’s a ‘sudo’ schedule in that every request basically triggers a check to see if there are any scheduled functions. Meaning you can say ‘Add this function to WP_CRON and run it every 5 mins’, however, there is no way with WP_CRON to know if that will actually run every 5 mins as it needs a hit on your site, either from your in the admin or a normal visitor so that it can trigger the check.

Real CRON jobs are true schedules and most tutorials will basically have you disable that WP_CRON check that happens on every request and your real cron triggers wp-cron.php to run the check at whatever interval, yes it saves memory but you’ll need to find a middle ground for how often you want the cron to run and how much resources it uses. That’s up to you.

Or is it not a good idea to setup a real cron job since I am using EE AND Woocommerce? Meaning I should let WPcron do its thing so that all emails and user info is always up to date while using cache plugin?

There’s nothing wrong with using a really cron with EE, just don’t expect a daily/12 hour cron schedule to have the same effect as one running on WP_CRON ‘every 5mins’ (if you have a page hit that often).

Emails are separate with the option you have set so it won’t affect them.

Yes I do have recaptcha set on WP Login and my contact forms. But I dont use recaptcha on EE.

I recommend you set it on the ticket selector at least:

Event Espresso -> Registration form -> Reg form settings.

Lastly, I noticed I have the Message settings set to “FOREVER” meaning it keeps the message processed forver. Im sure that could be cleaned out to save some space. If I change the setting to 12 months, will it delete all the messages sent before the 12 months?

Before 12 months? No as then it would be deleting your recent messages.

It will keep messages sent up to the option set then delete anything after that. So setting it to 12months keeps 12 months worth of messages and delete anything sent after that date.

You must be logged in to reply to this support post. Sign In or Register for an Account

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3 Documentation for Event Espresso 4

Status: publish

Updated by  Tony 3 weeks, 1 day ago ago

Topic Tags

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!