I have a 7Gig file to send using JAVA NIO in 2 scenarios:
First is the client will be the one sending the file and I allocate the buffer to be 500MB it is fast it took only 30sec
Second is the server will be one sending the file and I still used 500MB as my buffer but it took me almost 30mins to send the file but when I decrease the buffer allocation It improves performance until I arrive to 1MB buffer allocation and it took me 1min to send the file.
But on the first scenario I also decrease it but it just decrease the performance on sending the file.
Can someone explain me why did this happen?