Support

Home Forums Event Espresso Premium Help with site going down when multiple people try to register for events

Help with site going down when multiple people try to register for events

Posted: June 18, 2020 at 4:36 am

Viewing 18 reply threads


SupercarDriver

June 18, 2020 at 4:36 am

We launched a bunch of events at the same time last night which resulted in the site going down. less than 50 users were on the site at the time and it seems to be the registration / payment process that may be the issue.
Multiple requests came from the same IP’s and I’m wondering if there is a script that keeps looping until the server resource gives up?


Tony

  • Support Staff

June 18, 2020 at 5:16 am

Hi there,

When you say the site went down, what error was thrown?

Why type of hosting are you using?

Multiple requests came from the same IP’s and I’m wondering if there is a script that keeps looping until the server resource gives up?

May I ask what makes you think there’s a script looping?


SupercarDriver

June 18, 2020 at 5:26 am

Hi Tony, we use Siteground cloud hosting, the error was 503 (server restarts after it gets overwhelmed), we had a similar issue a couple of years ago and it pointed to a script looping until the server gave up.

I’ve been in touch with our hosts who gave the list of IP’s and how many requests, I’m unsure where to go from here


Tony

  • Support Staff

June 18, 2020 at 6:28 am

With no errors and no additional info other than some IPs there isn’t much you can do yourself.

503 basically just means the server couldn’t keep up with the requests but without knowing why you can troubleshoot this yourself.

Have you checked the error logs for any clues as to what happened?


SupercarDriver

June 26, 2020 at 5:07 am

Hi, we have checked the error logs, around the time of the outages we see a lot of /wp-admin/admin-ajax.php stopped because of load as well as /index.php stopped because of load
We can’t see any PHP errors at the same time as the outages.
It’s been at the same time each week when a bunch of events go live and people begin registering for them. Are there any PHP settings you would recommend.


Tony

  • Support Staff

June 26, 2020 at 5:34 am

Rather than a script looping over taking up the resources, it sounds like your hitting the number of requests your current server can handle.

Which cloud package are you using? Entry?

Are there any PHP settings you would recommend.

The biggest point is to make sure you are using PHP7 as opposed to PHP5 but other than that I don’t have any specific PHP setting recommendations.

Can you send me a test account I can use take run a registration? You can use this form:

https://eventespresso.com/send-login-details/


SupercarDriver

June 28, 2020 at 1:38 pm

This reply has been marked as private.


SupercarDriver

June 30, 2020 at 2:54 am

Hi Tony, any luck with the above?


Tony

  • Support Staff

June 30, 2020 at 9:27 am

The above replies don’t really help and are pretty much useless, it’s basically saying the server can’t cope with the number of 404 requests being thrown on your site from some invalid images:

As you can see in the provided logs, the requests were towards images which do not exist on the site. WordPress responds with a custom PHP Not Found pages in such case. This page has been triggered multiple times just in matter of a few seconds which exceeded the available server resources.

I doubt that the four 404’s thrown on those requests are what is taking the site down, but they should be fixed either way.

The requests throwing the 404’s above are not from Event Espresso, they are from your theme’s CSS. The failing requests are for some icons:

https://monosnap.com/file/tYhrrFwfZH4i5GMOnuIqsdJEHFnGRm

And those are loaded within /wp-content/themes/scdmembers/main-scd.css

The image paths used in that file are wrong, you’ll find stuff like this: background-image:url('../images/icons/drives-icon.png');

From that file, the relative file location would be:

background-image:url('images/icons/drives-icon.png');

(Note the missing ../)

That changes the links from:

https://members.supercar-driver.com/wp-content/themes/images/icons/drives-icon.png
(which doesn’t exist)

To be:

https://members.supercar-driver.com/wp-content/themes/scdmembers/images/icons/drives-icon.png
(Which does)

I recommend contacting the developer who created the theme to fix this, as all relative paths in that file need to be fixed. Every request on your site throws multiple 404’s before of the above, I doubt that’s breaking the site, but it won’t help.

Your main events table is using the table view template, is that a custom template? If so can you post the full contents of that template to pastebin so I can take a look?

There was a change we made to the template a while back to reduce the amount of resources needed for that table, if your template has:

if ( $event->is_sold_out() && $event->is_sold_out(true) ) {...}

Then it’s doing a lot of processing on each event to confirm the sold out status and should just use:

if ( $event->is_sold_out() ) {...}

No caching on the site? The fact that your members all log in would normally mean caching would be disabled anyway, but it is possible to use caching when logged in and you may want to look into applying some caching to pages that can have it enabled (EE’s critical pages can not).

I added a test registration to one of your events and it runs fine, its snappy in fact. So right now it simply looks like your hitting the number of requests your server can handle.

