Hello! We've spotted extremely high CPU usage (with php hang up from time to time) on rather busy project. The results of analysis with xhprof show, that most of the cpu time goes to is_dir (30-35%), is_readble (15%) and is_file (up to 10%). As we see, is_dir is mostly called by sfProjectConfiguration::getPluginSubPaths (which in turn is called by include_partial). is_readble is called during sfApplicationConfiguration::getTemplateDir and also because of include_partial. So the more partials you have the more is_dir and is_readble calls is made and more cpu is used. Also, loadPlugins calls the full scan of the plugins directory and only then tries to check some of them (for existence).
Maybe you guys have some advises how to solve the problem? I think it will be great to make the following changes to symfony code: 1. Make plugins directories cache like autoload cache etc. and don't scan all plugins directories on each call (in production). 2. Check plugins only loaded by loadPlugins, not all plugins in plugins directory. 3. Make plugins loadable from application configuration, not from project configuration. 4. Cache template files for module (not sure). Overall idea is to minimze disk based operations. In many cases there are some plugins, which are needed only in backend application, not in frontend, so there is no need to scan all plugin dirs and get all paths, if we load plugins in each application separately, not for whole project. What can you say? Can you help us? Thanks alot! -- You received this message because you are subscribed to the Google Groups "symfony developers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/symfony-devs?hl=en.
