Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

freekmurze's avatar

Homestead is very slow on Yosemite

Hi,

on Yosemite my Homestead vm has become very slow. I've got only one site enabled. On Mavericks the site was superfast, now even "php artisan" takes 15 seconds to complete.

I'm running the lastest versions of virtualbox and vagrant

Has anyone else seen this issue? How can it be solved?

0 likes
45 replies
bashy's avatar

Check what's eating up CPU time and report back.

Activity Monitor or Linux similar (iotop/htop etc)

freekmurze's avatar
top - 13:46:14 up 2:21, 2 users, load average: 0.09, 0.11, 0.12
Tasks: 93 total, 2 running, 91 sleeping, 0 stopped, 0 zombie
%Cpu(s): 1.4 us, 6.8 sy, 0.0 ni, 91.2 id, 0.0 wa, 0.7 hi, 0.0 si, 0.0 st
KiB Mem: 2050104 total, 667936 used, 1382168 free, 56164 buffers
KiB Swap: 0 total, 0 used, 0 free. 339280 cached Mem

  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND                                                                                                                                                                                                      
 1103 redis 20 0 35172 7408 976 S 2.3 0.4 3:45.27 redis-server                                                                                                                                                                                                 
 1130 mysql 20 0 693968 62484 7864 S 2.0 3.0 3:43.48 mysqld                                                                                                                                                                                                       
    7 root 20 0 0 0 0 S 0.7 0.0 0:59.13 rcu_sched                                                                                                                                                                                                    
    8 root 20 0 0 0 0 R 0.7 0.0 1:06.39 rcuos/0                                                                                                                                                                                                      
 2321 vagrant 20 0 90720 1908 484 S 0.7 0.1 0:19.27 nginx                                                                                                                                                                                                        
   25 root 20 0 0 0 0 S 0.3 0.0 0:34.98 kworker/0:1                                                                                                                                                                                                  
 1189 postgres 20 0 246432 1656 288 S 0.3 0.1 0:02.40 postgres                                                                                                                                                                                                     
 2782 root 20 0 216620 1092 768 S 0.3 0.1 0:41.36 VBoxService                                                                                                                                                                                                  
    1 root 20 0 33648 2984 1476 S 0.0 0.1 0:02.09 init                                                                                                                                                                                                         
    2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd                                                                                                                                                                                                     
    3 root 20 0 0 0 0 S 0.0 0.0 0:19.59 ksoftirqd/0                                                                                                                                                                                                  
    5 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0H                                                                                                                                                                                                 
    9 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh                                                                                                                                                                                                       
   10 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcuob/0                                                                                                                                                                                                      
   11 root rt 0 0 0 0 S 0.0 0.0 0:00.00 migration/0                                                                                                                                                                                                  
   12 root rt 0 0 0 0 S 0.0 0.0 0:01.59 watchdog/0                                                                                                                                                                                                   
   13 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 khelper                                                                                                                                                                                                      
   14 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kdevtmpfs                                                                                                                                                                                                    
   15 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 netns                                                                                                                                                                                                        
   16 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 writeback                                                                                                                                                                                                    
   17 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kintegrityd                                                                                                                                                                                                  
   18 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset                                                                                                                                                                                                       
   20 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kblockd

When starting php artisan from a vanilla Laravel installation, the php process immediately jumps to 99% and it takes about 10 seconds to complete

The VBoxHeadless processor on my host machine (OSX Yosemite, mid 2011 iMac), takes about 15% when i'm doing nothing on the VM.

alsofronie's avatar

For me it's about the sync process (it takes 1-5% CPU in idle). And yes, the composer dump-autoload is very slow, but everything else is working as expected. Do you experience delays in accessing http or database?

bashy's avatar

Yeah is that from when it was going slow or just idle?

If you explain which part is slow and what is being used in process list. Fyi, htop is much nicer to read. iotop will also show any I/O problems

montogeek's avatar

I'm using Homestead on Yosemite since Beta4 and is working perfect.

bashy's avatar

@montogeek It's more likely a local problem, remember not all OS environments are the same.

1 like
freekmurze's avatar

Reporting back: fortunately for me the problem did resolve on itself after a few days. Verrrry strange. I'll investigate it further if the problem pops up again.

MarcTroesken's avatar

had the same probs 2 times! One day everything is working fine other day homestead lags. also if i try to homestead ssh it takes abut 60 seconds or longer to get in.

MarcTroesken's avatar

I reinstalled vagrant, VirtualBox and homestead 3x ! And removed all the hidden files from the System (Library etc etc) and its still not working. i am really frustrated ...

freekmurze's avatar

@schogetten I could temporary work around the problem by creating a new user on my mac and reinstall vagrant, Virtualbox and homestead there.

richbreton's avatar

freekmurze - so Yosemite runs this process that constantly rescans the filesystem everytime there is a change and that uses a lot of memory. I have found more times than not when things dont work on yosemite and then are fine hours or days later this has been going on. have you installed Memory Clean from the apple app store? It gets fantastic reviews and I myself have found it very helpful

1 like
richbreton's avatar

@schogetten see my above comment I bet if you let it sit a few days it will clear up. I had to do it on mine too.

meetgodhani's avatar

Same thing is with me. It's really really slow and laggy.

bashy's avatar

Show us activity monitor of your Mac and of the VM.

sudo apt-get install htop

1 like
HRcc's avatar

Do you use type: nfs with your shared folders? It has boosted performance significantly.

bashy's avatar

NFS not on by default?

They're talking about website load speed or the general commands inside the VM?

HRcc's avatar

No it's not. Probably because of windows. Here's a short thread about that.

From what I understood it's about VM speed.

bashy's avatar

I would be worried about the 7.6GB/8GB used. That's one mad 2GB RAM VM there :P

1 like
freekmurze's avatar

After restarting my iMac, the problem returned. Hopefully it solves itself after a few hours.

Activity monitor when doing nothing on the VM:

bashy's avatar

Wow, that's some crazy MySQL memory being used, what's it doing?

Have you checked status on something like PHPMyAdmin?

freekmurze's avatar

Mysql shouldn't be doing anything. The screenshots were taking a minute after I launched the homestead vm without any sites.

To make sure mysql isn't the culprit I stopped the mysql service. Unfortunately the VM still is very very slow.

bashy's avatar

Could just be the amount of databases you have on it. Not sure if it uses memory for quick access to them.

Also, load is 0.52 in last 5mins. If you're not doing anything on it, it should be near enough 0.00/0.01

Try adding some more cores to the VM? A load of 1.00 would be pushing it for a single core machine.

freekmurze's avatar

Things I also tried: disabling spotlight/launchbar No success: the problem still persists

RavanScafi's avatar

Try setting this in your my.cnf mysql file and restart mysql.

performance_schema=0
freekmurze's avatar

Like last time to problem solved itself after leaving my mac on for a night.

bashy's avatar

It's definitely doing something for a long period of time after boot. May want to look into that.

Also, try install iotop and check what it's doing with the disk.

sudo apt-get install iotop
freekmurze's avatar

Installed iotop, will check the next time I'm experiencing slowness on the vm

Next

Please or to participate in this conversation.