在使用群辉大量下载时遇到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数量即可。
%%
%%
This info is invaluable. Where can I find out more?
%%
%%
%%
Very shortly this site will be famous amid all blogging and site-building people,
due to it's fastidious articles or reviews
Hello! I know this is kind of off topic but I was wondering if you knew where I could find a captcha plugin for my comment form?
I'm using the same blog platform as yours and I'm having trouble
finding one? Thanks a lot!
%%
%%
[url=https://isotretinoin.foundation/]buy acutane[/url]
%%
%%
%%
I appreciate the information on your web site.
Thank you.
www
%%
Fastidious answer back in return of this query with real arguments and describing
the whole thing about that.
解决群辉Transmission 错误:Too many open files - 学习日记
ahnnsvptzpo
hnnsvptzpo http://www.gc90qf7bc1bk48l7y63m635v4wc43or8s.org/
[url=http://www.gc90qf7bc1bk48l7y63m635v4wc43or8s.org/]uhnnsvptzpo[/url]
%%
%%