Pimcore 5 RC - Really slow on local machine


#1

Hi,

I installed pimcore 5 on my local homestead VM.

Running with nginx mysql 5.7 and redis cache.

My Problem is, that Pimcore 5.x is really slow compared to Pimcore 4.6.x

Any ideas why this is the case? Havn’t tried it on a production system by now.

Best regards,

Christian


#2

Hi Christian,

on which platform (your workstation) are you running Vagrant? Many performance issues come from slow filesystems - e.g. on *nix systems typically using NFS is recommended.

Cheers,
Mathias


#3

Hi Christian,

adding to what Mathias said: OSX Filesystem is slow as well, which really comes in play when using Docker with Symfony. They recently introduced some fixes to solve this issue, but I could imagine that VM have similar problems as docker had. (Docker for OSX uses a VM)

Regards


#4

Using Docker on Windows with Hyper-V was really slow too. I reverted to using just using Windows for the main Pimcore install with Docker for Redis which has speeded things up a bit although Pimcore’s admin section is still pretty slow (has been since move to ExtJS6).

Regards


#5

When did you try docker with hyper-v last time? I did it about 3 weeks ago with a customer, works pretty fine, here is the compose script I am using:


#6

Hey,

Sorry for the late response, was sick the last week :confused:

i activated NFS for vagrant with vagrant-bindfs plug-in. Now i works pretty well for developing, also I updated to stable.

And switched from nginx to apache. (Don’t know if this makes any difference, but the default usage of .htaccess files is gold for developing multiple pimcore sites)


#7

I had also lots of perfomance problems mainly in backend in my dev vagrant machine.
I was used to have debug mode on during whole dev time but now the debug switch kills all perfomance.
They went away when i deactivated debug mode in settings of pimcore.

Probably would be nice if we could toggle debug for frontend or backend to ease frontend development


#8

For dev environments on mac I recommend using docker-sync. While it has its (rather small) issues, it makes apps run as fast as directly on the host.
http://docker-sync.io/

Cheers, Igor


#9

@IgorBenko seems like its not needed anymore. I am working with docker on mac without docker-sync and works pretty good. Response times (until page is fully loaded) in DEV Env about 1-2 seconds, which is ok.

BTW: I had problems using docker-sync. All permission where kinda screwed up and nothing really worked smoothly. I do have permissions problem with symlinked files on docker without docker-sync as well, but thats not tragic at all.


#10

@dpfaffenbauer Good to hear that! I on the other hand don’t have any issues at all with permissions and it works pretty smoothly. The only annoyance is that a change in file sometimes doesn’t get registered by Unison immediatelly so the changes aren’t reflected in the actual system and so they also cause really weird debug experience :slight_smile:

I will test again the Docker without docker-sync and compare, but at the moment I am really happy with it.

Thanks for your feedback!


#11

Hi all,

i currently working with Docker + Docker Sync… (nginx, mariadb + redis)

Pimcore 5 is still pretty slow… But you can work with it somehow…

Has anyone got new findings for better performance?

Best greetings from bavaria,

Christian


#12

What underlying OS are you using? Windows or Linux?

I found file access to be slow when using Docker on Windows. Also found APCu could slow things down (I disabled it on dev machine but probably just needs configuring properly)


#13

The docker-sync is the fastest, but it does have it’s share of problems. Using a delegated mount seemed to improve the performance quite a bit for me, additionally I moved few folders into volumes, so there is no overhead with syncing them to host. It is still not as fast as docker-sync, but perfectly usable without the issues with docker-sync. Following lines from my docker-compose.yml should help you further if you want to do something similar.

volumes:
  - ./project/:/var/www:delegated
  - pimcore-cache:/var/www/var/cache 
  - pimcore-tmp:/var/www/var/tmp
  - pimcore-logs:/var/www/var/logs

Cheers, Igor


#14

Having the cache inside the container doesn’t allow you to use the symfony plugin for php-storm though.


#15

After some tests I was able to find a good configuration for Pimcore 5 using Homestead.

In order to make it works and to have good performances I had to make some changes/configurations:

    # PHP extensions
    sudo apt-get install -y php$5-apcu php$5-imagick php$5-redis
  • I overridden the AppKernel::getCacheDir method in order to be able to set a local vm cache dir (this step will be unnecessary with Pimcore 5.3.0):
    public function getCacheDir()
    {
        if (in_array($this->environment, array('dev', 'test')) and getenv('PIMCORE_SYMFONY_CACHE_DIRECTORY')) {
            return getenv('PIMCORE_SYMFONY_CACHE_DIRECTORY') . '/' . $this->environment;
        }

        return parent::getCacheDir();
    }
  • I configured my Homestead.yaml this way (what’s important in this step is to configure the nfs share and all the temporary directories to local vm folders):
ip: 192.168.10.10
memory: 2048
cpus: 1
provider: virtualbox
name: homestead
mariadb: true

authorize: ~/.ssh/id_rsa.pub
keys:
    - ~/.ssh/id_rsa

folders:
    - map: ./
      to: /home/vagrant/pimcore
      type: "nfs"
      owner: "vagrant"
      group: "vagrant"

sites:
    - map: pimcore.test
      to: /home/vagrant/pimcore/web
      type: pimcore

databases:
    - pimcore

variables:
    - key: 'PIMCORE_LOG_DIRECTORY'
      value: '/dev/shm/pimcore/logs'
    - key: 'PIMCORE_SYSTEM_TEMP_DIRECTORY'
      value: '/dev/shm/pimcore/tmp'
    - key: 'PIMCORE_SYMFONY_CACHE_DIRECTORY'
      value: '/dev/shm/pimcore/cache'

ATM I didn’t find any problem using this configuration.

Alessandro


#16

I fully switched to https://github.com/weprovide/valet-plus also features a pimcore driver. Way faster then homstead.