3

The page in question takes a full minute to load. But only for one client, and I only have access to that clients sandbox.

If I was developing normally, I would use the Developer's Console and logs to determine why a Visualforce page loads very slowly. However the slowness only occurs for one client. They are a very large company and have thousands of users and fields and objects etc on Salesforce. I tested a few suspicious SOQL queries on the page, but found they all completed within .5 seconds.

I am at a loss as to how I can find the cause of the problem. I tried to get my developer account 'big' enough to recreate the issue but I could only create a max of 200 users and only 5,000 roles which was not enough to cause the slowness.

My current plan of action would be to make a few educated guesses about what the problem could be, make those changes, then get the client to install that new package in their sandbox. However, since they are large, they are slow :) and it could take weeks to install each package. I would like to be relatively certain I have a good idea what the problem is before I try random fixes that will take a long time to test.

Any ideas?

3
  • 1
    When you say "Developer's Console" do you mean the internal IDE in Salesforce or the JavaScript tools in a browser like Chrome? The browser can tell you which events are taking longer.
    – joshbirk
    Sep 24, 2014 at 4:02
  • 1
    For the sake of getting logs from a managed package out of an org you can't access you can ask support to "unmask" the customer's debug logs for your app's namespace, and have the customer gather and send over logs. Sep 24, 2014 at 5:08
  • @joshbirk - I mean the internal IDE in Salesforce. I use the Chrome Console a lot but unfortunately when loading an apex page, all I see is one long request (1 mins) and once that loads a couple smaller requests that take milliseconds. I need to know what it going on in the apex code etc. Sep 24, 2014 at 16:27

1 Answer 1

2

My organization had a similar issue with Visualforce and Apex code that was developed for us by a consultant. The code ran reasonable quickly in a full data sandbox. In our production instance, the same code often timed out on the query. The consultant, a Salesforce MVP, worked directly with Salesforce support. The end result was that the queries used were changed significantly based on feedback from Salesforce support.

You could start by looking at the query optimization cheat sheet to see if anything suggested there looks likely to help. There's also this page that talks about working with very large SOQL queries. It's hard to get more specific without more detail. If you're uncertain where the problem lies, start by using log files and added "system.debug" statements to narrow down the code causing the delay.

One thing we learned was that Salesforce gives no performance guarantees with respect to how fast your code runs in a sandbox versus how fast it runs in production.

Note: the time-out issues were experienced by users who had access to all the organization's data. Users with more restricted access generally had no trouble.

4
  • Good info @Jagular. I would give more specifics, but the page and the controller are massive at like 8,000 lines of code. Hard to know where to start. :) I will look at both the links. Thanks. Sep 23, 2014 at 21:53
  • 1
    I'd wonder about the query or queries. Could you build a sample query and have your client's admin run it in the Dev Console? That would be fast compared to deploying a lot of code.
    – Jagular
    Sep 23, 2014 at 23:23
  • 2
    You should contact support - the group inside Salesforce who should look at this is 'Customer Centric Engineering', CCE.
    – metadaddy
    Sep 24, 2014 at 4:28
  • 1
    You'll need to be persistent. It took some effort on the part of our MVP consultant to get the issue escalated to a level where support was able help.
    – Jagular
    Sep 24, 2014 at 16:40

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.