Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

Is it true that running a batch class in Sandbox with incredibly simple task takes too long than Production?

I've tried @future with the same task and it process my Streaming API immediately.

Update:

I've never used a Production before. I googled why is my batch apex takes time to execute and I've come across this page : https://developer.salesforce.com/forums?id=906F000000091Q9IAI

I need a confirmation from experts here in Salesforce StackExchange.

Please help me.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Asynchronous code execution for batch apex and @future methods is heavily dependent on what else is going on in that same system at any given time; Salesforce is a multi-tenant system meaning your sandbox not the only org running on the hardware and work has to be load-balanced and kept in check to ensure that all orgs have a suitable amount of resources availailable (i.e. CPU time).

Generally the batch shouldn't take a different amount of time to run over similar data counts, so either your sandbox instance is under heavy load or perhaps you're running much larger data volumes on the sandbox than in production. If it's not data volumes then there's not much you can do to speed it up (perhaps some database indexes will be of use), but it shouldn't be too concerning if things in production are ok. If the data levels are lower and you experience this same slow performance over a few days then it's probably time to file a support case.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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