Advertisement
Guest User

response

a guest
Sep 2nd, 2017
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. Response to J H (too much text to fit into a comment)
  2.  
  3. buffer size
  4.  
  5. The Hub buffer size is 400,000 so that the buffer is not blocking the chunk data that is coming in in any way. There are typically 150-300 chunks in a transfer but as far as i know the buffer is overridden by the newest chunk as data comes in recieved = socket.Receive(buffer); since I process chunks serialy.
  6.  
  7. Logging
  8.  
  9. On average it takes 2-4 seconds to transfer a chunk. If I put another writeline in the RecieveData of the interconnect helper I can see that it there appears to be some sort of limit to the amount of data that can be read from one socket.receive.
  10.  
  11. logging in the interconnect
  12.  
  13. while (filled < length)
  14. {
  15. if (!Helpers.NetworkHelpers.Connected(socket)) throw new SocketDisconnectedException();
  16. recieved = socket.Receive(buffer);
  17. Array.Copy(buffer, 0, output, filled, recieved);
  18. filled += recieved;
  19. Console.WriteLine("Interconnect. " + filled + " of " + length);
  20. }
  21. logging in the chunk receiver
  22.  
  23. for(int i = 0; i < chunkAmount; i++)
  24. {
  25. socket.Send(InterconnectHelper.FormatSendData(Encoding.ASCII.GetBytes(i.ToString())));
  26. Console.WriteLine("Chunk " + i + " of " + (chunkAmount -1));
  27. received = socket.Receive(buffer);
  28. recievedData = InterconnectHelper.RecieveData(buffer, received, socket);
  29.  
  30. Array.Copy(recievedData, 0, returnData, i * chunkSize, recievedData.Length);
  31. }
  32. Paste bin of logs with default sizes Paste bin of logs with 200k chunksize
  33.  
  34. swap memory
  35.  
  36. The memory isn't a problem on either end. On the Pi3 there is still ~630MB (im assuming that the vmstat 1 shows KB) and ~160MB on the Pi Zero. Both of them show 0 in the swap columns as the process runs so that is not a bottleneck.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement