Ajax loading causing server issues

Posted in: Newspaper
Post count: 7

Hi we got a message from our hosting company saying the Ajax system in our theme is causing some 504 errors. I’m pasting the email from them below. Can you please advise.

Hello info@sneakerbardetroit.com,
Your ticket (#1214944) has been updated.
To review the status of the ticket and add additional comments, follow the link below:
http://help.wpengine.com/hc/requests/1214944
You can also add a comment by replying to this email.
Josh Applekamp (WP Engine Support)
Nov 7, 9:21 AM CST
Hi Mario,
Hope you’re having a great Wednesday!

I wanted to touch base with you regarding some high Ajax counts I am seeing from the sbdetroit site.

32196 /wp-admin/admin-ajax.php?td_theme_name=Newspaper&v=9.1
40522 [action] => td_ajax_loop
36184 [action] => td_ajax_search
8216 [action] => td_ajax_block
wp-content/themes/Newspaper/js/tagdiv_theme.js
13807: action: ‘td_ajax_loop’,

wp-content/themes/Newspaper/includes/wp_booster/td_wp_booster_functions.php
150:add_action(‘wp_ajax_nopriv_td_ajax_loop’, array(‘td_ajax’, ‘on_ajax_loop’));
151:add_action(‘wp_ajax_td_ajax_loop’, array(‘td_ajax’, ‘on_ajax_loop’));
japplekamp_@pod-150264:/nas/content/live/sbdetroit$ ack-grep “td_ajax_search” wp-content/themes/ wp-content/plugins/
wp-content/themes/Newspaper/js/tagdiv_theme.js
6110: action: ‘td_ajax_search’,
6146: action: ‘td_ajax_search’,

wp-content/themes/Newspaper/mobile/js/tagdiv_theme.js
938: action: ‘td_ajax_search’,

wp-content/themes/Newspaper/mobile/functions.php
90:add_action(‘wp_ajax_nopriv_td_ajax_search’, array(‘td_ajax_mob’, ‘on_ajax_search’));
91:add_action(‘wp_ajax_td_ajax_search’, array(‘td_ajax_mob’, ‘on_ajax_search’));

wp-content/themes/Newspaper/includes/wp_booster/td_wp_booster_functions.php
154:add_action(‘wp_ajax_nopriv_td_ajax_search’, array(‘td_ajax’, ‘on_ajax_search’));
155:add_action(‘wp_ajax_td_ajax_search’, array(‘td_ajax’, ‘on_ajax_search’));
japplekamp_@pod-150264:/nas/content/live/sbdetroit$ ack-grep “td_ajax_block” wp-content/themes/ wp-content/plugins/
wp-content/themes/Newspaper/js/tagdiv_theme.js
6849: action: ‘td_ajax_block’,

wp-content/themes/Newspaper/includes/wp_booster/td_wp_booster_functions.php
146:add_action(‘wp_ajax_nopriv_td_ajax_block’, array(‘td_ajax’, ‘on_ajax_block’));
147:add_action(‘wp_ajax_td_ajax_block’, array(‘td_ajax’, ‘on_ajax_block’));
These Ajax hits are being generated from the Newspaper theme. With such a high amount coming through so quickly it is overloading our server queueing system we have for requests and causing 504 errors to occur:
80 504 “POST /wp-admin/admin-ajax.php?td_theme_name=Newspaper&v=9.1

This particular theme does not allow easy updates regarding the Ajax activity. I would recommend reaching out to the theme developers to see if they can provide some input on getting their Ajax activity under control.

Beyond that everything else appears to be in good shape so far. I’ll keep an eye on the server and update you with any additional insight, but if you have any questions for me please let me know!
Thanks,

Josh Applekamp

WP Engine – Technical Project Manager – Finely Tuned WordPress
M-F 9:00am – 5:00pm CST

Post count: 20688

Hi,

There are many elements from the theme that will use ajax. Like the live search function in the header, mega-menu with subcategories, block pagination, the ajax filter displayed in blocks.
So if there are many website visitors at the same time, that may happen (also maybe the server cannot handle that much traffic).

Reducing the number of blocks which use pagination and ajax filters, would reduce the usage of ajax for example
https://www.screencast.com/t/qL6k6qbS

Thanks

Post count: 7

Is there any way to disable the live search feature and just have a normal search in the header instead.

Thanks for letting me know what is using the ajax, I can adjust the website better then because we have millions of views so at times it brings our website down with all the ajax calls.

Post count: 20688

The solution from this topic should still work
https://forum.tagdiv.com/topic/disable-live-search-function/
Removing that function will disable the live search, you could give it a try. That will also reduce the ajax usage.

I believe there are plans to add an option in the theme for disabling/enabling the ajax live search.

Viewing 4 posts - 1 through 4 (of 4 total)
The forum ‘Newspaper’ is closed to new topics and replies.