-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Multisite installation, default website slow (X-Magento-Vary) #15828
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
Comments
I have the same issue, and if I flip what site should be the default the secondary site is slow. So It's nothing with the website. |
@oefterdal This is exactly what happens here too. And it's holding back the launch of our second website. |
Are you using Varnish or the Built-in Full page cache? |
@phoenix128 The built in FPC. We do this because of the multiple servers / load balancing setup. FPC with Redis can share cache between servers. Having one Varnish per server would cause different caches to show when reloading the page. We can probably set up a separate Varnish server that all the servers communicate with, but it's a bit of a hassle and i doubt it would do anything with the x-magento-vary problem. As a side note, we already experienced having different caches on every page reload using a shared Redis server. I digged in to the code and found the cache key prefix to be the issue.
|
Thank you @Flowlance , I am investigating on it trying to reproduce the issue. |
@Flowlance , Actually it is quite weird that you see Are you sure your settings are correct and you configured Magento to use the built-in cache from I am asking you because I was not able to reproduce it in any way. |
@phoenix128 thanks for your reply. I also find it weird that this cookie is being set. See the attached screenshot of our current cache configuration: We have set specific url's per store. Also note in my nginx config we have this:
Unless it matches one of those two url's, it defaults to the base website. As a side note, it also happens in our development environment. Is there anything else I can provide you with to help you reproduce the issue? |
Thank you @Flowlance , |
We have the same issue with Magento 2.2.4 with two store views. Tested on Ubuntu18.04 and Is there any solution? Best regards |
Not yet, till now I was unable to reproduce it. I am setting up a new clean environment to give another chance. |
@phoenix128 Hello, we have also the same problem.
2.1. clear the browsing data of the web browser, open page A, it is slow 3.1. clear the browsing data of the web browser, open page A, it is slow 4.1. clear the browsing data of the web browser, open page B, it is slow 5.1. using PageSpeed Insights (or Pingdom) to test the speed of page A and page B, all these 2 pages get a very bad score In my opinion, Magento cache system is not returning page from cache if the page is a non-default store view page. But this problem occurs only during the first page open after clearing the browsing data (see point 3.1 - 4.2). It is not a big problem for the customers, because of only the first visit is slow, if the pages are cached (see point 3.1 - 4.2). But it is a big problem for SEO(see point 5.1) |
@Hansmueller88 , |
@phoenix128 HTTP/1.1 200 OK If it has "X-Magento-Vary", then it is very slow while the first visit one page of the non-default store view after cleared the browsing data. The speed of the other pages of this store view will be OK after opened one page(whatever which page is) Actually, we have fixed this issue if the default currency of the non-default store view is the base currency(still need more time to confirm it). we have fixed this issue if:
but It still has this problem if: If you want, I can give you the SSH and Magento Admin of our test website to test it. |
I can confirm that. It is especially nasty if the backend web server has a different cache prefix than the frontend web servers, and cache invalidation from backend does not work. A solution on Magento side would be to automatically set id_prefix when installing Magento, so that it does not change anymore and is the same for all web servers. |
I am experiencing the same issue - the time to first byte is almost 1500 ms slower on the non-default site. I have opened a case with magento, as we have the EE version, but the issue has not been resolved yet. Does anyone know exactly where in the code magento issues the x-magento-vary cookie? |
Hi @Flowlance. Thank you for your report.
The fix will be available with the upcoming 2.3.1 release. |
Same problem on magento 2.2.5 when fpc is activated some pages have 1 tot 1.5 seconds to first byte. |
Magento has a patch, but it broke PayPal. We had to patch their patch.
… On Nov 29, 2018, at 9:09 AM, bobmats ***@***.***> wrote:
Same problem on magento 2.2.5 when fpc is activated some pages have 1 tot 1.5 seconds to first byte.
How can this be solved
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@carylewis where can I find the patch and patch to fix the patch ? |
Have done some further testing magento 2.2.5 CE with FPC on. |
What I found so far is only the domain used during installation gets the PHPSESSID cookie set. So far I have been unable to find a fix for this, if there is any fix. I read som e links in this thread but as far as I understand this is for a new installation ? and only in magento 2.3 or 2.3.1 Is there any fix for this in 2.2.5 o5 2.2.6/2.27 |
The fix has to do with the store id not being set correctly, and therefore magento can’t use the cache.
… On Dec 3, 2018, at 7:48 AM, bobmats ***@***.***> wrote:
What I found so far is only the domain used during installation gets the PHPSESSID cookie set.
All other domains within this installation get the X-Magento-Vary which causes an extra delay between 1.2 and 1.5 seconds.
So far I have been unable to find a fix for this, if there is any fix. I read som e links in this thread but as far as I understand this is for a new installation ? and only in magento 2.3 or 2.3.1
Is there any fix for this in 2.2.5 o5 2.2.6/2.27
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Ok, question still remains how this can be fixed. Know you were on EE I am on CE. Have not been able to find something. |
Found this in 2.2.6 update: Pagecache
so i hope update to 2.2.6/2.2.7 will resolve this |
update to 2.2.7 did not resolve the problem. Even when fpc is turned of there is a problem. when pfc on also x-magento-cach show miss in combination with x-magento-vacy This drives me crazy and no idea where to find the solution. |
Facing the same issue in a multi-store setup 2.2.7, X-Magento-Cache-Debug shows MISS when the non-default store is opened in a new browser. Is there any patch to make it work on 2.2.7 or someone refer the related commit of the issue fixed in 2.3.1? Tried adding changes from below commits but still not working |
Hi @Flowlance. Thank you for your report. The fix will be available with the upcoming 2.2.9 release. |
We are seeing this exact same issue on a 2.3.5p2 EE installation. Non default web sites appear to not be using the FPC. |
As this issue still occurs with 2.4.4-p3, I hotfixed this with this code in pub/index.php
|
Uh oh!
There was an error while loading. Please reload this page.
Hi. We have a multisite installation. The default website is fast, but the non-default website is really slow. When we switch the default website to the slow one, that ones becomes fast. What I've found out so far is that the slow site always get a cookie named X-Magento-Vary, while the fast one get a PHPSESSID cookie.
Preconditions
Ubuntu 16.04
PHP 7.1.16
Aurora MySQL 5.6.10a (Aws RDS)
Magento 2.2.2
Nginx 1.14.0
Running on multiple AWS instances in OpsWorks with continuous integration (Jenkins).
Media folder is shared on EFS.
Steps to reproduce
The website codes are "base" and "exampleone". In the tests below we have "exampleone" set as the default website.
Nginx configs:
Relevant part of /srv/www/production/current/nginx.conf:
Just by visiting the website, we can clearly tell that one website is much slower than the other one. TTFB is really high (8+ seconds).
By CURL'ing the websites, we can see the X-Magento-Vary and PHPSESSID cookies
curl -I https://www.example1.com/
curl -I https://www.example2.com/
Expected result
Both websites should be fast. I'm not sure what X-Magento-Vary does, but every time the website is slow, this cookie is set. I was thinking it could be related to user specific caches, but we are testing on the index page as a non-logged in user so the same content should be delivered every time.
Actual result
Non-default website is slow.
As a note, magento does set the correct website and everything works, it's just slow.
The text was updated successfully, but these errors were encountered: