Fast data transfer over LAN (lots of files)

demand (scenario)

Due to machine performance and workload, there are a lot of experiments that need to be carried out on different machines at the same time. After the experiments, the data needs to be summarized. It is really troublesome to copy and bring back each time with a mobile hard disk and the transmission speed is limited. My hard disk is about 40M to 80M/s, but it will still be very weak when faced with dozens of G big data.
So I thought about how to quickly transfer data without using an intermediary (to prevent time double). There is a way to quickly transfer data through network cables, but the machines in different offices are connected by hardware, and it is not even as convenient as I use a hard disk to copy back and forth.
Just thinking about how to find a method of fast transmission in the LAN without going through the hardware, it is said that the maximum can reach 800M per second. mdMy own measurement is only 4M per second, It still depends on the demand, maybe you can choose the FTP method to be faster.

1. Build http-server locally

python environment

Since the http service is built through python, there must be a python environment first. Find the tutorial to download and install by yourself.
If you don't have python, it is recommended to choose other methods to transfer data. This method is not fast but troublesome.

Create folders and set up sharing

Find a place to create a folder by yourself and set it as shared: open the settings in two ways, marked in red and marked in blue
, as shown in the figure below .
insert image description here

Select all users:
insert image description here
In fact, I personally feel that this sharing can not be set, because this everyone seems to refer to other users of this computer, anyway, I set it.

python open http-server

Open the cmd command line under this shared folder, enter and press python -m http.server [端口号]
insert image description here
Enter, and the first line of command below will be displayed, indicating that the http service has been enabled.

local ip query

Open the cmd command line at any location and enter ipconfig to query.

2. Access from other computers

Other computers can directly enter the ip + port number in the browser to access.
insert image description here

View access information locally

Then this machine displays the access information:
insert image description here
the cmd command line is closed, which means that the service is also closed, and it cannot be clicked, because clicking means input, which is equivalent to pausing. If clicked, just press Enter. ctrl+c can stop the service.
Turn it on when transferring and turn it off when not transferring.

unresolved issues

In my personal experiment, I can only view and access this folder and files through the browser, but I can't download it. I didn't find the download option, and my head is bald. solved! ! !

Solution

If it is a folder or file, the default option is to open. After thinking for a long time, I tried to upload a zip archive, and then clicked, and the hhh was downloaded by default. So the download can only download the compressed package.

other questions

As mentioned earlier, if the cmd command line is closed or clicked, the service will be suspended, so how not to display the cmd command line?
The pythonw command can be used. The difference between pythonw and python is that pythonw is used in visual programs, that is, the command line window is not displayed, that is, it is turned to run in the background.
But there will also be a problem in this situation: when it turns to run in the background, how to close it, you can only find this background program by going to the task manager (according to my query, it may be called python, but I dare not close it, because I have Use python to do other things, anyway, it is available in the local area network). Or by searching the port, close the port you previously occupied, it should be ok, just a guess.

You can use a hammer. I tried it, but it didn’t work. Although pythonw can have no view, it is used in the backend of the visualization software.
I can't use pythonw for this, and I can't do it by putting the command to open the http service in a pyw file and then executing it through the pythonw command. Although it can be executed, it cannot be accessed.
It may be because httpserver must return information, so there must be a path to output information, but I just use it simply, so I don’t plan to study how to make it run without an interface, and it seems to be troublesome to package such a command into a windows service Yes, for the time being, it hangs by opening the command line on other desktops.

Guess you like

Origin blog.csdn.net/weixin_43938876/article/details/122360019