Zend framework 1 login slow

114 Views Asked by At

Generally my application response times are good and pages load quickly. However login, using Zend_Auth with mysql db, takes an age compared to other tasks. I'm wondering has anyone else encountered this? If not can anyone suggest a good way to debug and find the cause of the slow down? FYI most pages are rendered under a second after their link is clicked whereas login takes around 7 seconds.

1

There are 1 best solutions below

0
Volvox On

First you need to figure out what is causing slowdown. Add this to your application.ini:

resources.db.setDefaultTableAdapter = 1
resources.db.params.profiler.enabled  = true
resources.db.params.profiler.class  = Zend_Db_Profiler_Firebug

Then use Firefox+Firebug+FirePHP to see (in Firebug Console) list of all queries. Maybe one of them is really slow? Or maybe you make a lot of them?

Other thing to do is to check Net tab (Firebug) with 'keep changes' turned on to see if you don't make too many redirects or maybe some JS files are slowing down downloading page?

Last step is to install XDebug and run your login with XDEBUG_PROFILE parameter and then use KCacheGrind tool to see what is happening during login and what takes most time. (Check manual)