Strange server behavior when copying over SMB

Good afternoon, ladies and gentlemen!
Please help me figure it out.
There is a server on Freebsd12, a gigabit network.
I make the first attempt to copy a file from my computer to the server, the speed is very unstable at first, but by the end of the copying process it evens out and is almost the maximum.
img-2023-06-28-22-05-20.png

If I make a second attempt, the speed will immediately be almost maximum.
img-2023-06-28-22-07-48.png

After some time, for example, the next day, the situation repeats itself again, first unstable speed and then everything is fine!
Why do I have this behavior? What can I improve?
thank you for your help!
 
The issue can be caused by many things.
First of all defrag your hard drive if necessary and use some tool (e.g. hdparm) to set APM level to 254 for highest I/O performance or to 255 to disable power saving completely.
 
Note: in the second test run your files are probably in the filesystem cache (do you use ZFS? - ARC). The disk might be busy fetching metadata, e.g. ctime, which might be stored somewhere completeley different physically. It all depends on how big the files are you are copying, and where they are located on your disk (if we are talking about hdds), and then, I have never experienced consistent speed of a windows machine - they are constantly doing random stuff which interferes - checking for updates, some weird network broadcast stuff, logging, swapping etc.
 
Back
Top