easyengine icon indicating copy to clipboard operation
easyengine copied to clipboard

Blitz timeouts with EasyEngine [pagespeed issue]

Open SimpleHomelab opened this issue 11 years ago • 30 comments

Did a quick comparison of the same site on two instances:

  1. with W3TC Page (memcached), Object Cache (memcached), and W3TC Browser cache enabled. - My current setup

  2. with EasyEngine Nginx fastcgi cache, Nginx Browser cache, and w3tc object cache (memcached).

Test site was a copy of real full wordpress site with more than 500 posts.

Attached are the Blitz results. EE Nginx settings are default. I am not sure if EE Nginx settings should be optimized but I am surprised to see the big difference. @rahul286 any thoughts would be much appreciated.

new-1

SimpleHomelab avatar Apr 16 '15 19:04 SimpleHomelab

Did you verify fastcgi cache was working correctly?

Please share URL you tested.

rahul286 avatar Apr 16 '15 19:04 rahul286

https://www.blitz.io/ I'll try to incorporate some of these tests/results into my workflow. Thanks.

cm896 avatar Apr 16 '15 19:04 cm896

www.htpcbeginner.com was the test site.

Yes, fastcgi cache is working: capture

Here are the links to full blitz reports:

  1. https://www.blitz.io/report/671aa8181fe71068232f458e2f6eef05
  2. https://www.blitz.io/report/671aa8181fe71068232f458e2f4bdd13

SimpleHomelab avatar Apr 16 '15 19:04 SimpleHomelab

  1. with W3TC Page (memcached), Object Cache (memcached), and W3TC Browser cache enabled. - My current setup

What was web server config in other case? Was it nginx/apache?

  1. with EasyEngine Nginx fastcgi cache, Nginx Browser cache, and w3tc object cache (memcached).

Did you test with pagespeed on/off? What was command used to create EE site?

If you have both setup available can I check wordpress admin and server config for both cases?

rahul286 avatar Apr 16 '15 19:04 rahul286

  1. Nginx, MySQL, PHP5-FPM, Memcached, and Opcache.
  2. Nginx with pagespeed (but disabled in site config), MariaDB, PHP5-FPM, FastCGI cache, Memcached, and Opcache. ee site create htpcbeginner.com --wpfc.

I found that with pagespeed the CPU usage was 5-6 times higher. That was a brief test and did not dig deeper.

pagespeed still included in nginx.conf. Should I exclude that?

SimpleHomelab avatar Apr 16 '15 19:04 SimpleHomelab

  1. Nginx, MySQL, PHP5-FPM, Memcached, and Opcache

Was it custom nginx config or generated by EE?

pagespeed still included in nginx.conf. Should I exclude that?

Ya. Please turn off pagespeed and test again.

rahul286 avatar Apr 16 '15 19:04 rahul286

Default EE site conf. OK. testing again with ps off.

I have the EE setup (2) active right now which I can give you access. If you want the other setup (1), I will have to flip the DNS (but I can provide shell access without flipping DNS).

If so, let me know how I can forward the details privately.

SimpleHomelab avatar Apr 16 '15 19:04 SimpleHomelab

Wow!!! Big difference with pagespeed completely off. Now EE results much better and I had to run it twice just to make sure.

new-2

With EE I had 34 more errors but the response times were much improved and stable. Not sure why pagespeed slows the site down so much.

https://www.blitz.io/report/671aa8181fe71068232f458e2f6cb3bb

SimpleHomelab avatar Apr 16 '15 20:04 SimpleHomelab

I just verified an EE site and it works nice!

Before pagespeed update - https://www.blitz.io/report/671aa8181fe71068232f458e2f04567c

I will be running same test with pagespeed soon.

rahul286 avatar Apr 16 '15 20:04 rahul286

Yours is even better. How do you have such low response times, is it because rtcamp.cloudapp.net is a blank WP site? Curious to know your test with PS on Ragul. @rahul286

