magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.56k stars 9.32k forks source link

Why is Less_Parser::getCss() still happening in production mode Magento 2 #10386

Closed cristianmalfesi closed 7 years ago

cristianmalfesi commented 7 years ago

With New Relic service we have detected several calls where Less code is processed generating slow processing. We have checked that work with CSS. If we delete CSS from theme, then magento show error at frontend call of CSS file. So, is not generating css from less files automatically. But we see All these Less executions the make site slow on this part. Can you help me to understand if something is [wrong?]

Preconditions

Magento version 2.1.3 Mode: Production

Steps to reproduce

Using Magento frontend site, browse different pages, category product listing, category page, etc etc

Expected result

Performance of server sometimes is slow.

Actual result

With New Relic service we have detected several calls where Less code is processed generating delays See the attached picture: magento2_performance_less

korostii commented 7 years ago

Wow, LESS processing in production. That can't be good.

There seems to be some 3rd-party code with \Manadev namespace being executed along on your screenshot. Are you sure the issue isn't related or caused by those 3rd-party modules? Meaning, have you tried to reproduce the issue with those modules off or on a clean instance?

franckgarnier21 commented 7 years ago

Any news ? I have the same problem

franckgarnier21 commented 7 years ago

For your information, I faced the same issue.

This is due on the merge/minification process. Indeed even in production mode, the merge is done on the fly depending on the css needed for the specific layout handle.

In my case, 3rd party extension (MageDelight partial payment) has bug in the custom css declaration. Then the merged min.css was never saved in the disk, and so Magento try to rebuild this on every request.

Hope it will help somebody.

siliconalchemy commented 7 years ago

I had the same problem, which took days to track down because Magento doesn't log the problem anywhere. In my case it was because I am using a two-user solution (ie a different OS user for files, cron etc than the webserver user), and the permissions in the pub/ directory somewhere weren't open enough. Changing files to 664 and directories to 775 fixed the problem.

magento-engcom-team commented 7 years ago

Closing per comments above, as problem seems to be fixed. Thank you for collaboration.