[coldbox:4109] Performance Issues

Hi there..

I have built my site using coldbox version 3, and have published it
live on the web..

However, the site runs very slowly, and every once in a while the site
will load so slowly that I recieve an error "The request has exceeded
the allowable time limit Tag: cfdirectory".

This may be because i am on a shared server, but wondered if I was
doing anything wrong with my code which may be causing it..

I have the site here http://www.forevr-dev.co.uk/musicexplained/, and
have left the debug options visible so you can see whats happening
behind the scenes..I know the debug options slow things down but am
leaving them on here so you can get a better picture, the site is slow
even with the debug options disabled..

Any assistance would be very much appreciated

Thanks

Hi namtax,

Are you sure, you have correct settings values for production.

1: <Setting name="ConfigAutoReload" value="false"/>
2: <Setting name="HandlerCaching" value="true"/>

Others,

Post your config file.

Thanks
Sana

Hi..thanks for your response..

I have change my config settings accordingly..

1: <Setting name="ConfigAutoReload" value="false"/>
2: <Setting name="HandlerCaching" value="true"/>

Think it maybe running bit faster now, but early days...is there
anything else that affect performance....the site is running off a
shared server..could this be an issue?

Thanks

Shared hosting can always be a suspect when a performance issue arises.

  • Gabriel

Hi namtax,

Turn off the debugging, then watch the performance.

Thanks
Sana

Ok, will do..
That seems to have helped anyway sana...thanks for your assistance

Thats definately true...just cant afford vps at the moment

Looks like the ColdBox portion of the equation is pretty fast:

Total Framework Request Execution Time: 78 ms

Rendering the debug output takes a lot of time tho':

Approximate Debug Rendering Time: 2406 ms

As Sana says, turn debugging off and see how you feel about performance then.

make sure if you are using coldfusion debuging, that you have “Report Execution Times” turned OFF also.

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Yeah, am gonna give it a go..
Its just that on my live server...without the debugging, i was having
really bad performance issues...http://www.music-explained.com/
Think that may have improved now following sanas suggestions

I am on shared hosting, is this something my hosts would need to do?

I just hit the live server and it really is slow. If you hit
http://www.music-explained.com/Application.cfm you'll get an error
page immediately. That says it's not anything in the infrastructure -
it's either something in ColdFusion's configuration (Report Execution
Times could be the culprit - but no hosting company should ever have
that enabled!) or in your code that may be causing performance
problems on the production server (for example, accessing the DB or
some HTTP resource).

The problem could also be what was actually specified in the
error...cfdirectory taking too long. What are you doing with
cfdirectory in this operation?

FWIW, I’m seeing timeouts on cfoutput, not cfdirectory. I get those fairly frequently when the app launches the first time. However, I typically don’t have another problem for the duration of the application lifecycle.

Do you not experience this slowness when your run it locally? Are you connecting to the same database in development as production?

Jason Durham

Hi sean..

When i hit http://www.music-explained.com/Application.cfm i get the
error message "Invalid request of Application.cfm, Application.cfc, or
OnRequestEnd.cfm file."
Do you feel that http://forevr-dev.co.uk/musicexplained/ is as slow?
As i feel this is quicker then the live site...

Thanks

Im not sure about cfdirectory...it just seems to be an error from
coldbox, i dont actually program using any cfdirectory tags myself

Yeah, its quite slow locally also, i am running off a different
database locally...sql server 2008

When i hit http://www.music-explained.com/Application.cfm i get the
error message "Invalid request of Application.cfm, Application.cfc, or
OnRequestEnd.cfm file."

Yes, that's expected. My point was that responds very quickly but the
real site does not, hence my deduction that it isn't an inherent
infrastructure problem.

Do you feel that http://forevr-dev.co.uk/musicexplained/ is as slow?

When I posted numbers earlier, it was much faster than the live site.
Now it's throwing an exception (MX not defined in APPLICATION).

Hi sean....could you try again? If you get the error message, just
reload the page and it should appear

http://www.forevr-dev.co.uk/musicexplained/

Now, its strange if the site is working quick here, but slowly on my
live server, as its the same files and folders etc....The only issue i
can think of is that on my staging site the coldbox install folder is
under the wwwroot, and then my site is in its own folder under the
root...So

WWWROOT
---------- COLDBOX
----------- MUSICEXPLAINED
            ---------CONFIG
           ---------- HANDLERS
           ---------- MODEL

Whereas with my live site http://www.music-explained.com/ the sites
folders are directly under the wwwroot as well...

WWWROOT
-------- COLDBOX
---------CONFIG
-------- HANDLERS
-------- MODEL

Would this be a reason for the difference in performance? If not it
may be something to do with the components that im loading into my
application scope on applicationStart

Thanks

Your index page took about 14 seconds to load, and Debug rendering took 6 of those seconds.
You should really turn off the CB debugging. It can output a LOT of HTML depending on how much stuff you have floating around in your request collection. I can't even turn it on in my app or my browser starts puking on all the HTML.

You need to do some performance testing on a staging server (that you actually have control over) that is as close to your production server as you can get (this includes CF settings and CB settings). MAKE SURE you turn on all the CB caching settings. (EventCaching, HandlerCaching, IOCObjectCaching, ConfigAutoReload, ModelsObjectCaching etc )
Then install SeeFusion or something similar on your staging server and actually look at your query execution times and stack traces. Your app doesn't have to be a black box, you just need the right tools to look inside.

Lastly, a lot of the browser load time for me was all the page assets. It took my browser 31 seconds to download all the parts of your page. You have 20 JavaScript and css files totalling almost half a meg which have to be requested from the server separately. Look into a minimizer/combiner for those.

You also have 40 image files totalling 3.6 Megs! Your overal page with assets is over 4 Megs of downloading. You need to start lazy-loading some of those revolving images and/or reducing their sizes. A 300x300 png probably doesn't need to be 482 KB.

Good luck.

~Brad