And why does pagespeed slow the site down - opposite of what it is expected to do.

SimpleHomelab avatar Apr 16 '15 20:04 SimpleHomelab

I think it would depend on what pagespeed is doing. I will test with pagespeed off. I know I am probably asking it to do too much. It has to parse all the output before sending it to the browser, but thought that if the content was cached, the time getting the file to PS would be minimal, or PS could cache that output, so it's not crunching each and every time.

cm896 avatar Apr 16 '15 20:04 cm896

Blank site should not matter as once a page is cached, it matter of nginx reading a static file from fastcgi-cache which is stored in memory (tmpfs) in EE.

Lower response time could be because of location of server may be closer to blitz test server.

rahul286 avatar Apr 16 '15 20:04 rahul286

I also faced similar error rate with pagespeed - https://www.blitz.io/report/671aa8181fe71068232f458e2f4b10bc

I will try to check pagespeed config.

By default when ee enables pagepseed, it only enable support. One need to play with pagespeed filters and this part cannot be automated as it depends on site's markup.

rahul286 avatar Apr 16 '15 20:04 rahul286

@cm896 @rahul286 Thanks for spending time on this.

SimpleHomelab avatar Apr 16 '15 20:04 SimpleHomelab

I just remembered a discussion from rtcamp forum - http://community.rtcamp.com/t/fastcgi-cache-related-questions/2076/2

I will check https://groups.google.com/forum/#!msg/ngx-pagespeed-discuss/vzSq8XQPGmM/9mE11D-9U8YJ in morning.

rahul286 avatar Apr 16 '15 20:04 rahul286

Meanwhile, if anyone finds anything concrete in thread https://groups.google.com/forum/#!msg/ngx-pagespeed-discuss/vzSq8XQPGmM/9mE11D-9U8YJ or anywhere else on the web, please let us know.

rahul286 avatar Apr 16 '15 20:04 rahul286

@htpcBeginner Thanks for sharing your information, the insight into the added overhead PS is adding to the average response time will help me debug and I will test with it disabled, even though the client loves the boost to the page rank score shown.

All the credit goes to @rahul286. I am only a bystander, trying to read, learn and improve. I am using the debug slides/suggestion from @rahul286 to find my client's site speed issues. Thanks @rahul286 for all the great work and suggestions, it's appreciated.

cm896 avatar Apr 16 '15 20:04 cm896

@rahul286 One last question. EE by default sets worker_rlimit_nofile to 100000. Should this be customized based on hardware?

I also have worker_processes to 2 (2 core VPS) instead of EE's auto and worker_connections to 2048 instead of EE's default 4096.

SimpleHomelab avatar Apr 16 '15 20:04 SimpleHomelab

Because of the above results, I will be moving to EE. Next up is removing W3TC and settling on object cache solution with either memcached or redis.

SimpleHomelab avatar Apr 16 '15 20:04 SimpleHomelab

I guess this thread has answer - https://developers.google.com/speed/pagespeed/module/downstream-caching. I will try to test this tomorrow. But if anyone tries and gets it working, please share config/results.

EE's copy of nginx already has ngx_cache_purge purge module compiled in it so that step can be skipped.

About other questions:

I also have worker_processes to 2 (2 core VPS) instead of EE's auto and worker_connections to 2048 instead of EE's default 4096.

Auto always means equal to number of cores, which is recommended. In your case, it would have been 2 only with auto.

EE by default sets worker_rlimit_nofile to 100000. Should this be customized based on hardware?

Ya. I do not have formula for it but I prefer to set higher limits. My idea is to not let a server hit its own limit before OS limits. But again, I set it randomly and it worked. Before that my load tests were failing quite early.

Next up is removing W3TC

We also want to remove W3TC and hence added support for pagespeed. If pagespeed works nicely, we can use it for minify and CDN.

I loved W3TC in early days but it seems bloated now. So I also want to remove it from my servers asap.

rahul286 avatar Apr 16 '15 20:04 rahul286