在使用群辉大量下载时遇到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 is my first time go to see at here and i am truly impressed to
read all at alone place.
%%
%%
It's actually a great and useful piece of information. I'm
happy that you just shared this helpful info with us.
Please stay us up to date like this. Thanks for sharing.
%%
%%
Oh my goodness! Amazing article dude! Thank you so much,
However I am going through issues with your RSS.
I don't understand why I am unable to subscribe to it. Is there anyone else having
similar RSS issues? Anybody who knows the answer will
you kindly respond? Thanx!!
%%
%%
%%
You really make it appear really easy together with your
presentation but I to find this topic to be actually something that I think I might by no means understand.
It seems too complicated and very large for me. I am having a look
forward for your subsequent publish, I will try to get the dangle of it!
%%
Hey! Do you know if they make any plugins to protect against hackers?
I'm kinda paranoid about losing everything I've worked
hard on. Any suggestions?
My programmer is trying to persuade me to move to .net from PHP.
I have always disliked the idea because of the costs. But he's tryiong none the less.
I've been using WordPress on numerous websites for about a year
and am worried about switching to another platform. I have heard very good things
about blogengine.net. Is there a way I can import all my wordpress content into it?
Any kind of help would be really appreciated!
%%
%%
%%