-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could mmap supports max file size? #544
Comments
As far as I know, if mmaped memory is written to the disk and purged from physical RAM in the case of low memory situation. mmap is not faster than ordinary read/write system call. If mmap causes an issue, could you try --disk-cache option? It uses 16MB memory per aria2 instance for disk cache by default. |
Disk-cache works, but it performance much worse than mmap on a fast line. Downloading http://ubuntu.hkets.org/14.04.3/ubuntu-14.04.3-desktop-amd64.iso with mmap : 15 second without hang I guess there are two reason for the difference in performance between cache and mmap
2)file-allocation works better with mmap on windows As I know, people are getting decent broadband for a affordable price. People living including me in Hong Kong pay 23USD for 1000m 20USD for 500m per month. |
The disk cache size is configurable. Try --disk-cache option. |
@tatsuhiro-t Sorry, I might misunderstood what you mean by per aria2 instance as per task, but i have set disk-cache=1000M. Aria2 still hang during file-allocation and it spending more time at downloading a 1G file. |
file-allocation=falloc is independent from mmap or disk cache. If it blocks with disk-cache, then it also blocks with mmap. BTW, what file system do you use? |
And are you using aria2 on windows? |
@tatsuhiro-t I use NTFS on Windows 7. falloc should take only a few milliseconds for a large file, but instead it works like zero filling on Windows 7 with NTFS |
I have also experienced similar problem with NTFS with falloc before. aria2 blocked after file allocation completed, somehow operation system was doing something funny. |
We use SetEndOfFile to allocate file space, but it seems it performs zero-fills. |
@tatsuhiro-t I have tested file-allocation=trunc for a while. The outcome is depressing. It yields even lower performance(maybe problem related to fragmentation) and hanging still appears sometime. I think I better keep using mmap with caution. If this won't be fixed, please tell me and I will close this issue. |
fc95a91 will make --file-allocation=falloc faster by eliminating zero-fill. |
--max-mmap-limit options was added by commit 8f51793 |
Excellent, I know closed source stuffs like windows is somehow weird and broken(being forced to use it by my job). I am so glad you are willing to fix these problems for people in pain. Nicely done. I will compile and test it tomorrow. |
The patch does its job. |
Great to hear that. Thank you. |
Hi, I am wondering what will happen if mmap runs out of memory. Will the memory be flushed to the disk or the process be killed by kernel? I am using aria2 on Windows with Cygwin. |
I'm not sure about Windows Cygwin internals. As for Linux, when memory is required for another processes, kernel will flush data into disk as needed. |
mmap make downloading faster and generating less disk IO which is really important for a low end computer. However, if the file length is bigger than the total number of RAM in machine, aria2 will just crash and slow down the system. Could it be possible to add a setting like mmap-max-file-size and turn off mmap for file bigger than certain size to workaround this problem?
The text was updated successfully, but these errors were encountered: