ProjectNami / projectnami

WordPress powered by Microsoft SQL Server
http://projectnami.org
Other
270 stars 137 forks source link

4 Seconds TTFB #115

Closed ghost closed 8 years ago

ghost commented 8 years ago

Dear Project Nami Team

We have implemented Project Nami 1.3.4 on Azure (region Europe-West) to host our companies internet presence. Things are running pretty well, but we have only one performance issue:

Everytime a user is connecting to a site generated by WP, it tooks approx. 3 to 5 seconds until the first byte is delivered.

image

And we have upsolutely no clue, why this happens.

A few specs about our nami environment:

Of course the cloud app is...

The URL of our website is https://bskies.io

Who can help us analysing an fixing this performance problem?

Kind regards,

Kim.

patrickebates commented 8 years ago

You appear to have everything covered, and then some. There's only two things I can think of at the moment.

1) PHP 7, once the Web Apps team deploys the new SQL drivers for it. That driver was formally released two weeks ago, so I expect it to become available at their next milestone.

2) I highly recommend that you look at our Blob Cache system. http://projectnami.org/blob-cache/ You will need to make use of the Web Jobs included in the package to achieve the best results. Let us know what you think about the concept with a reply here, and we can provide you with optimized config settings.

ghost commented 8 years ago

Dear Patrick

Thanks a lot for your feedback. ;-)

1) Sure, as soon as we can use PHP7 we would use it.

2) I've tested a lot with the Nami Blob Cache Plugin and my tests started quite satisfying. But after addding a couple of plugins to WP I have learned, that lots of plugins are lousy implemented and so didn't work with media files hostes on Blob Cache. And in addition we have implemented a CDN upfront our infra, so I didn't saw a big benefit in using the Blob Cache in addition.

My current cutfeeling is, that our URL rewrites (web.config) are not ideal configured. But I a whireshark trace of the http/https traffic I cannot see any indicator for a missconfiguration.

It's so frustrating, the infra works like a charme. Only the 3 to 5 seconds TTFB are driving me crazy...

Kim.

patrickebates commented 8 years ago

Are you indicating that the 3 to 5 second TTFB was occurring with Blob Cache as well?

And could you provide example of plugins you found to have issues with Blob Cache? We have worked with several sites using Yoast SEO and Jetpack (just to name two that you mentioned), and not experienced any issues there.

As for CDN, we use Azure Blob Storage plugin but not the full CDN. But I understand their server selection is handled at the DNS level, so I'm unclear how the CDN could be impacted by Blob Cache.

Finally, have you seen this site we recently added as an example to our Blob Cache page? Your site should be able to respond similarly. http://easyhealthoptions.com/

patrickebates commented 8 years ago

Also, you mentioned your use of Redis Cache. Are you using Predis or similar to connect to the cache, or are you using Memcache and the Memcache Shim option available in Web Apps?

ghost commented 8 years ago

We are using "Azure Redis Cache" (Basic 250 MB) and the WP Plugin "Redis Object Cache" (from Tim Krüsse)

image

ghost commented 8 years ago

The plugins, that didn't work with Nami Blob Cache were (as far as i can remember):

To be more specific: Slider Revolution did work, as long as we used another plugin for rewriting the URLs. We had tons of mixed content issues, because Slider Revolution used absolute path and not relative ones. After a few hours of tweaking and troubleshooting I decided to simply the setup by using the CDN.

Cheerio and thank your very much for your kindness to help!

patrickebates commented 8 years ago

That plugin uses the Predis libraries, or at least it did the last time I looked into it. Didn't work well for me when I attempted to use it in production. Went the Memcache and Shim route instead, but recently abandoned the cache altogether, even for the largest site I know of currently using PN. Blob Cache was able to

How is the DTU usage on your S0 DB?

ghost commented 8 years ago

For DTUs:

image

Well ok, I will give the Blob Cache another try. Hopefully this weekend I will find the time to implemented it. Thanks for all your thoughts and help!!!

awaycott commented 7 years ago

@katmai149 did you ever figure out what was causing your TTFB issue? I am experiencing the same issue.

ghost commented 7 years ago

Nope. I was too frustrated and moved over to a Docker/Kubernetes-based Hosting on Azure. Now I am doing pretty fine with performance and so. Sorry, that I cannot help.

Von: awaycott [mailto:notifications@github.com] Gesendet: Montag, 24. April 2017 19:57 An: ProjectNami/projectnami projectnami@noreply.github.com Cc: Kim Nis Neuhauss kneuhauss@bright-skies.de; Mention mention@noreply.github.com Betreff: Re: [ProjectNami/projectnami] 4 Seconds TTFB (#115)

@katmai149https://github.com/katmai149 did you ever figure out what was causing your TTFB issue? I am experiencing the same issue.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/ProjectNami/projectnami/issues/115#issuecomment-296770414, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ATo5S28-nr6mmnOVWGyPQ00olwOsKm0tks5rzOJigaJpZM4JSg86.

awaycott commented 7 years ago

So, I think I figured this out. I changed the SQL server setting from the fully qualified domain name to the IP address of the sql server. This eliminated the TTFB. I'm not excited about the solution, but it made a clear difference. @patrickebates does that make any sense at all?

patrickebates commented 7 years ago

None, unless it's a DNS lookup issue. For the record, you do have Always On enable for your web app same as in the OP?

I would be careful relying on the IP Address. If the SQL DB experiences a failover, I wouldn't be surprised if the IP changes.

awaycott commented 7 years ago

Yeah, that's why I'm not excited by the solution!

Everything is in the same OP, Always On is enabled and ARR is turned off. Nothing seemed to help till I changed to an IP address and then suddenly about a 3 to 5 second drop in TTFB. I have the Blob Cache installed also and that didn't help either.

Anyway, I highly doubt its a PN issue, unless there is a more efficient way to open the DB connection, which I doubt.

patrickebates commented 7 years ago

If you're experiencing it even with a Blob Cache hit, then it's neither SQL nor DNS. During a cache hit, PHP is never even started.

I'll reference a site I mentioned further up in the thread again. With Blob Cache and Always On (and the Cache Loader web job for good measure), you should be seeing performance like this... http://easyhealthoptions.com/