AFNetworking et nombre d'opérations concurrentes en batch

muqaddarmuqaddar Administrateur
mars 2013 modifié dans Objective-C, Swift, C, C++ #1
Salut,



J'ai un soucis de synchronisation client => serveur.

En gros, au lieu de lancer 1 synchro pour envoyer les éléments JSON du client au serveur, je dois en lancer 4 ou 5 environ à  la suite.



1) Je ne reçois pas d'erreur sur le client.

2) Je ne vois pas d'erreur dans les logs du serveur.



Je me demande si AFNetworking ne mange pas des requêtes, mais connaissant sa fiabilité, je doute.



Voilà  côté client, je crée ma boucle d'opérations/requêtes:


{<br />
[font=Monaco][size=2][color=#4f8187]  AFJSONRequestOperation[/color] *operation = [[color=#bb2ca2]self[/color] [color=#31595d]operationWithRequest[/color]:request];[/size][/font]<br />
[font=Monaco][size=2]  [operations [color=#3d1d81]addObject[/color]:operation];[/size][/font]<br />
}




Puis, je passe la liste des opérations à  mon HTTPCLient :



[/size][/font][font=Monaco][size=2][[[color=#4F8187]HTTPClient[/color] [color=#31595D]sharedClient[/color]] [color=#31595D]enqueueBatchOfHTTPRequestOperations[/color]:operations [color=#31595D]progressBlock[/color]:^([color=#703DAA]NSUInteger[/color] numberOfCompletedOperations, [color=#703DAA]NSUInteger[/color] totalNumberOfOperations)[/size][/font]<br />
[font=Monaco][size=2]  {[/size][/font]<br />
[font=Monaco][size=2]	[[color=#bb2ca2]self[/color] [color=#31595d]calculateProgressViewWithTotalWritten[/color] <img src='http://forum.cocoacafe.fr/public/style_emoticons/<#EMO_DIR#>/sad.png' class='bbc_emoticon' alt=':(' />[color=#bb2ca2]int[/color])numberOfCompletedOperations [color=#31595d]totalToWrite[/color] <img src='http://forum.cocoacafe.fr/public/style_emoticons/<#EMO_DIR#>/sad.png' class='bbc_emoticon' alt=':(' />[color=#bb2ca2]int[/color])totalNumberOfOperations];[/size][/font]<br />
[font=Monaco][size=2]  } [/size][/font]<br />
[font=Monaco][size=2]  [color=#31595d]completionBlock[/color]:^([color=#703daa]NSArray[/color] *operations) [/size][/font]<br />
[font=Monaco][size=2]  {[/size][/font]<br />
[color=#008400][font=Monaco][size=2][color=#000000]	[/color]// push is finished[/size][/font][/color]<br />
[color=#008400][font=Monaco][size=2][color=#000000]	[/color]// stop all[/size][/font][/color]<br />
[color=#31595D][font=Monaco][size=2][color=#000000]	[[/color][color=#bb2ca2]self[/color][color=#000000].[/color][color=#4f8187]delegate[/color][color=#000000] [/color]syncServicesControllerIsStoping[color=#000000]:[/color][color=#bb2ca2]self[/color][color=#000000]];[/color][/size][/font][/color]<br />
[color=#31595D][font=Monaco][size=2][color=#000000]	[[/color][color=#bb2ca2]self[/color][color=#000000].[/color][color=#4f8187]delegate[/color][color=#000000] [/color]syncServicesController[color=#000000]:[/color][color=#bb2ca2]self[/color][color=#000000] [/color]didSyncWithSuccess[color=#000000]:[/color][color=#bb2ca2]YES[/color][color=#000000]];[/color][/size][/font][/color]<br />
[font=Monaco][size=2]  }];




J'arrive à  voir que j'ai environ 255 opérations à  envoyer. Hors, je sais qu'il en réalisera environ 70 lors de la première synchro. (je le contrôle sur le serveur)



Je le vois même avec ma ProgressView, au début je vois la barre avancer à  chaque opération, et puis à  1/3 de la barre, d'un seul coup, il avance jusqu'à  la fin (au lieu d'être régulier), et l'app m'annonce la synchronisation finie.



Mais où sont passées 2/3 des requêtes ?



Une surcharge serveur peut-elle en être la cause ?

Dans ce cas, pourquoi je ne récupère pas d'erreurs dans :





- ([color=#4f8187]AFJSONRequestOperation[/color]*)operationWithRequest:([color=#703daa]NSMutableURLRequest[/color]*)request

Réponses

  • StephSteph Membre
    Alors perso j'ai eu des soucis du genre avec ma dernière app, en fait j'envoyé trop de requêtes en même temps. Du coup, j'ai placé chaque opération créée dans un NSOperationQueue et j'ai fait un set à  3 simultanées max et ça a résolu mon souci.



    Je ne sais pas si ça peut être une piste pour toi mais dans mon cas, ça a résolu le souci.
  • CéroceCéroce Membre, Modérateur
    Est-ce que certaines requêtes tapent dans la même URL ?
  • muqaddarmuqaddar Administrateur
    'Céroce' a écrit:


    Est-ce que certaines requêtes tapent dans la même URL ?




    Ce ne sont que des POSTS qui tapent la même URL: "services/push_item"

    Mais envoient du contenu différent (différent modèles, différents champs). Un problème possible avec le cache ?
  • muqaddarmuqaddar Administrateur
    Désolé pour la réponse longue mais voilà  un résumé. En gros, tout se passe bien jusqu'à  la requête 101, ensuite, il y a un gros pétage de plomb !








    2013-03-14 10:58:30.444 App[16285:c07] Completed : 1 / total : 313

    2013-03-14 10:58:30.495 App[16285:c07] Completed : 2 / total : 313

    2013-03-14 10:58:30.544 App[16285:c07] Completed : 3 / total : 313

    2013-03-14 10:58:30.582 App[16285:c07] Completed : 4 / total : 313

    2013-03-14 10:58:30.685 App[16285:c07] Completed : 5 / total : 313

    2013-03-14 10:58:30.776 App[16285:c07] Completed : 6 / total : 313

    2013-03-14 10:58:30.854 App[16285:c07] Completed : 7 / total : 313

    2013-03-14 10:58:30.974 App[16285:c07] Completed : 8 / total : 313

    2013-03-14 10:58:31.098 App[16285:c07] Completed : 9 / total : 313

    2013-03-14 10:58:31.147 App[16285:c07] Completed : 10 / total : 313

    2013-03-14 10:58:31.294 App[16285:c07] Completed : 11 / total : 313

    2013-03-14 10:58:31.419 App[16285:c07] Completed : 12 / total : 313

    2013-03-14 10:58:31.499 App[16285:c07] Completed : 13 / total : 313

    2013-03-14 10:58:31.624 App[16285:c07] Completed : 14 / total : 313

    2013-03-14 10:58:31.754 App[16285:c07] Completed : 15 / total : 313

    2013-03-14 10:58:32.743 App[16285:c07] Completed : 16 / total : 313

    2013-03-14 10:58:32.938 App[16285:c07] Completed : 17 / total : 313

    2013-03-14 10:58:33.263 App[16285:c07] Completed : 18 / total : 313

    2013-03-14 10:58:33.506 App[16285:c07] Completed : 19 / total : 313

    2013-03-14 10:58:34.625 App[16285:c07] Completed : 20 / total : 313

    2013-03-14 10:58:41.504 App[16285:c07] Completed : 21 / total : 313

    2013-03-14 10:58:42.287 App[16285:c07] Completed : 22 / total : 313

    2013-03-14 10:58:44.077 App[16285:c07] Completed : 23 / total : 313

    2013-03-14 10:58:44.106 App[16285:c07] Completed : 24 / total : 313

    2013-03-14 10:58:44.121 App[16285:c07] Completed : 25 / total : 313

    2013-03-14 10:58:45.614 App[16285:c07] Completed : 26 / total : 313

    2013-03-14 10:58:45.633 App[16285:c07] Completed : 27 / total : 313

    2013-03-14 10:58:45.819 App[16285:c07] Completed : 28 / total : 313

    2013-03-14 10:58:46.622 App[16285:c07] Completed : 29 / total : 313

    2013-03-14 10:58:46.971 App[16285:c07] Completed : 30 / total : 313

    2013-03-14 10:58:49.020 App[16285:c07] Completed : 31 / total : 313

    2013-03-14 10:58:49.232 App[16285:c07] Completed : 32 / total : 313

    2013-03-14 10:58:49.403 App[16285:c07] Completed : 33 / total : 313

    2013-03-14 10:58:49.696 App[16285:c07] Completed : 34 / total : 313

    2013-03-14 10:58:50.011 App[16285:c07] Completed : 35 / total : 313

    2013-03-14 10:58:50.212 App[16285:c07] Completed : 36 / total : 313

    2013-03-14 10:58:50.365 App[16285:c07] Completed : 37 / total : 313

    2013-03-14 10:58:53.284 App[16285:c07] Completed : 38 / total : 313

    2013-03-14 10:58:56.092 App[16285:c07] Completed : 39 / total : 313

    2013-03-14 10:58:57.858 App[16285:c07] Completed : 40 / total : 313

    2013-03-14 10:58:58.720 App[16285:c07] Completed : 41 / total : 313

    2013-03-14 10:58:58.931 App[16285:c07] Completed : 42 / total : 313

    2013-03-14 10:59:03.777 App[16285:c07] Completed : 43 / total : 313

    2013-03-14 10:59:05.468 App[16285:c07] Completed : 44 / total : 313

    2013-03-14 10:59:05.485 App[16285:c07] Completed : 45 / total : 313

    2013-03-14 10:59:07.425 App[16285:c07] Completed : 46 / total : 313

    2013-03-14 10:59:07.446 App[16285:c07] Completed : 47 / total : 313

    2013-03-14 10:59:07.489 App[16285:c07] Completed : 48 / total : 313

    2013-03-14 10:59:09.101 App[16285:c07] Completed : 49 / total : 313

    2013-03-14 10:59:09.123 App[16285:c07] Completed : 50 / total : 313

    2013-03-14 10:59:14.127 App[16285:c07] Completed : 51 / total : 313

    2013-03-14 10:59:20.132 App[16285:c07] Completed : 52 / total : 313

    2013-03-14 10:59:20.872 App[16285:c07] Completed : 53 / total : 313

    2013-03-14 10:59:22.992 App[16285:c07] Completed : 54 / total : 313

    2013-03-14 10:59:24.756 App[16285:c07] Completed : 55 / total : 313

    2013-03-14 10:59:24.778 App[16285:c07] Completed : 56 / total : 313

    2013-03-14 10:59:26.384 App[16285:c07] Completed : 57 / total : 313

    2013-03-14 10:59:26.628 App[16285:c07] Completed : 58 / total : 313

    2013-03-14 10:59:26.834 App[16285:c07] Completed : 59 / total : 313

    2013-03-14 10:59:27.247 App[16285:c07] Completed : 60 / total : 313

    2013-03-14 10:59:29.400 App[16285:c07] Completed : 61 / total : 313

    2013-03-14 10:59:36.716 App[16285:c07] Completed : 62 / total : 313

    2013-03-14 10:59:38.382 App[16285:c07] Completed : 63 / total : 313

    2013-03-14 10:59:40.400 App[16285:c07] Completed : 64 / total : 313

    2013-03-14 10:59:42.363 App[16285:c07] Completed : 65 / total : 313

    2013-03-14 10:59:43.926 App[16285:c07] Completed : 66 / total : 313

    2013-03-14 10:59:44.800 App[16285:c07] Completed : 67 / total : 313

    2013-03-14 10:59:45.469 App[16285:c07] Completed : 68 / total : 313

    2013-03-14 10:59:47.034 App[16285:c07] Completed : 69 / total : 313

    2013-03-14 10:59:47.054 App[16285:c07] Completed : 70 / total : 313

    2013-03-14 10:59:47.344 App[16285:c07] Completed : 71 / total : 313

    2013-03-14 10:59:47.611 App[16285:c07] Completed : 72 / total : 313

    2013-03-14 10:59:47.682 App[16285:c07] Completed : 73 / total : 313

    2013-03-14 10:59:48.015 App[16285:c07] Completed : 74 / total : 313

    2013-03-14 10:59:49.177 App[16285:c07] Completed : 75 / total : 313

    2013-03-14 10:59:51.801 App[16285:c07] Completed : 76 / total : 313

    2013-03-14 10:59:53.303 App[16285:c07] Completed : 77 / total : 313

    2013-03-14 10:59:54.198 App[16285:c07] Completed : 78 / total : 313

    2013-03-14 10:59:56.487 App[16285:c07] Completed : 79 / total : 313

    2013-03-14 11:00:00.974 App[16285:c07] Completed : 80 / total : 313

    2013-03-14 11:00:01.344 App[16285:c07] Completed : 81 / total : 313

    2013-03-14 11:00:02.234 App[16285:c07] Completed : 82 / total : 313

    2013-03-14 11:00:04.293 App[16285:c07] Completed : 83 / total : 313

    2013-03-14 11:00:04.303 App[16285:c07] Completed : 84 / total : 313

    2013-03-14 11:00:05.058 App[16285:c07] Completed : 85 / total : 313

    2013-03-14 11:00:06.855 App[16285:c07] Completed : 86 / total : 313

    2013-03-14 11:00:06.872 App[16285:c07] Completed : 87 / total : 313

    2013-03-14 11:00:08.425 App[16285:c07] Completed : 88 / total : 313

    2013-03-14 11:00:09.151 App[16285:c07] Completed : 89 / total : 313

    2013-03-14 11:00:11.943 App[16285:c07] Completed : 90 / total : 313

    2013-03-14 11:00:13.264 App[16285:c07] Completed : 91 / total : 313

    2013-03-14 11:00:17.499 App[16285:c07] Completed : 92 / total : 313

    2013-03-14 11:00:17.891 App[16285:c07] Completed : 93 / total : 313

    2013-03-14 11:00:18.880 App[16285:c07] Completed : 94 / total : 313

    2013-03-14 11:00:19.055 App[16285:c07] Completed : 95 / total : 313

    2013-03-14 11:00:21.540 App[16285:c07] Completed : 96 / total : 313

    2013-03-14 11:00:21.556 App[16285:c07] Completed : 97 / total : 313

    2013-03-14 11:00:23.605 App[16285:c07] Completed : 98 / total : 313

    2013-03-14 11:00:24.447 App[16285:c07] Completed : 99 / total : 313

    2013-03-14 11:00:27.413 App[16285:c07] Completed : 100 / total : 313

    2013-03-14 11:00:29.061 App[16285:c07] Completed : 101 / total : 313

    2013-03-14 11:00:30.195 App[16285:c07] Completed : 108 / total : 313

    2013-03-14 11:00:30.196 App[16285:c07] Completed : 123 / total : 313

    2013-03-14 11:00:30.197 App[16285:c07] Completed : 123 / total : 313

    2013-03-14 11:00:30.197 App[16285:c07] Completed : 123 / total : 313

    2013-03-14 11:00:30.198 App[16285:c07] Completed : 133 / total : 313

    2013-03-14 11:00:30.199 App[16285:c07] Completed : 147 / total : 313

    2013-03-14 11:00:30.199 App[16285:c07] Completed : 162 / total : 313

    2013-03-14 11:00:30.200 App[16285:c07] Completed : 171 / total : 313

    2013-03-14 11:00:30.201 App[16285:c07] Completed : 171 / total : 313

    2013-03-14 11:00:30.202 App[16285:c07] Completed : 171 / total : 313

    2013-03-14 11:00:30.202 App[16285:c07] Completed : 171 / total : 313

    2013-03-14 11:00:30.202 App[16285:c07] Completed : 171 / total : 313

    2013-03-14 11:00:30.203 App[16285:c07] Completed : 171 / total : 313

    2013-03-14 11:00:30.203 App[16285:c07] Completed : 171 / total : 313

    2013-03-14 11:00:30.203 App[16285:c07] Completed : 171 / total : 313

    2013-03-14 11:00:30.204 App[16285:c07] Completed : 171 / total : 313

    2013-03-14 11:00:30.205 App[16285:c07] Completed : 171 / total : 313

    2013-03-14 11:00:30.205 App[16285:c07] Completed : 171 / total : 313

    2013-03-14 11:00:30.206 App[16285:c07] Completed : 171 / total : 313

    2013-03-14 11:00:30.206 App[16285:c07] Completed : 171 / total : 313

    2013-03-14 11:00:30.206 App[16285:c07] Completed : 171 / total : 313

    2013-03-14 11:00:30.209 App[16285:c07] Completed : 182 / total : 313

    2013-03-14 11:00:30.213 App[16285:c07] Completed : 220 / total : 313

    2013-03-14 11:00:30.213 App[16285:c07] Completed : 220 / total : 313

    2013-03-14 11:00:30.214 App[16285:c07] Completed : 220 / total : 313

    2013-03-14 11:00:30.214 App[16285:c07] Completed : 220 / total : 313

    2013-03-14 11:00:30.214 App[16285:c07] Completed : 220 / total : 313

    2013-03-14 11:00:30.215 App[16285:c07] Completed : 220 / total : 313

    2013-03-14 11:00:30.215 App[16285:c07] Completed : 220 / total : 313

    2013-03-14 11:00:30.220 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.220 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.220 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.221 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.221 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.221 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.222 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.222 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.222 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.223 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.223 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.224 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.224 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.224 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.225 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.225 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.225 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.226 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.226 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.226 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.227 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.227 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.227 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.228 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.228 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.230 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.231 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.231 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.231 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.231 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.232 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.233 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.234 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.234 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.234 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.235 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.235 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.236 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.237 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.237 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.237 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.238 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.238 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.238 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.239 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.239 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.239 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.239 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.241 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.241 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.242 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.242 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.243 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.243 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.244 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.250 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.251 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.251 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.252 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.252 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.253 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.254 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.256 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.256 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.257 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.257 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.257 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.258 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.258 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.305 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.305 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.306 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.306 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.306 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.307 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.307 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.307 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.308 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.308 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.308 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.309 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.309 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.309 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.309 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.310 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.310 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.310 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.311 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.311 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.311 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.312 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.312 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.312 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.313 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.313 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.313 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.314 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.314 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.314 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.314 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.315 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.315 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.315 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.316 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.316 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.316 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.317 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.317 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.317 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.318 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.318 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.318 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.318 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.319 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.319 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.319 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.320 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.320 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.320 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.321 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.321 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.321 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.321 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.322 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.322 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.322 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.323 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.323 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.323 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.324 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.324 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.324 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.325 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.325 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.325 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.325 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.326 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.326 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.326 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.327 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.327 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.327 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.328 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.328 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.328 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.329 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.329 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.329 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.330 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.330 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.330 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.330 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.331 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.331 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.332 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.332 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.333 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.333 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.334 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.334 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.335 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.336 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.336 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.336 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.337 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.337 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.338 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.338 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.338 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.339 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.339 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.339 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.340 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.340 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.340 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.341 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:30.341 App[16285:c07] Completed : 307 / total : 313

    2013-03-14 11:00:31.459 App[16285:c07] Completed : 308 / total : 313

    2013-03-14 11:00:31.474 App[16285:c07] Completed : 309 / total : 313

    2013-03-14 11:00:31.490 App[16285:c07] Completed : 310 / total : 313

    2013-03-14 11:00:31.850 App[16285:c07] Completed : 311 / total : 313

    2013-03-14 11:00:32.425 App[16285:c07] Completed : 312 / total : 313

    2013-03-14 11:00:36.500 App[16285:c07] Completed : 313 / total : 313
  • muqaddarmuqaddar Administrateur
    mars 2013 modifié #6
    Bon en fait, je me tape bien des Timeouts (bizarre, vu que ça ne dépasse pas le délai accordé).

    Donc mes requêtes sont bien quelque part...



    failure Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo=0xb9ad300 {NSErrorFailingURLStringKey=http://www.app.com/services/push_item, NSErrorFailingURLKey=http://www.app.com/services/push_item, NSLocalizedDescription=The request timed out., NSUnderlyingError=0xb8da7c0 "The request timed out."}



    Des pistes:

    https://github.com/A...king/issues/564
  • muqaddarmuqaddar Administrateur
    Bon, cette ligne semble résoudre tous mes problèmes:



    [color=#000000][[[/color][color=#4f8187]HTTPClient[/color][color=#000000] [/color][color=#31595d]sharedClient[/color][color=#000000]] [/color][color=#31595d]operationQueue[/color][color=#000000]].[/color]maxConcurrentOperationCount[color=#000000] = [/color][color=#272ad8]1[/color][color=#000000];[/color]




    La synchronisation semble bien plus lente, mais au moins ça marche.

    Je n'ai plus de Timeouts.



    Je suppose qu'il doit y avoir un goulot d'étranglement quelque part. J'envoie des images de 200 Ko environ pendant la synchro, associées à  mon modèle. Et côté serveur Rails envoie les images sur Amazon S3... Peut-être que le serveur ne sait pas gérer tout ça si 15 images arrivent en même temps ?



    Il me semble cependant que ça marchait très bien les premiers mois... (iOS 6.1 peut être une autre piste)
  • StephSteph Membre
    'muqaddar' a écrit:


    Bon, cette ligne semble résoudre tous mes problèmes:



    [color=#000000][[[/color][color=#4f8187]HTTPClient[/color][color=#000000] [/color][color=#31595d]sharedClient[/color][color=#000000]] [/color][color=#31595d]operationQueue[/color][color=#000000]].[/color]maxConcurrentOperationCount[color=#000000] = [/color][color=#272ad8]1[/color][color=#000000];[/color]




    La synchronisation semble bien plus lente, mais au moins ça marche.

    Je n'ai plus de Timeouts.



    Je suppose qu'il doit y avoir un goulot d'étranglement quelque part. J'envoie des images de 200 Ko environ pendant la synchro, associées à  mon modèle. Et côté serveur Rails envoie les images sur Amazon S3... Peut-être que le serveur ne sait pas gérer tout ça si 15 images arrivent en même temps ?



    Il me semble cependant que ça marchait très bien les premiers mois... (iOS 6.1 peut être une autre piste)




    Je n'avais pas vu qu'on pouvez paramétrer l'operationQueue de AF directement, je vais modifier mon code du coup, mais en gros c'est ce que je t'avais dis ... image/biggrin.png' class='bbc_emoticon' alt=':D' />
  • muqaddarmuqaddar Administrateur
    mars 2013 modifié #9
    J'ai fait un petit test:


    <br />
    [[HTTPClient sharedClient] operationQueue].maxConcurrentOperationCount = 5;<br />
    <br />




    => La synchro a pris 3min 30


    <br />
    [[HTTPClient sharedClient] operationQueue].maxConcurrentOperationCount = 1;<br />
    <br />




    => La synchro a pris 7 min



    Je suppose que le bug serait dû au fait que l'application analyse mal la capacité du serveur à  répondre à  la demande ou la vitesse du réseau ? Car maxConcurrentOperationCount devrait être trouvé par le framework en fonction de la quantité de donnée envoyée ?



    C'est flou ça:


    " the maximum number of operations can change dynamically based on system conditions."
  • Ben en gros il doit regarder la charge système pour savoir combien il peut placer de requêtes en mémoire. Quand j'ai eu le souci, ça ne réagissait pas pareil en fonction des devices.



    De mon côté je lance des requêtes de DL, quand mon API retournait 10 items ça allé, mais maintenant ça en retourne 600, donc j'ai vite compris que 600 requêtes de download de fichier sur mon S3, il fallait calmer un peu les ardeur de AF, j'ai fais un set à  5 et ça marche nickel.
  • muqaddarmuqaddar Administrateur
    Moi c'est des requêtes d'Upload sur S3, c'est encore plus long...



    Je suis assez étonné de la lenteur du coup... mais bon, j'ai 300 Ko environ à  envoyer à  chaque requête (sachant que mon serveur fait l'aller-retour avec S3 à  chaque requête...).
  • Vous n'avez pas un maximum de requetes simultanées cote serveur ?
  • muqaddarmuqaddar Administrateur
    'FKDEV' a écrit:


    Vous n'avez pas un maximum de requetes simultanées cote serveur ?




    Est-ce que ma config de Nginx peut répondre à  cette question ou c'est autre chose ?
  • LeChatNoirLeChatNoir Membre, Modérateur
    ben puré, vous ménagez pas la data de vos utilisateurs les gars !

    image/smile.png' class='bbc_emoticon' alt=':)' />
  • 'muqaddar' a écrit:


    Est-ce que ma config de Nginx peut répondre à  cette question ou c'est autre chose ?




    Je ne connais pas bien nginx mais j'ai vu le mot clé 'limit_conn' ici :

    http://nginx.org/en/docs/http/ngx_http_limit_conn_module.html

    Qui permet de limiter le nombre de connections par client ou par vhost.
  • muqaddarmuqaddar Administrateur
    Franchement, je pense plutôt que le problème vient d'Amazon S3 ou plutôt du traffic entre mon serveur (en mutualisé en plus) et Amazon S3. Finalement, j'ai bridé à  2 opérations concurrentes au maximum, et ça a l'air fiable. J'ai aussi mis 120s de timeout maxi.
Connectez-vous ou Inscrivez-vous pour répondre.