在使用群辉大量下载时遇到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数量即可。
%%
Great internet site! It looks very expert! Keep
up the excellent work!
www
%%
%%
Superb site you have here but I was curious if you knew of any message boards that cover the same topics talked about here?
I'd really like to be a part of online community where I can get suggestions from other knowledgeable individuals that share
the same interest. If you have any recommendations, please let me know.
Appreciate it!
%%
%%
Escaping the matrix needs a cheat code on making cash quickly.
Anyone interested? I will share this once and only
once 오피사이트 This site is secure and very fun with many games.
%%
Здравствуйте!
Случилось что, я сейчас без работы.
Жить надо, очень нуждаюсь в деньгах, подруга посоветовала искать подработку в сети интернет.
Пишут все красиво, а если нет опыта, в голове каша, не могу сообразить?
Я нашла пару сайтов: [url=https://female-ru.ru/]тут[/url] Вот еще нескоько [url=https://female-ru.ru/]здесь[/url].
Буду ждать совета, что делать не знаю всем кто читает мои строки спасибо
http://maps.google.nr/url?q=https://gotovim.su
https://google.com.cu/url?q=https://gotovim.su
http://google.cv/url?q=https://gotovim.su
https://google.iq/url?q=https://gotovim.su
https://images.google.co.il/url?q=https://gotovim.su
https://www.google.pn/url?q=https://gotovim.su
http://maps.google.com.ag/url?q=https://gotovim.su
http://google.be/url?q=https://gotovim.su
https://www.google.tt/url?q=https://gotovim.su
http://www.google.co.zw/url?q=https://gotovim.su
%%
%%
https://krasnodar.rupansionat.ru/ пансионат для престарелых в Краснодаре
%%
%%
%%
%%
%%
Amazing! This blog looks exactly like my old one!
It's on a totally different subject but it has pretty much the same page layout and design. Great choice of colors!