rsync memory usage
hellow everyone,
I backup my webserver's data daily with rsync. after backup it caches memory and when web server is loaded memory is swapping. If i reboot server after rsync backup web server does not swap memory. So it happens because of rsync's memory usage. Can you suggest how to limit rsync memory usage. I do incremental backups with rsync. thank you. |
Have you checked if your target hard drive has enough space for the backup?
|
yes it has 700BG free backup size is max 11GB, ram on server is 8GB
|
Did you also check if your ionodes aren't all used?
$ df -i |
can you post your rsync command?
|
rsync command:
rsync -Aaxv inodes: used free 166 60882778 |
after using rsync the memory should be released. if indeed the memory does not get released it might point to a memory leak somewhere. i found that other people had the same problem, a possible (but I do not know if recommendable) solution is to drop the cache after rsync
sudo sh -c "sync; echo 3 > /proc/sys/vm/drop_caches" see https://www.linuxquestions.org/quest...memory-758345/ http://askubuntu.com/questions/46565...c-memory-usage |
Hi
rsync uses memory depending on how many files are rsynced. So one way to limit memory usage is to do it in many operations instead. Version 3 and newer use less than older, but both sender and receiver has to be version 3 or newer. But are you sure it really is a problem? Typically, you configure the server to use more memory for the web server and database. When rsync runs, it needs more. It can then swap out unused memory - which can be unused services, video memory and such things. When rsync is finished, that unused memory stays in the swap until it's needed. If it's not needed, it will just stay there. You now have more free memory, which is typically used for file cache and kernel buffers. |
yes will try but php files and web server data is also cached in memory. I think it will be safe to drop cache.
|
Why drop the cache? All it does is to drop the file cache, so it will have to be read again later. It will just make things slower.
Is the reason simply that you see swap is uses with for example top? Then I think you are mistaken. It's a good thing that unused memory is put in swap. You now have more memory for file system cache and buffers. |
yes reason is that and may be it's my mistake or don't understan something but, as I know if apache data will be swapped it will slow down server. so it's memory in swap from rsync not webserver's data?
|
Listen to @Guttorm - if you don't know what you are looking at, how can you make a proper decision ?.
|
If the data in the memory will be used only every 24 hours, there is really no need to keep it there. Moreover, if other programs start to swap, it could actually be a memory leak, so that memory would not be used again.
|
thanks guys, my mistake :D now it's clear little bit. I have also read this now I have clear understanding about that. and it has solved my problem.
|
All times are GMT -5. The time now is 09:31 AM. |