在使用群辉大量下载时遇到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数量即可。
%%
%%
%%
%%
%%
%%
hydroxychloroquine malaria hydroxychloroquine coupons plaquenil
%%
%%
Hi, this weekend is good designed for me, since this time i am reading this impressive informative paragraph here at my house.
%%
Very shortly this site will be famous amid all blogging and site-building
visitors, due to it's nice articles
dark websites reddit buying things from darknet markets [url=https://world-onion-darkweb.com/ ]guide to darknet markets [/url]
%%
open darknet markets deep web links updated [url=https://world-dark-market.com/ ]crypto market darknet [/url]
Heya i am for the first time here. I found this board and I find It really useful & it helped me out
a lot. I hope to give something back and aid others like you aided me.
%%
[url=http://clomid.charity/]buy clomid 50mg[/url]
%%
%%