在使用群辉大量下载时遇到Too many open files问题,查阅相关资料后发现tr的limit数是写死的。这里使用C程序动态修改tr的limit数。
1.创建一个limit.C源文件并输入如下代码
#include <stdio.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/types.h>
int main(int argc, char** argv) {
pid_t pid;
struct rlimit new_limit;
int result;
if (argc < 2) {
return 1;
}
pid = atoi(argv[1]);
new_limit.rlim_cur = 60000;
new_limit.rlim_max = 60000;
result = prlimit(pid, RLIMIT_NOFILE, &new_limit, NULL);
return result;
}
2.编译程序
使用安装好的GCC编译器编译程序,/opt/bin/gcc limit.c -o limit
3.运行程序修改tr limit 数量
先获取tr的pidps -ef | grep transmission
然后使用./limit 刚刚获取的pid
修改tr的limit数量即可。
%%
%%
I like this web site so much, saved to fav.
%%
%%
[url=http://biaxin.cyou/]biaxin 500mg[/url]
darknet adress darknet drug markets reddit [url=https://cypher-onion-darkmarket.com/ ]tor top websites [/url]
I like the helpful info you provide in your articles.
I will bookmark your weblog and check again here regularly.
I am quite sure I'll learn plenty of new stuff right here!
Best of luck for the next!
%%
Wow, amazing blog layout! How long have you been running a blog for?
you make blogging glance easy. The entire glance of your site is great, as well as the content!
%%
darkfox market darknet darknet drug delivery [url=https://cypher-darkmarket.com/ ]cp onion [/url]
%%
the armory tor url top darknet drug sites [url=https://cypher-darkweb.com/ ]darknet site [/url]
%%
%%
%%
%%
reddit darknet market australia dark net market list [url=https://heineken-drugs-market.com/ ]darknet vendor reviews [/url]
%%