Skip to main content
November 8, 2007
Question

CreateObject takes > 1sec, Ideas?

  • November 8, 2007
  • 2 replies
  • 324 views
I am aware that this is an issue that comes up from time to time, but I have been uable to find specific mentions of this problem being quite as bad as I seem to have it. I am running CF7 on a win2k3 server with a dual-core athlon 64 3700 w/ 2GB of ram, and a SQL Server 2005 database on the same machine. The hard drive is a basic 250GB RAID 1 array.

Suddenly, on October 11, I began to receive numerous timeouts, what has amounted now to several thousand requests taking longer than 60seconds to run. I have gone back through the revisions pushed to the server around that time and I cannot find anything that stands out in particular as being the cause of this. I have to assume that there was something latent in my code that has been exacerbated by external situations, or perhaps that there is some misconfiguration of the server.

I have seen in other posts that a lack of cflock usage can lead to problems like this, so I have been going through the code and making sure to have readonly or exclusive locks on session access (there are very few application scope accesses per request).

The reason that this is such a problem is that during a request, there are usually at least 5-10 object instantiations, and sometimes several more for our admin reporting and payment processing interfaces.. We have a bunch of gnarly business logic that I have spent the last year isolating into CFCs, and I am being to regret the fact that I chose to use a per-object instantiaion scheme. That said, I do believe that coldFusion can handle the load, we usually average less than 1 request/sec over the day, although there are times when it goes up to 4-5 req/sec.

Basically I am asking for any ideas you have. I know that CF is slow at instantiating cfcs, but 1500 ms is ridiculous. There is something pathological about this situation, and unfortunately it is just beyond my grasp. Should I investigate different GC algorithms? I've tried boosting the memory allocation of the JVM to 1GB, but that hasn't helped at all. I have nearly 99% of all cfc instantiation going through the same code point, so if there is some optimization I can make there, it should be easy to do.

I appreciate any help in this matter.
This topic has been closed for replies.

2 replies

November 8, 2007
Eric, one thing that significantly slows down the instantation of CFCs is having debugging turned on. It will also report wildly inaccurate time values. Make sure the debugging is turned completely off.

Also, I would make sure trusted cache is turned on. It probably already is, but if not turn it on and that will help your performance.

Finally, you may just be getting too many requests to keep up. What are the objects being instantiated every request? Can they be stored in server memory (or in the Session if they are user-specific) to avoid instantiation every time?
November 8, 2007
I presume you are always doing a ReleaseComObject( )?
November 8, 2007
jdeline,

Actually, I am not instantiating any COM objects. There are occasional Java objects, but in fact I was not even using those when the problem first appeared. Basically, all the problem occurs with CFCs. Sorry if I didn't make that clear in the original post.

Thanks,
Eric