在使用群辉大量下载时遇到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 have read a few good stuff here. Definitely worth bookmarking for revisiting.
I wonder how a lot attempt you set to make one of
these great informative site.
Great beat ! I wish to apprentice while you amend your website, how can i
subscribe for a blog site? The account aided me a acceptable deal.
I had been a little bit acquainted of this your broadcast offered bright clear concept
%%
I’m not that much of a internet reader to be honest
but your sites really nice, keep it up! I'll go ahead and bookmark your website
to come back later. Many thanks
Everyone loves what you guys are up too. Such clever work
and reporting! Keep up the wonderful works guys I've included you guys
to blogroll.
PassTo, making currency transactions easy, is committed to becoming the currency exchange benchmark in the financial industry. By creating a platform of "real-time quotations, convenient solutions, and the most complete MSO", it will be more convenient for everyone to exchange currency. During your currency transactions, PassTo will never be absent. home page: [u]https://www.passto.io/[/u]
%%
%%
%%
%%
%%
https://krasnodar.rupansionat.ru/ пансионат для пожилых людей в Краснодаре
%%
%%
Hello to all, how is the whole thing, I think every one is getting more from this web page, and your views are fastidious designed for new visitors.
%%
%%
%%
%%