Recently, due to work needs, I found a distributed file system management software written by Chinese people based on Lunix and written in pure C, named fastdfs. Read the author'sSource codeLater, I feel that this open-source software is not bad, and its performance and functions should be able to meet a certain amount of business needs. Later, I found that this software does not have a. Net client, so I wrote one according to the DFS API.
I wrote the following functions for this client:
1. added the tracker and storage connection pool functions, but does not support sleep;
2. Through investigation, we found that some large portal sites only have the image upload function for DFS systems. Therefore, the client only provides the file upload function;
3. The client configuration is stored in a separate configuration file and must be started in the application_start event;
4. The log function is provided by log4net;
5. When the connection pool is faulty, use the DFS client again to enable short connections to avoidProgramUnable to upload;
NowCodeYou have completed functional and stress testing. Functional testing is exactly the same as fastdfs. During stress testing, the client uses 300 K images under the pressure of 100 users and concurrent requests to evaluate that the upload time is within 3 seconds. Can upload files well.
I will refactor and optimize the DFS client code in the near future (mainly because the code written earlier is too bad and I am sorry to take it out). I will share it as soon as possible.