Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zend Framework Performing Slow

I'm working on a community based website using zend framework - but its so slow it takes a while for pages to load. I would like to know what aspects of the zend framework should I look into to ensure it runs much faster.

Any tips and help would be greatly appreciated :)


Nice advice - I took upon the database and indexed it from scratch - there werent any indexes to start with :\ but anyway the speed has improved a bit but its still rather slow. Is there anything else that I must be keeping an eye on right here?

Because I'm just assuming its something to do with the framework as when I first ran basic tutorial projects made using the framework - they were a bit slow as well.


Nice tips - had a look at the zend performance guide article. I'm not so sure where to put the code for caching table metadata though :( [sorry for sounding like such a noob here] as mentioned at this link

like image 482
Ali Avatar asked May 25 '09 10:05

Ali


3 Answers

The only way to know for sure where your bottlenecks are is doing deep profiling.

I use xdebug, combined with kcachegrind (part of kde for windows). It generates full call traces for every PHP script that is executed, which you can then inspect to find out which functions are taking up most of the time. No code changes necessary, so you can easily profile third-party libraries like Zend Framework.

  • http://www.xdebug.org/
  • http://windows.kde.org/
like image 64
Joeri Sebrechts Avatar answered Oct 21 '22 02:10

Joeri Sebrechts


If you can be on the same LAN as the server (at least for testing), then you can verify your profile (somewhat) from a client.

If it's a single machine, the most likely cause for slowdowns is memory issues (something using too much, or too little main memory), followed by horrible DB queries.

A PHP opcode cache always seems to help, also remember to disable "atime" (noatime mount option on *nix, a registry change on Windows) to avoid expensive disk writes.

A decent article on more Zend specific things is: http://till.vox.com/library/post/zendframework-performance.html

like image 30
LapTop006 Avatar answered Oct 21 '22 03:10

LapTop006


Install APC on the server. Opcode caches eliminate a lot of the overhead caused by frameworks. You can generally do this by simply running

pecl install apc

on the server.

like image 29
Emil H Avatar answered Oct 21 '22 03:10

Emil H