Remote Proxy Performance

Remote Proxy Performance

Old forum URL: forums.lhotka.net/forums/t/1595.aspx


DevilDog74 posted on Wednesday, October 25, 2006

I am using v 2.0 of CSLA.  I am using the remote proxy configuration.  The first call into a fetch or create method is slow.  After that subsequent calls are lightning fast. 

When my remote server is deployed to the local IIS performance was slow.  Then I added a call into System.Configuration.ConfigurationManger.GetSection("appSettings") in the clients program.cs code.  This sped things up considerably. 

My client application is located in florida.  When I point my client to my application server in indianapolis, the first call takes about 20 seconds to complete.  Subsequent calls are sub-second.  My local network in florida is connected to indianapolis via a MPLS. 

Does anyone have any thoughts on how to get process to speed up?

 

guyroch replied on Tuesday, October 31, 2006

I've seen that in the past, but it was related to the database connection when the _database_ was on a different server than the application (remote) server.  If you can, create a database on the same physical server as you application  (remote) server and change your connection string to point to this new database instance, and monitor the performance.  If its always fast, first time and subsequent times, then your problem is related to the database connection over the wire and not necessarily Csla per say.

Again, I'm not sure if it will make a diferrence for you, but this is one scenario I faced last year.

Bayu replied on Tuesday, October 31, 2006

guyroch:

I've seen that in the past, but it was related to the database connection when the _database_ was on a different server than the application (remote) server.  If you can, create a database on the same physical server as you application  (remote) server and change your connection string to point to this new database instance, and monitor the performance.  If its always fast, first time and subsequent times, then your problem is related to the database connection over the wire and not necessarily Csla per say.

Again, I'm not sure if it will make a diferrence for you, but this is one scenario I faced last year.



Hey man,

You are a lightning fast cowboy indeed dude! Stick out tongue [:P]
However, this time my reply is not entirely obsoleted by yours. Cool [H]

Just kidding.

See ya!
Bayu

guyroch replied on Tuesday, October 31, 2006

Just changed my avatar -> it's now a cowboy :)

DevilDog74 replied on Tuesday, October 31, 2006

Connection pooling is enabled and is being used.  In the dev environment, the DB is on the same machine. I cannot put a DB on the application server in the production envoironment, because the database lives on a SAN.  The SAN is on the same rack as the application servers so I dont think the delay is comming from the connection string being created.

I did a test where I created a root CSLA object that makes no database calls.  I put a button on my form that creates an instance of the CSLA object using one of the factory methods.  The initial load time was pretty much identical to when I call into a CSLA object that does make DB calls.  So, I feel confident that the bulk of the delay is in the creation of the remote proxy and not the data access code.

So for example, when I create an instance of and object that makes no DB calls, the first execution takes 18 seconds.  When I create an instance of an object that makes DB calls, the first execution takes 20 seconds. 

Any other thoughts?

guyroch replied on Tuesday, October 31, 2006

Could this be related to JIT compile?

I'm afraid this is the end of for me, this is a bit beyond my area of expertise.

 

Bayu replied on Tuesday, October 31, 2006

Wow,

That sounds like way beyond my knowledge ....

Following guyroch's remark, I do know that there is some setting that you can use for ASP.Net apps in order to query every aspx once whenever IIS is rebooted. This in order to trigger the compilation of these pages and shorten the response times for the first user.

It sounds pretty similar to what you encounter here.

I guess you would a need some real expert for an adequate answer on this. Maybe post your question on a relevant MSDN forum?

(see also http://forums.microsoft.com/MSDN/default.aspx?SiteID=1).

Bayu

DevilDog74 replied on Tuesday, October 31, 2006

There is no ASP.NET page to compile.

All that lives on the application server is the CSLA assembly, and my business library with CSLA objects in the business library.  IIS is simply the remote host for the server side code that gets executed by the CSLA runtime.

I was hoping that the creator of CSLA might be able to chime in with some know scenarios.  Thanks for the link to the MSDN site. 

Thanks for the replies, maybe Rocky will get to this some day.

Bayu replied on Tuesday, October 31, 2006

It could be that the first time your app server needs to setup a DB connection and that with subsequent calls the connection can be reused. You can never prevent that creating connections to your DB takes some time, moving your DB to your app-server may yield some benefit but your sysadmin may object for security reasons.

What you can do is improve connection reuse by implementing/enabling connection pooling. Some DBs natively support this and then all you would need to do is alter the connection string, in some other cases you may have to implement it manually. The concept of connection pooling is simple: your app-server always keeps a minimum level of open connections to your DB, so whenever a user request comes in the connection is available immediately. After a request has been processed the connection is not closed as you would normally do, but you keep it for future use to serve another request.

Bayu

Copyright (c) Marimer LLC