I have installed Magento-2.2.3 in windows personal computer and after the installation it loaded first time well but after that it is not responding since an hour. Actually, I am new to Magento and anybody can tell about this problem?
Follow the below points this may help you.
enable all cache may help you. Full page cache .
MySQL 5.6 has some memory issues where a defaul config will use
about 500mb of ram, to fix set performance_schema = off in your
my.cnf and restart MySQL. Also make sure you have opcache turned on
and set to at least 64mb of ram and 10000 files cached, preferable
128mb. If you tune your config you can run on a 512mb vps but it's
tricky and you won't have enough ram for fpc on varnish and reddis
sessions. 1 gb vps with the above MySQL fix should work like a champ
out of the box on a vps.
There are lots of potential reasons why, but the most common is
around file system performance. In non-production mode especially,
we hit the disk pretty hard (lots of different files). E.g. in
developer mode we generate files on the fly (CSS etc). But without
more details (PHP version? using Vagrant? VM? Docker? OS? Memory? is
machine thrashing? etc), it is pretty hard to suggest something. Its
certainly not taking any where near that long on my laptop. Can you
provide any information about your setup? (But my first
investigation would be around I/O performance - for example using
Docker/VirtualBox with file syncing back to Windows is a dog -
because the file syncing is very slow.)
Recently I started developing magento 2 projects.
First I tried on Windows with xampp and it was a mess... every refresh page was a nightmare, about 30-40sec to load the page. I read about it, that Windows system files is so slow working with magento because the large structure it has, and the article almmost was forcing you to use linux for developing on magento projects.
The problem is I need Windows for another company apps that only works on Windows, I tried to install a virtual machine with Virtualbox, it improved a bit... but the fact I'm working on a virtual machine pissed me off...
The next solution and I'm working currently, is using vagrant. Okay, I feel good developing on this way but it keeps going slow... 15-20s...
My config on Vagrant is 5120MB (pc has 8GB) and use all my pc 4 cores.
I'm feeling so bad working like this... when I was working on my previous projects, with symfony/Laravel/Codeigniter, was like:
write some lines of code, tab to browser, F5, INSTANTLY see changes.
On M2: write some lines of code, tab to browser, F5, wait... wait... okay now it refreshes the page, but it's not loaded, wait... wait... hmmm almost... okay. No changes but I cleaned the cache... ohhh I guess I had to remove static files too. Go for it... wait again...
God... There's no way M2 goes faster? I'm only asking 5s or something like that... it's just I'm feeling so dumb looking the screen waiting all the time...
For aclarations, I'm only asking for development mode, I tried had to install another project of magento on production mode for testing things faster and then it's okay fluid as hell compared with developer mode... because... omg... just try to do an order workflow again and again...
Well that's all... The only thing I didn't try is using Linux environment on the computer... but it's just the same as using vagrant... I don't understand... how are you developing M2 developers? in special frontend developers... I don't believe they are working the same way as me... waiting 20sec for loading the pages + cleaning cache + removing static files, etc.
Details: I tried everything with vagrant but don't improve, I'm currently on Ubuntu 15.04, Apache 2.4, PHP 5.6 (I tried 7 but still the same) mysql 5.6
This is the network tab:
http://i.imgur.com/HG7mbeX.png
2018 Update, Magento 2.2.4
Vagrant + Windows + Magento2 = disaster. Vagrant + Apple + Magento2 = disaster.
Ubuntu + Magento2 = cooking on gas.
Simple modules, e.g. a widget, take many days more than the expected 2-3 hours and it is not possible to remember what you are doing if it takes a minute to open a page, particularly so if you have to clear caches, compile, upgrade or anything else that should take no-time-at-all.
This I have experienced first hand, from working in an office where the options are Mac or Windows. After spending a whole day trying to change the template directive and failing to make one configuration change in 8 hours, I thought about giving it a go on a linux box to see if I had gone mad or if this Vagrant contrivance is as helpful as that drunken bum sleeping rough in the park down the road.
The aged linux box with anaemic RAM, an old SSD, stock Apache and no fancy cache things completed the task without problem, I was able to switch between developer and production modes effortlessly and get what had taken me days to not do done in minutes.
The work machine was 8th generation i7, the Vagrant setup was very much someone's baby and a lot of time had been spent building the beast. Yet tectonic plates move faster. Vagrant and virtualisation might be fashionable but it is no use for M2 development. In fact I installed M2 and did all the db and vhost setup for it in less time than it takes for a Vagrant box to build.
As for performance, since M2 on a basic linux setup is 10x faster than some clumsy Vagrant effort, it is easy to see where the real speed problems of Magento 2 are. If you fire up Lighthouse in Chrome you will see TTFB is absolutely fine but the performance halves if you minify and merge the JS + CSS. This is because M2 has a megabyte of scripts to download. This is the performance killer. If you are working on a Vagrant box then you will never see this and not have the speed to fix it. By fix it I mean write a proper theme that doesn't have nonsense such as jQuery loading on every page.
For production you need something that scales so you can get the normal speed enhancements going for that, e.g. Redis, opcode caching, Varnish, tweaked php-fpm, tweaked MySQL/MariaDB. If you are developing on Linux then you can test these things on localhost knowing they will work fine on production. With that abomination that is Vagrant you will be dabbling with these optimisations prematurely because you are hoping and praying for a performant machine because you need to get work done. However, in so doing, and with the absence of native speed, you will not get anything done.
If you don't have a spare machine to put linux on then just go to the local tip, get any PC, shove an SSD in it and you are good to go.
This is my recipe for developing themes/modules in localhost for Magento 2.2 and 2.3:
MacBook Pro
Valet Plus (Nginx, MySQL 5.7, PHP7.1 and 7.2 - you can easily switch between PHP versions with valet use 7.1 or valet use 7.2) https://github.com/weprovide/valet-plus
memory_limit set to 4G
Be sure Magento is set to developer mode: php bin/magento deploy:mode:set developer
ALL CACHES ENABLED except FPC. Whenever I need to test a change involving config files, etc I manually delete the content of the var/cache folder or the generated/code folder for DI changes. The cache type that specially slows down everything is the Configuration cache, so it must be enabled or the frontend/backend pages will load painfully slow.
I use Grunt Watch and the Livereload Chrome extension to see my changes to .less files without having to deploy static files with every change. https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/css-topics/css_debug.html
Whenever I change a JS file I navigate to pub/static/[adminhtml/frontend]/[theme]/[locale]/ and delete ONLY the folder where the static file corresponding to the JS file I changed lives in. This prevents me from having to deploy ALL the static files. Magento will regenerate just the static files for the deleted folder saving a LOT of time (be sure to do a hard refresh in your browser every time you delete a static file)
It’s still not a perfect setup but it’s the fastest way I’ve found so far to be productive without pulling my hair out.
I tried everything and the only thing it works is the virtual machine that provides bitnami. https://bitnami.com/stack/magento/virtual-machine
Seriously, I don't know what has this vm, but goes really fast. I tried creating my VM using a fresh installation of Ubuntu, CentOS, etc. But doesn't work so fine like this VM.
If you work in developer mode you need to disable JS/CSS merge, disable xdebug and enable opcache. Feel free to run thes MySQL queries on your dev DB and flush cache. This will increate the site performance in developer mode.
UPDATE core_config_data SET value = '0' WHERE path = 'dev/css/merge_css_files';
UPDATE core_config_data SET value = '0' WHERE path = 'dev/css/minify_files';
UPDATE core_config_data SET value = '0' WHERE path = 'dev/js/merge_files';
UPDATE core_config_data SET value = '0' WHERE path = 'dev/js/minify_files';
UPDATE core_config_data SET value = '0' WHERE path = 'dev/js/enable_js_bundling';
UPDATE core_config_data SET value = '0' WHERE path = 'dev/static/sign';
Try to disable synchronisation with default vagrant sync folder (just comment config.vm.synced_folder in VagrantFile and reload) - it's to slow when need to work with a lot of files...
Also in developer mode will be useful to generate static files:
bin/magento setup:static-content:deploy and ensure that all caches are enabled: bin/magento cache:status
If it don't help you can try Magento DevBox tool based on Docker: http://devdocs.magento.com/guides/v2.1/install-gde/docker/docker-over.html
In "developer" mode, all caches were disabled.That why magento become slow.
I suggest to enable caches by execute command
./bin/magento cache:enable
However, you need to clean cache ./bin/magento cache:clean every time you modify xml files or configurations.
my recipe:
Use *nix as your main OS
Use docker with PHP 7 and Nginx
use gulp for generating css and js (faster than grunt)
use redis and varnish
disable only needed caches
And the most valuable advice - you really need SSD to work with magento2 if you still trying to develop on HDD
p/s Magento 2 more complicated than Symfony/Laravel/CI (M2 consist Symfony
by the way) and can't be so fast as pure frameworks
For production environment:
You must use Redis for handle Cache, Full Page Cache et Session
(http://devdocs.magento.com/guides/v2.0/config-guide/redis/config-redis.html)
You must use Varnish for HTTP cache built in with Magento
(http://devdocs.magento.com/guides/v2.1/config-guide/varnish/config-varnish.html)
You need to set up production Magento mode.
(http://devdocs.magento.com/guides/v2.1/config-guide/bootstrap/magento-modes.html)
You must use ElasticSearch for search engine, EE only
(http://devdocs.magento.com/guides/v2.1/config-guide/elasticsearch/es-overview.html)
You must use PHP 7
You may use MariaDB even if it is not supported by Magento 2.
You must use CSS minification and JS minification and JS bundling (which works only on production mode).
Check the official Magento 2 documentation in order to set up this production configuration.
A bit late here but i think the answer while working on vagrant / docker is mostly that the I/O of files is terribly slow.
My solution was simply do disable the whole shared folder and replace it with a remote project (sftp connection) in PhpStorm. All files are so stored within the virtual machine and don't have to be synced everytime the page needs a reload.
The main benefit of course is, that it is amazingly fast while working on developer mode.
But also there are some minor problems while working with this setup:
You can't run commands straight from your terminal. You have to ssh into your vagrant for running magento2 cli commands.
After running composer updates you may have to download the whole folder again, because in PhpStorm remote changes are not downloaded automatically.
I made this vagrant which allow you to customize mount options and has great performance:
nfs mount or regular mount
directory mount /var/www/magento/app or whole project /var/www/magento
https://github.com/zepgram/magento2-fast-vm
You can work on a fast magento installation and adapt parameters depending on your work practice and your host machine perf.
For example, if your host machine doesn't support NFS option and has bad performance you can mount only app directory which is enough for development.
#Henry's Cat is right. Non linux os + Magento2 = disaster.
If you are not working hard with xmls you can turn on magento cache
bin/magento cache:enable
and use bin/magento cache:clean when you modify something in theses files
or better just disable certain cache types bin/magento cache:disable db_ddl full_page . #Igor Sydorenko is absolutely right, disabling css js merging/minifiying will IMPROVE A LOT developer mode performance.
In order to give flexibility to developers, Magento generates a lot of files. If it runs in production mode, the slowest part is the disk read which can be optimized.
But while running Magento 2 in developer mode, disk read and write operations make it too slow.
I was also experiencing the same while developing Magento 2 applications. My first suggestion is to move to SSD. However, it is not possible for every everyone every time.
It was also not possible for me to install SSD in my high-end laptop with lot of RAM and CPU power.
I found a work around which made my development considerably fast in localhost using Redis cache. Cache cleaning and warming became extremely fast which reduced my waiting time drastically to see the changes. Here is the full article to use Redis cache in localhost with Magento 2.
Ok so i have been working with Magento 2.2.7 from approx 6-8 months . so there are some notes you should consider :
1. use SSD Hard Disk (if possible)
2. configure grunt in magento. it will surely help to make frontend devlopment in magento fast. because grunt helps to compile less file without need of executing s:s:d command.
grunt with magento
3. do not enable xdebug.
4. disable cache only if you are reloading page too many times in a row.
I tried many machines and many configuration like:
Windows 10 - vagrant machine debian
Windows 10 - vagrant machine debian - docker
Windows 10 - vagrant machine ubuntu - docker
Windows 10 - vagrant machine ubuntu
The problem of bitnami machine : not realy easy to be configured for Xdebug
In my experiance the Best one is a vagrant machine for those who want to work on Windows:
https://app.vagrantup.com/certiprosolutions
So use this config on your Vagrant file:
config.vm.box = "certiprosolutions/ubuntu-lnmp"
config.vm.box_check_update = false
# box modifications, including memory limits and box name.
config.vm.provider "virtualbox" do |vb|
vb.name = "Magento 2.3.3 ubuntu ngnix"
vb.memory = 8240
vb.cpus = 2
#vb.customize [ "modifyvm", :id, "--uartmode1", "disconnected" ]
end
The advantages:
you can switch between many configuration of PHP
(5.6,7.0,7.1,7.2,7.3)
work on many version of Magento in the same environment
A little note. to make xdebug work you should change the configuration of xdebug to that:
[XDEBUG]
zend_extension=xdebug.so
xdebug.default_enable = 1
xdebug.remote_enable = 1
xdebug.remote_connect_back = 1
xdebug.remote_autostart = true
xdebug.remote_handler = dbgp
xdebug.remote_port = 9001
xdebug.remote_host=127.0.0.1
xdebug.remote_log="/tmp/xdebug72.log"
;xdebug.max_nesting_level = 1000
I use XAMPP on windows 7, with Visual Studio and XDebug.
But in 2 years not solved the big problem, and now im very frustrated.
Localhost Wordpress websites in my localhost xampp server are very too slow.
Load a page take 3-4 seconds with XDebug enabled, 1-2 seconds if disabled.
This is incredible for many reasons like:
1) My PC is super fast: 2xSSD, 16GB RAM, 8CORE CPU, but XAMPP not use my power and stay slow.
2) When website is live on a shared hosting of 80$/years, it is more fast.
With this situation performance seem not related to PC power, so I think if i have for example 128GB RAM, 10xSSD in RAID and more, performance stay same. But how can be this possible?
I already tried all solutions found on web:
1) Enabled PHP accellerator (not change nothing)
2) Enable / disable lots of php.ini options
3) Encrease php memory limit
4) Change host file of windows.
Nothing improve performance. I not think i will found a solution, but if there is someone that can explain me why hardware can not improve performance is almost a useful info :)
Thank you!
I found a partial solution, disable xdebug and enable it only when required:
Open php.int from XAMPP > Apache > config > php.int
Move these line to top: zend_extension =
"C:\xampp\php\ext\php_xdebug-2.2.6-5.5-vc11.dll" (or your path)
Disable it most of time with char ; and when I need the debug I
uncomment it and restart apache
i want to use apc as cli with opcode cache feature.
using apc.enable_cli to true. but noting happened in benchmark time and memory usage.
; php.ini
apc.enable_cli = 1
but in web based usage different. i see how work apc and do magic for running php scripts.
about half memory usage also about 0.01 faster than normal run php script.
but i think php dont use opcode cache during using apc in cli. how can i use it. is it possible?
I wouldn't expect apc to give any improvement in performance on the command line, because the apc cache is going to be dropped every run.
This is an issue I've been having for a long time. I want to run PHP applications on my windows computer and it has a terribly high load time, around 10-25 seconds. I have tried many things:
First I tried a simple XAMPP installation
I read WAMP might be faster, so I tried WAMP, too. It gave me the same results
Then I installed an nginx server with PHP, but it did not help either
Finally, I installed an Ubuntu 11.10 in VirtualBox and I shared my windows files containing my project, but the result was even worse: over 22 second load time each time.
UPDATE: I have even tried APC - it improved a bit but still 6-8 sec/page
I uploaded my files to a linux server(shared hosting), on which it runs in around 300-500 ms. On the XAMPP installation I tried to run other (i.e. not Symfony2) applications as well(e.g. phpmyadmin), which too were slower than on the shared hosting, but not extremely slow, with 2-3 sec load time. Until I change to Linux as the main OS, how could I improve performance? I have a laptop with i7 CPU, 4 GB RAM, 5400RPM HDD, Win7 x64.
Thank you for your help!
UPDATE2: For some mysterious reason my Symfony routing didn't work with fcgid (it gave me a 404 error for everything) so I went back for using PHP as a module. Now, it has become the worst ever (worse than it used to be as a module): app mode 20-25 sec, and in dev mode, over 30s every time, so I get a timeout error, and it's the same with or without APC enabled.
Here you can see this error. This is reproduceable: each time it reaches a different point of execution within 30s:
Update:
Since PHP 5.5 has now integrated the PHP OPCache, this speeds up the execution time. In my setup a full request with database access takes 180ms now.
Steps:
Update to the latest php version
Enable OPCache
Disable xdebug
Set realpath_cache_size = 2M as DemonTPx mentioned
php.ini settings:
realpath_cache_size = 2M
[XDebug]
xdebug.profiler_enable = 0
xdebug.remote_enable = 0
[opcache]
zend_extension = "C:\xampp18\php\ext\php_opcache.dll"
opcache.enable = 1
opcache.enable_cli = 0
opcache.memory_consumption = 128
opcache.interned_strings_buffer = 8
opcache.max_accelerated_files = 4000
Why is Windows slower than Unix?
As discussed here, PHP is very slow in file_exists, and filemtime() on Windows. since Symfony2 is using these functions in dev mode a lot. we won't get under 700ms (in <= 5.4) on Windows. PHP 5.5 allows now 180ms.
A solution could be WinCache which was developed by microsoft to solve this problem on IIS. But as it only works on several Windows versions and also only with IIS it's no solution for me.
Alternative
Also a nice solution I can recommend is to have a Linux Virtual Machine on Virtualbox. This is easy to setup and is also more like the production environment.
I have the exact same problem. Setting the following in php.ini increased the performance for me from ~800ms to ~300ms:
php.ini:
realpath_cache_size = 2M
Still not the ~100ms I get from a unix machine, but it makes a difference at least
I had a similar problem with symfony 1 for a time on XP and Server 2003. The solution was to install a PHP accelerator (eAccelerator for us, APC might be a better bet these days) plus FastCGI/fcgid.
Addendum: it's been ages since I've used Apache on Windows. I have generally been of the view that its performance has been getting steadily better, rather than worse; however as with most unusual set-ups, good results are not guaranteed. As per my earlier comment, I recommend asking your question at Apache Lounge, where I previously have received some great expert advice.
If memory serves correctly, they can offer you a free Apache binary compiled with better tools than the standard one offered on the Apache website.
Wow, After trying many different things, I've finally succeeded to move from a 15s execution time to a 3s exec time on windows7 with wamp.
How to install wincache extension :
http://us2.php.net/manual/en/wincache.installation.php
Where to download the wincache dll:
http://sourceforge.net/projects/wincache/
My php.ini config change:
[PHP]
realpath_cache_size = 2M
extension=php_wincache.dll
; XDEBUG Extension
;zend_extension = "C:/Net Generation/wamp/bin/php/php5.5.12/zend_ext/php_xdebug-2.2.5-5.5-vc11.dll"
;
[xdebug]
xdebug.remote_enable = off
xdebug.profiler_enable = Off
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "C:/Net Generation/wamp/tmp"
xdebug.show_local_vars=0
xdebug.max_nesting_level=200
[opcache]
zend_extension = "C:/Net Generation/wamp/bin/php/php5.5.12/ext/php_opcache.dll"
opcache.enable = 1
opcache.enable_cli = 0
opcache.memory_consumption = 128
opcache.interned_strings_buffer = 8
opcache.max_accelerated_files = 4000
i think you have a problem with caching mechanism.
check app\cache directory.
there has to be a folder named dev.
if it does not exist or if it is empty check folder permissions.
when i delete dev and prod directories under app\cache directory it takes 18 seconds to load the page but after that it takes only 500 ms.
Some years ago i had the same problem. Which antivirus software do you run in the background?
Try to deactivate it for dev purposes or change it. It also could be some indexing services running in the background. Symfony 2 consists of >15000 files with vendors :)
Also try to do it the classic way by reinstalling Windows from the scratch.
My sites takes usually from 100-500ms and my laptop is slower than yours. (Intel C2D P8600)
Just a guess (and probably not the right one), but it could be MySQL related. Seeing how you mentioned PhpMyAdmin and Symfony 2 as PHP applications you tested, both rely on MySQL (assuming you have MySQL set up in Symfony 2). You did not mention this in your post, but in your VirtualBox setup, did you by any chance let the script running on Ubuntu connect to the MySQL server on your Windows host machine?
You could check out PHP Benchmark for some performance testing scripts, and see if these scripts perform better timewise.
Another thing you could try is use Xdebug and see if you find (a) certain (group of) function(s) that are taking up too much time.
I'm definately gonna keep this question as a favorite, because I am too curious to see what it was now :) good luck !
Check your computer random access memory, RAM using http://oca.microsoft.com/en/windiag.asp or run the memory test application shipped with your Ubuntu CD booting option.
In both cases choose what know as extra or deep test - I don't remember exactly- How ever, choose the test with more longtime these kind of tests has no end, you just wait till the test finish two phases and any problems with your RAM, commonly, shown.
Also, Check your hard drive with any mean of checking. after that try to perform disk defragmentation
I bit, your problem is hardware related problem.
My pages were taking 20 seconds to execute. I installed fast cgi, increased memory limits, everything, not working. Then started looking at timeline and noticed symfony firewall module was taking up most of it time. Turns out having "localhost" in my config for doctrine is what was causing issues. Changing it to 127.0.0.1 fixed the problem. Not sure why, but it's described here:
http://12wiki.blogspot.ca/2012/11/why-does-symfony-2-firewall-take-so.html
Page loading time is depends on the CSS + JS + Image loading time also. I had the same problem in CakePHP and solved the problem by using mod_expires in htaccess.
Have you tried "ExpiresByType" in your server htaccess file for CSS, JS and images? Check this page.