• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Variable Execution Time

The title is somewhat abstract but what really bugs me is that the execution time of the Home/Main page of my application varies from time to time.

When I do a standard login, meaning that the browser's caches is clean, no cookies, no sessions, the front-page executes in 0.04-0.06 seconds with about 45 db queries.
While manually deleting the ci_session cookie, refreshing takes about 0.1 seconds. This is when the autologin system kicks in.
After a while on idle, like 30+ minutes, refreshing the home pages takes about 1-2 seconds.

The autologin system is simple and standard.
1. The session expires.
2. On refresh the script grabs the cookies.
3. Process the autologin information.
4. Recreates the session cookie.
5. Stores the new autologin info into the database if necessary.
6. Renders the page.

This whole process is like 30 lines of code and does 1 db query. The database has just 10 records at the most since it is on development stage right now. I can't exactly find out the actual problem. Is it my 30 lines of script? The CI sessions? Database?
The development system/server is an Intel i7 920 with 6 Gigs of RAM and a standard sata HDD running Win7_64. Server software includes Apache 2.2.16, PHP 5.3.5, MySQL 5.1.44. Installed manually not with WAMP.

Did anyone else experienced something similar with CI?

You will not be able to get accurate timings on any Windows System!

You need to remeber that windows is event driven so it is always
do other things in the background while you are running.


So the variance in execution time that I get is a Windoze thingie? Like the httpd process is taking some time to get executed after idling for to long?

Right! It all depends what is running in the background on a Windows System.

By the way my system is almost like yours.


Well I hope it's just that because I can't optimize it any further (or don't know how to). There are like 80-90 processes running in the task manager. (HTTPd, sql, AV, FTP, Mail Client, Browsers, IDE, Music etc). Can't wait to get the project online on Hostgator's VPS server. :-)

I really don't think a user will just leave the website if a random refresh will take 1 second more to execute than usual.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.