Subscribe
Performance tips
by Simon Fell on April 4, 2005 at 09:22 PM
Getting the maximum performance out of the API requires following a few simple rules. The main difference is that you are going over a Wide Area Network, so network times will be higher.
We have spent a significant amount of time desiging our API for optimal performance. Please follow the following guidelines when using the API
- Most calls are bulk calls (they can take more than one record). Do not sit in a loop calling create with just 1 account, batch them up and pass 200 accounts to create in one go. Loading 1,000,000 records can be done in 5,000 calls or 1,000,000 calls. Doing it in 5,000 calls will dramatically improve performance
- Get familiar with the retrieve call. If you are pulling data from related tables, the retrieve call is a high performance call that you should be using
- Cache metadata, if you're using the describe* calls a lot, cache the results of each call for the duration of the session.
- Make sure you're using HTTP/1.1 persistent connections, every time you create a new connection, you have to go through the SSL setup again, persistent connections allows you to aggregate that SSL setup code over multiple requests. (If you're using Axis, this means ditching the default HTTPSender, and using the superior, but not default commonsHTTPSender class instead)
- Use compression, unless you have an OC45 connection into the back of your machine, compression will help reduce transmission times, the Sforce API supports gzip and deflate compression for both request and response.
- Consider a local lookup cache. If you are constantly doing lookups, you should consider a local lookup table.
See these tech notes for help on compression:
SOAP Compression in Visual Studio
Enabling SOAP Compression in Java with Apache Axis

Comments
Posted by Alon Hirsch on November 22, 2005 01:46 AM:
Hi,
I have tried implementing SOAP Compression in another .Net product using the same techniques described in the above article.
I have a problem I'm hoping you can help with:
If I run the Axis web service on my local computer (in Tomcat 5.5.9), everything works perfeclty and I can compress both requests and responses.
If however, I run against a remote server (any server - I've tried 5 all running the same software), I can only call the service 1 or 2 times before the system freezes.
It freezes in the GetRequestStream override method when accessing the stream of the request object (not calling the wrappedRequest method).
Any ideas ?
Alon
Posted by Alon Hirsch on November 22, 2005 01:51 AM:
Hi,
Another comment regarding compression with Axis - there is a free .jar file that can be downloaded that acts as a filter for Axis requests rather than modifying the Axis source code directly.
Installation instructions as well as the download are available from http://www.osmoticweb.com/soap-compression-howto.htm
Alon
Posted by Bill McGinnis on July 28, 2006 01:59 PM:
Is there a limit per day or per hour on the number of "API Calls" for an application. We are migrating 20,000,000 records from about 10 SQL tables and therefore will be making millions of calls over a 4-5 day period.