CodeIgniter Forums

Full Version: Variable Execution Time
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Petsoukos[/eluser]
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?

El Forum

[eluser]InsiteFX[/eluser]
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.

InsiteFX

El Forum

[eluser]Petsoukos[/eluser]
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?

El Forum

[eluser]InsiteFX[/eluser]
Right! It all depends what is running in the background on a Windows System.

By the way my system is almost like yours.

InsiteFX

El Forum

[eluser]Petsoukos[/eluser]
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. :-)

P.S.
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.