在使用群辉大量下载时遇到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数量即可。
%%
%%
%%
%%
When your stress degree will get too much, it means anxiousness may be occurring too.
Try and delegate several activities so you start to reduce some your responsibilities.Make sure
that you also take time to decompress daily.
%%
selector 17 gg
https://selektorkazinogame.ru
В будущем можно будет играть в онлайн-казино со своего смартфона. В игру играют на экране компьютера и использует специальное программное обеспечение, которое генерирует случайные числа для игры. Игрок выбирает сумму денег, а затем делает ставки на результат случайного числа, сгенерированного программой.
%%
Thanks, this website is very helpful.
www
It is perfect time to make some plans for the future and it is time to be happy.
I have learn this post and if I could I wish to recommend you few interesting things or tips.
Perhaps you can write subsequent articles referring to this article.
I desire to read more things about it!
%%
%%
Hey There. I found your blog using msn. This is an extremely well written article.
I'll be sure to bookmark it and return to read
more of your useful info. Thanks for the post. I will certainly return.
%%
buy ozobax pills toradol order online toradol pills
%%
%%
Wow, awesome blog layout! How lengthy have you
ever been running a blog for? you make blogging glance easy.
The total glance of your website is fantastic, let alone the content!
%%
Its not my first time to visit this web page, i am browsing
this web page dailly and get good facts from here daily.