-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Poor loading times on "first called pages" #2731
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
Could you please enable the magento log and share it with us ... |
Hi, Chris. Thank you for your question. In general issue or mis-configuration can be easily identified by response time:
Please check that after deploying of static content you set correct mode MAGE_MODE production in your htaccess file (for apache) or nginx.conf (for nginx) as well as check permissions for pub directory (as deployed files can be just unavailable) as well as for var directory (so you are sure cache files are available) |
Thank you both for your replies. @ahmadhattab Which log may I share with you. I know there are different log files in the var/log folder. In my .htaccess file SetEnv MAGE_MODE xyz is commented out. php bin/magento deploy:mode:show returns Current application mode: production I have set the pub and var directory world readable for debugging this issue, but the problem stills exists. By the way (might be important): Why does setting "Workflow type" (which is "Not available in production mode") to "Client Side less compilation" writing 'rel="stylesheet/less"' and the script tag for less.min.js and its config file into magentos source code? Workflow type is not available in production mode, so this should not happen. Of course setting it to "Server Side less compilation" removes those, but in production mode, this option should do absolutely nothing. This might be an indicator for something being wrong with the production mode. Thank you all in advance. |
I believe there is a mix of developer workflow tools and attempts to switch everything to production mode. In order to switch M2 into most performant mode (also called "production", but not limited just by setting environment variable in htaccess or nginx.conf file) next steps should be done:
Set $MAGE_MODE production (nginx)
Please try this flow on your Magento instance, it should help. |
Thank you for your advice. That steps are important for setting M2 into production mode. I already ran those commands successfully. It did not help. I still see following in my source code, which I believe is a part of the problem: <link rel="stylesheet/less" type="text/css" media="all" href="http://magento/pub/static/version1450286045/frontend/Magento/luma/de_DE/mage/calendar.css" />
<link rel="stylesheet/less" type="text/css" media="all" href="http://magento/pub/static/version1450286045/frontend/Magento/luma/de_DE/css/styles-m.css" />
<link rel="stylesheet/less" type="text/css" media="screen and (min-width: 768px)" href="http://magento/pub/static/version1450286045/frontend/Magento/luma/de_DE/css/styles-l.css" />
<link rel="stylesheet/less" type="text/css" media="print" href="http://magento/pub/static/version1450286045/frontend/Magento/luma/de_DE/css/print.css" />
<link rel="icon" type="image/x-icon" href="http://magento/pub/static/version1450286045/frontend/Magento/luma/de_DE/Magento_Theme/favicon.ico" />
<link rel="shortcut icon" type="image/x-icon" href="http://magento/pub/static/version1450286045/frontend/Magento/luma/de_DE/Magento_Theme/favicon.ico" />
<script src="http://magento/pub/static/version1450286045/frontend/Magento/luma/de_DE/less/config.less.js"></script>
<script src="http://magento/pub/static/version1450286045/frontend/Magento/luma/de_DE/less/less.min.js"></script> So, when I see those less entries, there still has to be a problem with the production mode. |
Hi,
|
Hi, after all that work, still clicking some pages the first time, the CPU usage of apache goes up to 98.2 percent. I have tested it on several instances and the problem occurs on all of them. The servers are t2.large instances on amazon ec2, so they are powerful enough to perform magento 2. Edit: The Magento user is shop, and the web server group is apache. Some folders are created as apache:apache drwxrwx--- 3 apache apache 4096 29. Dez 21:46 frontend The other ones are as follows: Is this correct? #groups shop #groups apache |
Hi there, I have the similar problem. I'm trying to create new theme. But every time I reload the home page it is going to high CPU loading. My Settings: Activity monitor: Chrome console: And only after Chrome console: Do I need to deploy static content every time I change some css style if I develop new theme? Thanks! |
Hello All, I have same issues ,and finding solution since last few days but not getting what's an issues. @ci2014 you find solution let me know . I had tried all possible solution as give by above. Thanks ! |
I'm closing this issue as GitHub issue tracker is intended for technical issues only. Please refer to the Community Forums or the Magento Stack Exchange site for technical questions. |
### Stories * [MAGETWO-91869](https://jira.corp.magento.com/browse/MAGETWO-91869) [Indexer optimizations][Base Implementation] Tables sharding / segmentation for price indexer * [MAGETWO-64467](https://jira.corp.magento.com/browse/MAGETWO-64467) [Indexer optimizations] Tables sharding / segmentation for price indexer
Hello everyone,
I am experiencing poor loading times, usually 1-3 seconds, but also up to 25 seconds, with my magento 2 instance, when a page was not called before.
When i watch 'top', I can see, that the process is going up to 99 percent of CPU usage and shrinks down, when the page itself is loaded.
This seems to be a problem with the cache, because pages, which were called before, load immediately. I don't know about the possibilities to warm up the cache on CLI. I already used setup:static-content-deploy successfully.
The user rights are well configured.
I need to mention, that I don't use varnish. APCu and memcached are installed. I am using the latest Plesk Server, CentOS 6 and PHP 5.6.16.
I also don't want the shop to process the less files every time. Magento is in production mode and server-side less compilation is enabled. Please ignore this, if this is correct.
Thank you in advance.
Kind regards
Chris
The text was updated successfully, but these errors were encountered: