2

I have seen in my ubuntu server that the value of threads-max is 129573.Then i run myprogram and after a while the terminal shows the error with-: system error:resource temporarily unavailabe.Then i see my total threads which is running in my os which prints out 32509.I printed it out with the command ps -A |wc -l .I have also tried to set the process limit in /etc/security/limits.cnf and have set it to the value of threads-max but still i am getting this error.(by the count it shows that i havent reached the threshold limit,so how am i getting this error?). Thanks, Kushal

  • this is the value that i have set in /etc/security/limits.conf * soft nproc 127932 * hard nproc 127932 – kushal bhattacharya Jun 27 '17 at 13:43
  • Please edit the question to show the result of the more detailed command line, where you are not only counting the processes, but the threads (some processes own more than one thread). From info ps, nlwp NLWP number of lwps (threads) in the process. (alias thcount) – sudodus Jun 27 '17 at 14:54
  • 1
    Please see this and this. I was able to get 118000 threads on my test computer. – Doug Smythies Jun 27 '17 at 15:17
  • i ran ps -eo nlwp | tail -n +2 | awk '{ num_threads += $1 } this command to get total number of threads running on the system – kushal bhattacharya Jun 27 '17 at 18:41
  • @DougSmythies could you please elaborate about how you did it ? – kushal bhattacharya Jun 27 '17 at 18:45
  • 1
    I do not know what else to add beyond what is already written here. Keep in mind, my getting to 118000 threads took some effort and actually each task did virtually nothing and used virtually no memory and my system was still on the verge of collapse. I'm saying my test was more academic than showing an actual useful thread limit where real work could also be done. – Doug Smythies Jun 27 '17 at 19:23
  • ok so was all ur threads alive all the time ? – kushal bhattacharya Jun 27 '17 at 19:24
  • actually thats the main concern of mine :( all my threads remain idle for some work to happen gets activated when thereis work so these threads are alive all the time in that way – kushal bhattacharya Jun 27 '17 at 19:26
  • My threads were mostly sleeping. I also did other tests with less and less sleep, but do not recall the limits for those tests. I think you will just have to test your particular use case with your computer to learn what it can handle. – Doug Smythies Jun 27 '17 at 20:50
  • its still not working for me :( is there any other alternative for this problem? – kushal bhattacharya Jun 28 '17 at 06:23
  • hey,do u remember about whether the number of thread count decreased or not with ur different test cases? – kushal bhattacharya Jun 28 '17 at 10:13

0 Answers0