Tibor Udvari
Tibor Udvari

Reputation: 3012

Parse.com stress testing iOS application

I'm building an app where I wish to use Parse as the backend platform.

I feel the app is going to be quite request heavy so I am doubting that I can financially sustain the app.

I would like a mechanism to be able to test my app with a lot of users before production, ideally with some form of XCode testing.

Are there any tools or techniques that are used for this kind of situation to create users and make them execute actions at semi-random intervals to test the load?

I know this is a relatively vagues question but I'm just looking for some pointers in the right direction here.

Upvotes: 2

Views: 900

Answers (1)

Ryan Kreager
Ryan Kreager

Reputation: 3581

Probably your best bet if you want to use XCode is to do a multithreaded stress test. Three simple steps:

  1. Set up a number of stressful calls (queries, saves, etc.) on separate threads.

    //First, create a Grand Central Dispatch Queue
    dispatch_queue_t specialQueue;
    specialQueue = dispatch_queue_create("com.yourcompanyname.yourappname", NULL);
    
    //Then run the thread a set number of times with your method you want to test
    int totalThreads = 200; //you could make this as big or small as you need to stress test
    for (int i = 0; i < totalThreads; i++) {
        dispatch_async(specialQueue, ^{ [self yourMethod]; });
    }
    
  2. Second, run the queries in quick succession automatically (see above code to change the number of calls you make).

  3. Watch your query and stress levels on the Parse.com dashboard.

Upvotes: 4

Related Questions