There are some oddities on the site, for example, the image for the Auth.net payment method you are using is using /wp-content/{image-name}.png and that’s not a path we would normally see (nor is it valid on your site).

Did you migrate this site form another server?


SupercarDriver

June 30, 2020 at 10:31 am

This reply has been marked as private.


Tony

  • Support Staff

June 30, 2020 at 11:03 am

This reply has been marked as private.


SupercarDriver

June 30, 2020 at 2:32 pm

This reply has been marked as private.


Tony

  • Support Staff

July 1, 2020 at 8:39 am

No problem and I’m sorry I can’t be of more use with something a little more specific.

Just to note, we don’t keep login details for any longer than necessary so I’ve deleted your form submission and I recommend removing that temp account.


SupercarDriver

July 2, 2020 at 1:15 am

Hi Tony, temp account has been removed, I’ve had one more response from the hosts after having the same issue 3rd week in a row last night:

To answer your question, I would like to provide you with more information about the autoscale logic of the container. Every 5 seconds the system checks the CPU and RAM usage. Also every time a check is made the system calculates the average usage for the last 12 samples (60 seconds). If the average is over 80% (of the last unit) then the system adds more CPU or RAM if autoscaling is enabled.

However, if the spike in resource usage is only temporary – let’s spike there is a surge in traffic or script executions which lasts only for a few seconds, the load on the server will spike and reach critical values. Since the load lasts only for a few seconds, it is not enough to trigger the autoscaling and add more resources to the server.

Keeping this in mind, the best way to avoid experiencing a similar issue due to spikes in script executions is to add more resources to the server as suggested by my colleague.

I remember cron jobs being an issue in the past, we have a plugin to control the cron events, I’ll be checking them over, but is there anything we should be avoiding? We’re still looking to move server anyway.


SupercarDriver

July 2, 2020 at 1:17 am

this is the latest reason the hosts think is the issue

I checked and as my colleagues also mentioned in the previous replies the the error is a result of high load on the server. The servers most executed scipts are:

Count Script Local Path

888 http://members.supercar-driver.com/wp-cron.php /home/adamt364/public_html/membersfiles/wp-cron.php
161 http://supercar-driver.com/wp-cron.php /home/adamt364/public_html/wp-cron.php


Tony

  • Support Staff

July 2, 2020 at 10:19 am

So wp-cron is what is taking the server down? That’s the first bit of useful info from the above replieds.

With wp-cron.php, EVERY request that hits your site will trigger a wp-cron.php check due to how it works. Think of it as a ‘fake scheduler’ in that it can’t tell your server that every 5 mins do X but what it can do is whenever there is a request on your site it can check if a job has been ‘scheduled’ and is due to run.

To give e a real example from Event Espresso we us wp-cron to schedule the message queue system to run every 5 mins. So we have a scheduled task that runs for Messages generation, Message Sending, Message Cleanup. Every request that hits your site also trigers a check to see if any of those tasks are due to run (Note that wp-cron is a WordPress feature we utilize, this isn’t a feature added by EE itself).

So, there’s a couple of things you can try.

First, disable the message system within Event Espresso and switch to sending emails instantly. You do this in Event Espresso -> Messages -> Settings.

You’ll see the option ‘Generate and send all messages:’, set that to ‘On same request’.

That tells Event Espresso to just send the messages on the same request that initialized it (the user’s request) and can mean it takes a little longer for the thank you page to load for your users. I recommend you run a full test registration and confirm it loads fine and you receive the emails.

The above does NOT stop wp-cron from being used, it simply tells Event Espresso not to use it for the emails, so next, disable wp-cron and add a ‘real’ corn to the server to hit wp-cron and run any scheduled tasks that need to be run without each and every request needed it. (Your host should know how to do this for you, infact they have a tutorial on it HERE).

The tutorial shows every 30mins, I recommend every 15, but see what works best for you.


SupercarDriver

July 29, 2020 at 12:54 pm

Hi Guys, so it seems as one problem is solved another has come up. We had a popular event go live tonight at 7pm UK time and the site crashed instantly, the ‘error establishing database connection’ came up but it affect the other website we have on the same server with a different database. Do you know of anything similar happening?


Tony

  • Support Staff

July 29, 2020 at 1:06 pm

It’s the same issue, different symptom.

‘error establishing database connection’ == MySQL crashed.

MySQL is your database management system, so if it crashes it can’t, well manage your databases.

Why did MySQL crash? Likely because the load spiked to something higher than your server could cope with.


SupercarDriver

July 29, 2020 at 2:39 pm

Ok thanks Tony, I think we’re going to have to take the entire site back to bare bones removing all customisations and plugins and see what happens.

Viewing 18 reply threads

The support post ‘Help with site going down when multiple people try to register for events’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso