New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow requests to ao_speedup_cachebuster: Revival (AWS environment health Degraded) #195

Open
Blackbam opened this Issue Oct 2, 2018 · 3 comments

Comments

2 participants
@Blackbam

Blackbam commented Oct 2, 2018

This ticket is very similar to #104 . I got hundreds of AWS alerts today saying things similar to this:

Message: Environment health has transitioned from Ok to Degraded. ELB health is failing or not available for 1 out of 2 instances.

Looking up the Apache log files I noticed thousands of requests like this:

[02/Oct/2018:11:47:04 +0000] "GET /at/?ao_speedup_cachebuster=91641 HTTP/1.1" 200 11765 "https://example.com/at/?ao_speedup_cachebuster=91641" "WordPress/4.9.8; https://example.com/at"
[02/Oct/2018:11:47:06 +0000] "GET /de/?ao_speedup_cachebuster=95599 HTTP/1.1" 200 10971 "https://example.com/de/?ao_speedup_cachebuster=95599" "WordPress/4.9.8; https://example.com/de"
[02/Oct/2018:11:47:06 +0000] "GET /de/examplesystem/images/rl7vv/index.asp?tid=4579 HTTP/1.1" 404 6878 "-" "Mozilla/5.0 (compatible; MJ12bot/v1.4.8; http://mj12bot.com/)"
[02/Oct/2018:11:47:07 +0000] "GET /at/?ao_speedup_cachebuster=50662 HTTP/1.1" 200 11765 "https://example.com/at/?ao_speedup_cachebuster=50662" "WordPress/4.9.8; https://example.com/at"
[02/Oct/2018:11:47:07 +0000] "GET /at/?ao_speedup_cachebuster=91659 HTTP/1.1" 200 11765 "https://example.com/at/?ao_speedup_cachebuster=91659" "WordPress/4.9.8; https://example.com/at"
[02/Oct/2018:11:47:08 +0000] "GET /de/?ao_speedup_cachebuster=18647 HTTP/1.1" 200 10856 "https://example.com/de/?ao_speedup_cachebuster=18647" "WordPress/4.9.8; https://example.com/de"

... which obviously are generated by Autoptimize. The root cause MIGHT have been a PHP fatal error with a missing function in the Theme. However there should be at the Plugins' site to prevent this problem escalating?

@futtta

This comment has been minimized.

Show comment
Hide comment
@futtta

futtta Oct 2, 2018

Owner

Hmm ... this issue isn't slow requests, but too many requests, no?

Now the issue with stale object caches (which was mentioned in the linked issue) as reason for too many ao_speedup_cachebuster requests was fixed by checking a transient with an hour lifetime (see https://github.com/futtta/autoptimize/blob/beta/classes/autoptimizeVersionUpdatesHandler.php#L79-L91), so either transients are not functioning correctly on your installation or (more probable) you're having an issue with something triggering very frequent page cache purges (which AO now listens for to clear it's own cache). Are you using a page caching plugin and if so which one?

If this is the problem, you can stop AO from listening for cache purges with this code snippet;
add_filter('autoptimize_filter_main_hookpagecachepurge','__return_false');

Owner

futtta commented Oct 2, 2018

Hmm ... this issue isn't slow requests, but too many requests, no?

Now the issue with stale object caches (which was mentioned in the linked issue) as reason for too many ao_speedup_cachebuster requests was fixed by checking a transient with an hour lifetime (see https://github.com/futtta/autoptimize/blob/beta/classes/autoptimizeVersionUpdatesHandler.php#L79-L91), so either transients are not functioning correctly on your installation or (more probable) you're having an issue with something triggering very frequent page cache purges (which AO now listens for to clear it's own cache). Are you using a page caching plugin and if so which one?

If this is the problem, you can stop AO from listening for cache purges with this code snippet;
add_filter('autoptimize_filter_main_hookpagecachepurge','__return_false');

@Blackbam

This comment has been minimized.

Show comment
Hide comment
@Blackbam

Blackbam Oct 2, 2018

Thanks a lot for your fast reaction and detailed answer. Yes I think the problem are too many requests (like 50-100 within 5-10 seconds regarding to the logfiles, which should be enough to slow the server down).

Indeed a page caching plugin is used. Comet Cache is quite a simple Plugin just rendering all pages to static as they are (https://de.wordpress.org/plugins/comet-cache/). The cache expiry is set to 7 days as long as no user triggers deletion and there is no change in the page contents.

Theoretically it might be responsible for those problems though Autoptimize and Comet Cache have been working well together as it seems until the latest Autoptimize update. Was there a major change in the cache clearing policy?

(Definitly I will implement your approach regarding the the cleared caches as in our deployment cycle autoptimize only has to generate the files after each deployment per multisite site once).

Blackbam commented Oct 2, 2018

Thanks a lot for your fast reaction and detailed answer. Yes I think the problem are too many requests (like 50-100 within 5-10 seconds regarding to the logfiles, which should be enough to slow the server down).

Indeed a page caching plugin is used. Comet Cache is quite a simple Plugin just rendering all pages to static as they are (https://de.wordpress.org/plugins/comet-cache/). The cache expiry is set to 7 days as long as no user triggers deletion and there is no change in the page contents.

Theoretically it might be responsible for those problems though Autoptimize and Comet Cache have been working well together as it seems until the latest Autoptimize update. Was there a major change in the cache clearing policy?

(Definitly I will implement your approach regarding the the cleared caches as in our deployment cycle autoptimize only has to generate the files after each deployment per multisite site once).

@futtta

This comment has been minimized.

Show comment
Hide comment
@futtta

futtta Oct 2, 2018

Owner
Owner

futtta commented Oct 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment