Yii + apache + mod_fcgid

I’m installing an application written using the Yii framework and am seeing very slow load times using Apache + mod_fcgid.

I have apache using mod_fcgid as the handler for .php files and the page is loading, however there’s a 3 to 4 second lag each time someone hits the front page of the site.

I’ve tested using a very simple phpinfo script and that loads in fractions of a second.

With the application, I’ve verified that each call to the script is using the same pid. I’ve run an strace against that pid and I see a lot of lstat() calls to files within the “protected” directory (which appears to include the various controllers, views, etc for the application).

I would have thought that with mod_fcgid, there’d be no need to keep loading the application on every request. Is this not the case? Is there something I need to change in the application to make it play nicely with mod_fcgid?

Thanks!