What is the maximum data / speed transfer between two applications on the same computer

I have a client / server application written in delphiXe2 using Indy TIdTCPServer and TIdTCPClient that communicate with each other on the same computer using TCP address 127.0.0.1

When I use about 1 megabyte per second (8 megabytes) of data, everything works fine.

However, when I set my data at a higher speed, for example, 20megs / sec (160 Megabit), it slows down and starts to behave strangely.

Is this the usual behavior for this speed? Also, I can not find any benchmark or information about what is the maximum data transfer rate between two local applications.

Hi

+6
source share
3 answers

Perform a bandwidth test. This is what I use (I bound the appropriate server and client codes). FWIW, I get a maximum of 500 Mbps, although I can’t process the data quickly.

procedure TForm1.IdTCPServer1Execute(AContext: TIdContext); var lData: TByteDynArray; lCaption: string; lMbps: Real; lLen: Integer; begin AContext.Connection.IoHandler.CheckForDataOnSource; SetLength(lData, 0); AContext.Connection.IoHandler.InputBuffer.ExtractToBytes(TIdBytes(lData), AContext.Connection.IoHandler.InputBuffer.Size); lLen := Length(lData); if lLen > 0 then begin if FStartTime = 0 then begin Memo1.Lines.Add(FormatDateTime('dd/mm/yyyy hh:nn:ss.zzz', CsiNow) +': Started test'); FStartTime := CsiNow; end; Inc(FBytesReceived, lLen); lCaption := 'MBits Received: ' + CsiPadFloat(FBytesReceived * 1.0 / 125000, 3, 1); if lCaption <> FLastCaption then begin Label1.Caption := lCaption; FLastCaption := lCaption; end; if FBytesReceived >= 12500000 then begin FStopTime := CsiNow; lMbps := 100000 / MilliSecondsBetween(FStopTime, FStartTime); Memo1.Lines.Add(FormatDateTime('dd/mm/yyyy hh:nn:ss.zzz', CsiNow) + ': Finished test (' + CsiPadFloat(lMbps, 3, 1) + ' Mbps)'); FBytesReceived := 0; FStartTime := 0; end end; CsiSleep(0); end; procedure TForm1.Button1Click(Sender: TObject); var lData: TByteDynArray; lIndex: Integer; begin IdTCPClient1.Host := Edit1.Text; IdTCPClient1.Connect; try SetLength(lData, 125000); for lIndex := 1 to 125000 do lData[lIndex - 1] := Ord('a'); for lIndex := 1 to 100 do IdTCPClient1.IoHandler.Write(TIdBytes(lData)); finally IdTCPClient1.Disconnect; end; end; 
+4
source

If you (ab) use TCP / IP as a tool for IPC between processes that are designed to run on the same computer, you will encounter such restrictions. Using TCP / IP, especially a local connection, all data is fragmented and transmitted through a packet switching system, which is TCP. If so, you should study one of them:

  • Named or unnamed channels
  • Virtual memory mapping
  • Messaging WM_DATA
  • COM
  • (feel free to add more of them to find them here)
+2
source

Without any code to reproduce the problem, it is very difficult to find the problem.

IP connectivity is very stable locally (all data remains in memory, in OS buffers) - and 20 MB / s - nothing for the bandwidth speed currently HW / SW.

I think the problem is in the code, or you have reached the (multi-threaded) Delphi limits and got a bruise while processing the data.

Of course, you tried to disable AntiVirus package scan? Some of them often slow down IP traffic when checking IP packets (even if it is not HTTP), and this leads to an accidental failure of IP traffic.

0
source

Source: https://habr.com/ru/post/908089/


All Articles