Sunday, November 1, 2009

Cakephp slow on Windows Vista

I use Vista for development. I find that cakephp development on Vista is painfully slow. Some of my coworkers use mac. I, being a (relatively) poor entrepreneur cannot afford a mac (yet), so I have no option but to keep waiting for page to load for sometimes upto 60 seconds.

I tried various ways to handle the problem - apc and xcache both didn't work with my version of php and apache on windows. Then one day it occurred to me - apc is just an elaborate in-memory cache, so why dont I put my cakephp cache files in memory?
So started search for a (free) RAM Disk. After trying few, I found Dataram RAM Disk was the only one that didn't crash on Vista. Those folks have done a good job with their product. I just need a 10M disk, so their free option works well for my dev server.

Next updated the core.php with:

      Cache::config('_cake_core_', array(
'engine' => 'File',
'path'=> 'E:/',
));
First few times were still painfully slow, but as cache filled up, the website now loads blazing fast. I can now again develop on Vista!

3 comments:

Anonymous said...

that's odd... I sometimes use vista for my development and i don't encounter the problems you getting...

it's probably with your setup of apache,php,mysql... I use xampplite without any issues.

Unknown said...

I use wamp on vista, and it has horrible performance for the version I have. That's why the workaround.
Also, when I had set up my dev environment a while ago, I had tried xampp first, but the apache instance kept crashing with shindig. Wamp was the only one that worked at that time. We tried multiple machines, and xampp crashed when trying to process shindig calls on xp and vista. It is possible that newer versions of xampp work with shindig now.

E-Commerce Support said...

that's great, I had the same problem and it's faster now, however not as I like yet.

how did you find out about _cake_core_ cache? I didn't have it in my core.php by default (cake 1.3)