My site is loading very slowly and sending out a bunch of 504 errors. Got this from my hosting company:
Just a quick update. I ran a search through your logs the top ten pages on which 504 errors were encountered. The results are below:
1009 higherperspectives.com POST /wp-admin/admin-ajax.php HTTP/1.1
625 higherperspectives.com GET /fall-asleep-fast/ HTTP/1.1
325 higherperspective.com GET /?stylesheet=custom&ver=4.0.1 HTTP/1.1
282 higherperspectives.com GET /being-alone/ HTTP/1.1
209 higherperspectives.com GET /gut-feelings/ HTTP/1.1
139 higherperspectives.com GET /mysterious-fireballs/ HTTP/1.1
127 higherperspectives.com GET /monk/ HTTP/1.1
119 higherperspective.com GET /2015/02/rituals.html?utm_source=cleo&ts_pid=2 HTTP/1.1
109 higherperspective.com GET /wp-content/plugins/anti-captcha/anti-captcha-0.3.js.php?ver=68dd09b9ff11f0df5624a690fe0f6729 HTTP/1.1
85 higherperspectives.com GET /shipping-container/ HTTP/1.1
The top result showed a large number of hits to admin-ajax. To get a little more information, I added the following line to your wp-config.php. Basically, this creates a text file in your wp-content folder that contains a record of all hits to your ajax file. I let that run for about five minutes. Please note: if you’re ever going to try this troubleshooting step from your end, please be sure to remove that line from your wp-config.php file you’re done. If it’s left on for long periods of time, it can create a VERY large file.
The following action was seemingly hitting admin-ajax up to several times a second:
[action] => td_ajax_block
Running a search for that action within your file system showed that was associated with your Newspaper theme. Here are the files in which it can be found which you can provide to your site’s developer or the theme developer:
wp-content/themes/Newspaper/includes/wp_booster/td_ajax.php
5:function td_ajax_block(){
88:add_action( ‘wp_ajax_nopriv_td_ajax_block’, ‘td_ajax_block’ );
89:add_action( ‘wp_ajax_td_ajax_block’, ‘td_ajax_block’ );
wp-content/themes/Newspaper/js/min/site.min.js
50:function td_ajax_do_block_request(a,c){var b=JSON.stringify(a);if(td_local_cache.exist(b))return td_block_ajax_loading_start(a,!0,c),td_ajax_block_process_response(td_local_cache.get(b),c),”cache_hit”;td_block_ajax_loading_start(a,!1,c);jQuery.ajax({type:”POST”,url:td_ajax_url,cache:!0,data:{action:”td_ajax_block”,td_atts:a.atts,td_cur_cat:a.td_cur_cat,td_block_id:a.id,td_column_number:a.td_column_number,td_current_page:a.td_current_page,block_type:a.block_type,td_user_action:a.td_user_action},success:function(a,
51:e,f){td_local_cache.set(b,a);td_ajax_block_process_response(a,c)},error:function(a,c,b){}})}
52:function td_ajax_block_process_response(a,c){var b=jQuery.parseJSON(a);jQuery(“.sub-cat-“+b.td_block_id).removeClass(“cur-sub-cat”);jQuery(“#sub-cat-“+b.td_block_id+”-“+b.td_cur_cat).addClass(“cur-sub-cat”);”load_more”==c||”infinite_load”==c?jQuery(b.td_data).addClass(“animated_xxlong”).appendTo(“#”+b.td_block_id).addClass(“fadeIn”):jQuery(“#”+b.td_block_id).html(b.td_data);!0===b.td_hide_prev?jQuery(“#prev-page-“+b.td_block_id).addClass(“ajax-page-disabled”):jQuery(“#prev-page-“+b.td_block_id).removeClass(“ajax-page-disabled”);
wp-content/themes/Newspaper/js/td_blocks.js
190: td_ajax_block_process_response(td_local_cache.get(current_block_obj_signature), td_user_action);
200: action: ‘td_ajax_block’,
219: td_ajax_block_process_response(data, td_user_action);
233:function td_ajax_block_process_response(data, td_user_action) {
wp-content/themes/Newspaper/js/full_compact/site.js
1663: td_ajax_block_process_response(td_local_cache.get(current_block_obj_signature), td_user_action);
1673: action: ‘td_ajax_block’,
1692: td_ajax_block_process_response(data, td_user_action);
1706:function td_ajax_block_process_response(data, td_user_action
We’ll keep looking into this to be sure that it’s those admin-ajax hits contributing to the 504s, but I wanted to pass along that information in the interim.
Help??
Often an issue with not enough memory allocated to php for your domain.
Ideally at least 128MB should be allocated, 256MB is better. Depending on your account they may limit that to as little as 16 or 32MB. Anything less than 64MB with modern themes, especially those using something like Visual Composer, and all those fun options like infinite loading, etc., all are queries via ajax and/or dbase.
First try increasing the memory allocated to php for your domain, or ask your host what the current limit it.