Web Services Very Slow...Please help

A

amqazi

We have an application that we recently converted to VB.Net. The
database access layer has been converted to a web service. We have
noticed a significant reduction in the speed of database calls. This is
a high availability application and each moderate size query to an SQL
server takes about 10 to 15 seconds. We could not resolve this problem
so we switched the database access component back to a .Net written
COM+ component, and the speed has improved a lot.
I would love some advice on how to speed up the database calls. I also
noticed that each time I would assign a value to the URL property of
the component to prepare it for connecting to the web service, the web
service would recompile itself. Is that true?

Thanks a bunch.

AD
 
P

Peter Kelcey

AD

It's definitely not surprising that your data access slowed down when
you made the move to web services. There are a lot of reasons why this
would happen.

1) Web services run across http which is a very slow protocol compared
to other protocols
2) SOAP is appallingly slow, as all data needs to be serialized into
XML. The required XML parsing puts heavy load on the CPU, increases
latency, and lowers throughput.
3) In order to maximize the openness and adoptability of web services,
performance had to sacrificed. Most vendor controlled remoting
technologies are able to take advantage of proprietary compression
techniques. Since no one vendor doesn't control web services, such
custom compression techniques can't be used.

However, even with all of this in mind, 10-15 seconds is still an
extremely high a response time.
Everything being equal, you should probably be getting your responses
back in a matter of seconds. So there seems to be something else
occurring on top of this.

Your last statement about recompilation did give me some thoughts. What
are you observing that make you think that your web services are
recompiling on some calls? Your web services shouldn't be doing that.
What I'm thinking is that your AppDomain might be reloading. After a
certain period of inactivity, the AppDomain running around your web
services unloads. The next call that you make to the web service will
then require this appdomain to reload. This can take a fair number of
seconds. Perhaps this is what you are observing. It may also account
for the 10-15 second response time you are having. Have you tried
making multiple calls in a row via the service? Do all calls take this
long, or is it just the first one? If it's just the first one, then
your issue is probably the appdomain.

I have some other thoughts around your move from web services to COM+.
By itself, COM+ doesn't have any remoting so I assume that either you
are using DCOM or you have this COM+ component located on the same
machine as the code that is calling it. If that's the scenario, then
you really shouldn't be using web services at all. Web services
should be used when calling across server boundaries and shouldn't be
used to call resources on the local box. If you are using DCOM to call
the COM+ component remotely, then ignore that last statement, however
you will definitely find DCOM to be faster than web services.

Hope that gave you something you can use.

Peter Kelcey
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top