You are here: Re: require_once() with relative-path in Zend Framework causes so many extra syscall. « PHP Programming Language « IT news, forums, messages
Re: require_once() with relative-path in Zend Framework causes so many extra syscall.

Posted by ZeldorBlat on 11/25/07 18:06

On Nov 25, 11:19 am, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> Peter Wang wrote:
> > Hi, all.
>
> > I recently encountered a very annoying problem while using Zend
> > Framework(ZF).
>
> > We use ZF in our web application, and it works fine at the
> > beginning, but later when concurrent requests goes high, we get very
> > high cpu load. when i trace the httpd using strace, i find so much
> > fstat64 syscalls, most of which failed, all these syscalls take more
> > than 60% of cpu usage. After i check our php code carefully, i find
> > all our require_once() was used with absolute-path, but require_once()
> > in ZF are all used with relative-path, so while a class in ZF was
> > used, php will search all directories in include_path, see if the
> > class file was exists and accessable. but most of them fails, utill
> > directory of zend framework was reached.
>
> > so how to stop php making so many meaningless tries. I guess
> > modified the zend framework make it do its require_once() with
> > absolute-path was not feasible.
>
> > another approach i guess is: use __autoload() to load classes when
> > it actually needed. but this also need to modify the Zend Framework.
>
> > any better advices? thank you.
>
> How long is your include path, anyway? It's a very good reason not to
> use it.
>

Very true. It might also help if you put the directory of the Zend
framework at the beginning of the include path so that it's found
immediately.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация