5

We are currently working on a UAT phase for a force.com site implementation where we have custom visual force forms running upto 70 steps. We are currently facing request time governor limit exceeded on our sandbox which has a maximum of 30 minutes allocated. We have a logged an issue with salesforce on this to increase it as we expect 200,000 users to use the site and our forms would run through 70 steps taking atleast 30 to 45 minutes to complete one application per user. Have you faced this request time governor limit in your current or past force.com site implementations and can you share best practices to control it? Can you guys provide insight on how salesforce calculates this request time of 30 minutes for a 24 hour rolling window? Is this session based, request based or page scope? Any help would be appreciated..

  • One thing you might consider is contacting support and asking for a temporary increase in your request time. – Ryan Guest May 14 '13 at 18:45
5

Salesforce.com calculates the total amount of time it takes to process the page, including querying the database and rendering the page. Using JavaScript remoting will drastically reduce the time spent rendering the page server-side by offloading this responsibility to the client. Furthermore, using static resources instead of inline JavaScript will also reduce the calculated usage time, because data fetched from a cache (such as the CDN) doesn't count against your total server time. Consider designing your page to use the following code:

<apex:page controller="MySiteController">
    <apex:includeScript value="{!$Resource.mySiteJS}"/>
    <div id="content"></div>
</apex:page>

Your controller can be completely written as remote actions. Note that I have zero view state and only one expression to evaluate. Here's some possible code that you might use in your controller:

public with sharing class MySiteController {
    @RemoteAction
    public static SomeData getSomeData(SomeParam param) {
        // Do stuff here, return SomeData.
    }
    // More remote action functions here
}

The client-side rendering is taken care of inside MySiteJS:

(function() {
    function init() {
        // when the page loads
    }
    // Other functions here. We can also use jQuery, etc...
    addEventListener('load', init, true);
}());

Using this design structure, you should be able to get your Visualforce page loads down to about 20ms, and your remoting actions should typically return in far less than 1000ms even if you have a ton of data you're throwing down the wire. And remember, CDN (your JavaScript) is free of charge, so leverage that fact to reduce your total page time. If you're providing localization strings, I would store the languages in various static resources as well; have the page load the appropriate language pack based on the user's settings.

1

from http://na15.salesforce.com/help/doc/en/sites_limits.htm
“Service request time” is calculated as the total server time in minutes required to generate pages for the site.

1) improve the general performance http://www.salesforce.com/us/developer/docs/pages/Content/pages_best_practices_performance.htm

2) communication via JS Remoting get rid of VF inputs as much as possible and perform actions where possible via JS Remoting http://www.salesforce.com/us/developer/docs/pages/Content/pages_js_remoting.htm

2) 'eager' load questions
an other alternative would be to eager load questions and control visibility via javascript (possibly conflictive to 1 and 2). It might reduce your total loading time, while the avg. time might increase

1

We have faced this issue often in sandbox and support have usually increased this limit by four times (to 120 mins) temporarily.

One way around this is to use more sandboxes in your tests. Not sure if you are trying to load test with 200,000 users on sandbox but production has a request time limit of 60 hours which is 120 times more than sandbox.

The service request time is request based, which is the time it takes salesforce servers to generate your page, at any given time your total time for the last 24 hours should not exceed their limit, it does not matter if its the same day or another day, it always looks back at your last 24 hours.

To lower your request time you can reduce your apex code statements (especially loops), limit your query, use ajax.

Edit: With 200,000 users you should also keep an eye out for page views and bandwidth limits.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.