cancel
Showing results for 
Search instead for 
Did you mean: 

Weird performance issue

SOLVED

Weird performance issue

Hi

 

I have setup a magento 2 host with multiple websites/domains. For testing I wrote a script that copies the production site to the testsite and does the following:

  • Make backup of database
  • Rsync Magento2 to location of testsite on same server
  • Load the backup of the database into the testdatabase
  • Update domain references in the core_config_data so that http://www.domain.com becomes http://test.domain.com
  • On testdatabase: php bin/magento setup:upgrade & setup:di:compile & setup:static-content:deploy en_US & setup:static-content:deploy nl_NL & indexer:reindex & catalog:images:resize & cache:clean & cache:flush (basicly the whole bunch)
  • Set all the correct permissions on files and directories

Here comes the weird part:

 

I use curl to test the speed of the page generation from the localhost.

 

curl -so /dev/null -w "%{time_connect} - %{time_starttransfer} - %{time_total}  " http://www.domain.com
0.004 - 0.040 - 0.042

 

So the production site is loaded in 0.04x seconds. Values between 0.040 and 0.075 seconds are quite common on the production site.

 

Same test on the testdomain:

 

curl -so /dev/null -w "%{time_connect} - %{time_starttransfer} - %{time_total}  " http://test.domain.com
0.004 - 1.967 - 1.980

 

The value of almost 2 seconds is very common on the test site.

 

It is the same server, running the same software.

 

I installed a magento 2.1.9 demoshop and did the same: So copy/rsync the demoshop1.domain.com to demoshop2.demoshop.com and these two site runs without any performance difference.

 

PS: I already enlarged the parameters of the opcache (which was to small to handle both sites)

 

Server: VM on VMWare (with SSD discs). Ubuntu 16.04 LTS, Apache2, MariaDB 10.2, PHP 7.0 with opcache

 

I don't know where to look any more. Does anybody have any clues?

 

Thom

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Weird performance issue

Hmmm found it myself after 3 weeks of testing.... for some very weird reason the magento cache was enabled on the production server, but disabled on the testsite even though it as a complete copy of the production site.

 

Enabling the magento cache made the performance issue go away.

 

Thank

 

Thom

View solution in original post

1 REPLY 1

Re: Weird performance issue

Hmmm found it myself after 3 weeks of testing.... for some very weird reason the magento cache was enabled on the production server, but disabled on the testsite even though it as a complete copy of the production site.

 

Enabling the magento cache made the performance issue go away.

 

Thank

 

Thom