Welcome Guest, Not a member yet? Register   Sign In
Incredibly Slow CodeIgniter Application
#11

[eluser]TheFuzzy0ne[/eluser]
Sorry, the profiler page I linked to didn't mention anything about benchmarking. I should've read it before linking to it...

You need to set your benchmarks first and then the profiler will display those benchmarks (when it's enabled). Hopefully that makes more sense now. xD

http://ellislab.com/codeigniter/user-gui...hmark.html.

Apologies again.
#12

[eluser]manasrawat[/eluser]
Hi,
My application is crazy slow too. Sometimes It takes close to a minute to load.
I did not know about profiler - so I put log_message('debug','function start/end') type steps in the app to do the job.
But I am unable to pin point the error.
In my logs, I see that the app takes many seconds (from 4 to 55) in the step "Config class initialized". Some sample lines from the log file are as under. I am a total CI newbie. Can any one recommend how I should go about troubleshooting this?

Code:
DEBUG - 2013-04-01 11:46:39 --> M5 dashboard view  sendMessage js function end
DEBUG - 2013-04-01 11:46:39 --> M5 dashboard view  sendChat js function start
DEBUG - 2013-04-01 11:46:39 --> M5 dashboard view  sendChat js function end
DEBUG - 2013-04-01 11:46:39 --> File loaded: application/views/dashboard/dashboard.php
DEBUG - 2013-04-01 11:46:39 --> File loaded: application/views/layouts/footer.php
DEBUG - 2013-04-01 11:46:42 --> Final output sent to browser
DEBUG - 2013-04-01 11:46:42 --> Total execution time: 0.1384
DEBUG - 2013-04-01 11:46:51 --> Config Class Initialized
DEBUG - 2013-04-01 11:46:51 --> Hooks Class Initialized
DEBUG - 2013-04-01 11:46:51 --> URI Class Initialized
DEBUG - 2013-04-01 11:46:51 --> Router Class Initialized
DEBUG - 2013-04-01 11:46:51 --> Output Class Initialized
DEBUG - 2013-04-01 11:46:51 --> Input Class Initialized

Code:
DEBUG - 2013-04-01 11:47:01 --> M5 dashboard controller  checkGuardian function start
DEBUG - 2013-04-01 11:47:01 --> M5 dashboard controller  checkGuardian function end
DEBUG - 2013-04-01 11:47:01 --> M5 dashboard controller  getProfileDetails function end
DEBUG - 2013-04-01 11:47:01 --> Final output sent to browser
DEBUG - 2013-04-01 11:47:01 --> Total execution time: 0.1145
DEBUG - 2013-04-01 11:47:05 --> Config Class Initialized
DEBUG - 2013-04-01 11:47:05 --> Hooks Class Initialized
DEBUG - 2013-04-01 11:47:05 --> URI Class Initialized

Code:
DEBUG - 2013-04-01 00:10:00 --> File loaded: application/views/layouts/header.php
DEBUG - 2013-04-01 00:10:00 --> File loaded: application/views/login.php
DEBUG - 2013-04-01 00:10:00 --> File loaded: application/views/layouts/footer.php
DEBUG - 2013-04-01 00:10:00 --> Final output sent to browser
DEBUG - 2013-04-01 00:10:00 --> Total execution time: 0.0735
DEBUG - 2013-04-01 00:10:48 --> Config Class Initialized
DEBUG - 2013-04-01 00:10:48 --> Hooks Class Initialized
DEBUG - 2013-04-01 00:10:48 --> URI Class Initialized

Code:
DEBUG - 2013-04-01 00:14:33 --> File loaded: application/views/layouts/header.php
DEBUG - 2013-04-01 00:14:33 --> File loaded: application/views/login.php
DEBUG - 2013-04-01 00:14:33 --> File loaded: application/views/layouts/footer.php
DEBUG - 2013-04-01 00:14:33 --> Final output sent to browser
DEBUG - 2013-04-01 00:14:33 --> Total execution time: 0.1434
DEBUG - 2013-04-01 00:14:43 --> Config Class Initialized
DEBUG - 2013-04-01 00:14:43 --> Hooks Class Initialized
DEBUG - 2013-04-01 00:14:43 --> URI Class Initialized
DEBUG - 2013-04-01 00:14:43 --> Router Class Initialized

Code:
DEBUG - 2013-04-01 11:47:05 --> M5 dashboard controller  recommendationUpdateAjax function start
DEBUG - 2013-04-01 11:47:05 --> M5 dashboard controller  recommendationUpdate function start
DEBUG - 2013-04-01 11:47:05 --> M5 dashboard controller  recommendationUpdate function end
DEBUG - 2013-04-01 11:47:05 --> M5 dashboard controller  recommendationUpdateAjax function end
DEBUG - 2013-04-01 11:47:05 --> Final output sent to browser
DEBUG - 2013-04-01 11:47:05 --> Total execution time: 0.0723
DEBUG - 2013-04-01 11:48:00 --> Config Class Initialized
DEBUG - 2013-04-01 11:48:00 --> Hooks Class Initialized
DEBUG - 2013-04-01 11:48:00 --> URI Class Initialized

Can anyone please help?
#13

[eluser]manasrawat[/eluser]
I did some more analysis.
As per New Relic, CI_Output::_display is what takes almost all the time.
Any clue how I can troubleshoot this?
#14

[eluser]TheFuzzy0ne[/eluser]
Welcome to the CodeIgniter forums!

All the log entries you've posted, show a total execution time of less than 0.2 seconds. Have you even noticed any lag?

What you're looking at, is the time between each page request.

Code:
DEBUG - 2013-04-01 11:46:39 --> M5 dashboard view  sendMessage js function end
DEBUG - 2013-04-01 11:46:39 --> M5 dashboard view  sendChat js function start
DEBUG - 2013-04-01 11:46:39 --> M5 dashboard view  sendChat js function end
DEBUG - 2013-04-01 11:46:39 --> File loaded: application/views/dashboard/dashboard.php
DEBUG - 2013-04-01 11:46:39 --> File loaded: application/views/layouts/footer.php
DEBUG - 2013-04-01 11:46:42 --> Final output sent to browser
DEBUG - 2013-04-01 11:46:42 --> Total execution time: 0.1384 // End of request.
DEBUG - 2013-04-01 11:46:51 --> Config Class Initialized // New request starts here!
DEBUG - 2013-04-01 11:46:51 --> Hooks Class Initialized
DEBUG - 2013-04-01 11:46:51 --> URI Class Initialized
DEBUG - 2013-04-01 11:46:51 --> Router Class Initialized
DEBUG - 2013-04-01 11:46:51 --> Output Class Initialized
DEBUG - 2013-04-01 11:46:51 --> Input Class Initialized
#15

[eluser]manasrawat[/eluser]
Im sorry, I query may have been a bit confusing.
One controller is calling the next.. it should be seamless.. In the example that you have user, there is a 9 seconds lag (between what you say "End of Request" and "New Request starts here"). There are instances where there is 55 seconds lag.
My problem is that I am not sure whats happening between the end of a request and beginning of a new request - not sure how to fix this lag.
#16

[eluser]manasrawat[/eluser]
Im sorry, my query may have been a bit confusing.
One controller is calling the next.. it should be seamless.. In the example that you have user, there is a 9 seconds lag (between what you say "End of Request" and "New Request starts here"). There are instances where there is 55 seconds lag.
My problem is that I am not sure whats happening between the end of a request and beginning of a new request - not sure how to fix this lag.
#17

[eluser]TheFuzzy0ne[/eluser]
How is one controller calling the next? I think we might be getting our wires crossed, here. Are you using modular extensions? Please post some controller code.




Theme © iAndrew 2016 - Forum software by © MyBB