In my instance I could insert or update record with a batch size of 100 records without problem.

The last week and with the same code in production we started to get the apex cpu limit and we have to reduce the batch size to 10!!

Even the test classes in production started to fail. The same classes that worked perfect days before. How is this possible??

I think it's very strange. Salesforce does not give any explication and only send information about this limit. I know why this limit occurs but dont understand that, one day works fine and suddenly everything start to fail...

Anyone had had something similar?

  • An instance can slow down and have issues. Have you gone to trust.salesforce.com to check and see if your instance was having problems? – crmprogdev Jun 7 '16 at 12:32
  • 4
    Could it be like someone added a new workflow that may update records so new triggers execute and use more cpu time. So now only inserts/updates of small chunks are avaiable. And same applies for test classes. PD: Deleted my other comments since I understood initially you were talking about a Apex Batch, not about chunks of records. Check if you have workflows or triggers that may interact with each other. – Alexander Aeons Torn Jun 7 '16 at 12:43
  • Yes, I always go to trust.salesforce.com but always it's green. We think It's something related with the summer 16 but who knows.. – Vic Naranja Jun 7 '16 at 13:29
  • Are the test classes using seeAllData=true? If so, there may be a data problem. – Jeremy Nottingham Jun 7 '16 at 13:44
  • 1
    No, we never use this option. – Vic Naranja Jun 7 '16 at 13:46

Browse other questions tagged or ask your own question.