<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: pthread_create() in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667267#M798097</link>
    <description>Yep. It has 8 processors.&lt;BR /&gt;&lt;BR /&gt;We have closely monitored the system and don't believe the PTHREAD_THREADS_MAX is being reached. This is currently set to 1024.&lt;BR /&gt;&lt;BR /&gt;Since the log does not provide any more details how can we determine what other resources could be maxed out?&lt;BR /&gt;&lt;BR /&gt;I also noticed that warning about joinable threads and was not sure if that contributes towards PTHREAD_THREADS_MAX. If so is there any way to tell if this value is being exceeded.&lt;BR /&gt;</description>
    <pubDate>Wed, 09 Nov 2005 14:17:28 GMT</pubDate>
    <dc:creator>Krishnan_14</dc:creator>
    <dc:date>2005-11-09T14:17:28Z</dc:date>
    <item>
      <title>pthread_create()</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667262#M798092</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;We are intermittently getting a "pthread_create() failed" error from a standard vendor supplied application in one of our environments alone. We are not able to reproduce this error though. The same application runs fine in other environments without any issue. All the environments are configured alike.&lt;BR /&gt;&lt;BR /&gt;We have the following kernel parms &lt;BR /&gt;max_thread_proc = 1024&lt;BR /&gt;nkthread = 20000&lt;BR /&gt;nproc = 1461&lt;BR /&gt;&lt;BR /&gt;We have monitored the system and have not seen any significant increase in pthreads. The process thread list count monitored via gpm does not go above 70 for this application. The memory utilization is not high as well.&lt;BR /&gt;&lt;BR /&gt;What could be the probable cause for failure. &lt;BR /&gt;&lt;BR /&gt;Detailed error message is given below.&lt;BR /&gt;&lt;BR /&gt;(cthreadpool.cxx:424): cThreadPool_::Add(): pthread_create failed.  (from OS) Resource temporarily unavailable (0x0000000B)&lt;BR /&gt;(cthreadpool.cxx:461): CreateThreadFailed E:0x20200000 (not open)&lt;BR /&gt;(svcmain.cxx:487): ServiceMain(): pThreads-&amp;gt;Add() Failed&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Krishnan&lt;BR /&gt;</description>
      <pubDate>Tue, 08 Nov 2005 21:33:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667262#M798092</guid>
      <dc:creator>Krishnan_14</dc:creator>
      <dc:date>2005-11-08T21:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_create()</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667263#M798093</link>
      <description>Whenever I code any threaded application, I always add a loop to retry after errno is set to EAGAIN on pthread_create(). Since you can't alter your application, I suggest that you carefully compare all the tunables between "good" and "bad" systems. For example, surprisingly, values like maxssiz can impact the number of threads that can be spawned on some flavors of UNIX. Are you watching your number of processes? Are you confident that you have enough swap? Have you compared the patch levels and shared libraries?&lt;BR /&gt;</description>
      <pubDate>Tue, 08 Nov 2005 22:31:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667263#M798093</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-11-08T22:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_create()</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667264#M798094</link>
      <description>Info on server type and OS version might help a bit. Post uname -a output.&lt;BR /&gt;&lt;BR /&gt;thanks!</description>
      <pubDate>Wed, 09 Nov 2005 04:19:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667264#M798094</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2005-11-09T04:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_create()</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667265#M798095</link>
      <description>Thanks for the replies.&lt;BR /&gt;&lt;BR /&gt;The HPUX version is given below.&lt;BR /&gt;HP-UX hp_prod B.11.11 U 9000/800 651359373 unlimited-user license&lt;BR /&gt;&lt;BR /&gt;Our unix admins have verified the kernel parms on both systems and claim they are similar. &lt;BR /&gt;&lt;BR /&gt;The kernel parms that differ between the 2 systems are given below.&lt;BR /&gt;&lt;BR /&gt;Parm  Bad  Good&lt;BR /&gt;bufpages 125000  0&lt;BR /&gt;dbc_max_pct 0  4&lt;BR /&gt;dbc_min_pct 0  4&lt;BR /&gt;ksi_alloc_max 11688  22352&lt;BR /&gt;maxdsiz_64bit 8808038400 4294967296&lt;BR /&gt;maxfiles 2048  4096&lt;BR /&gt;maxfiles_lim 2048  4096&lt;BR /&gt;maxuprc 1168 2235&lt;BR /&gt;maxusers 400  800&lt;BR /&gt;msgmni  1461  2794&lt;BR /&gt;nclist  6500  12900&lt;BR /&gt;ncsize  18856  29520&lt;BR /&gt;nfile  23963  757760&lt;BR /&gt;nflocks  1461  2794&lt;BR /&gt;ninode  13736  24400&lt;BR /&gt;nproc  1461  2794&lt;BR /&gt;nstrtel  400  800&lt;BR /&gt;nsysmap  2922  5588&lt;BR /&gt;nsysmap64 2922  5588&lt;BR /&gt;semmap  2924  5590&lt;BR /&gt;semmni  2922  5588&lt;BR /&gt;semmnu  1457  2790&lt;BR /&gt;swchunk  2048  65536&lt;BR /&gt;unlockable_mem 4000  8000&lt;BR /&gt;&lt;BR /&gt;The bad system is our production server.&lt;BR /&gt;&lt;BR /&gt;Please let me know if changing any of the kernel parms above could help prevent this problem.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Krishnan</description>
      <pubDate>Wed, 09 Nov 2005 12:54:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667265#M798095</guid>
      <dc:creator>Krishnan_14</dc:creator>
      <dc:date>2005-11-09T12:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_create()</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667266#M798096</link>
      <description>Is this a MP system or single proccy system ?&lt;BR /&gt;&lt;BR /&gt;BTW, from the pthread_create() manpage...&lt;BR /&gt;&lt;BR /&gt;[EAGAIN]       &lt;BR /&gt;The necessary resources to create another thread are not available, or the number of threads in the calling process already equals PTHREAD_THREADS_MAX.&lt;BR /&gt;&lt;BR /&gt;And this happens to be the only error which can happen intermittently, all others are related to invalid args (though that too can happen if you keep changing args).&lt;BR /&gt;&lt;BR /&gt;When this problem does occur, does it occur for multiple times in a bunch ?&lt;BR /&gt;&lt;BR /&gt;BTW, the manpage also has a warning saying that if the threads are joinable but have not been joined, then whether or not they contribute towards PTHREAD_THREAD_MAX is undefined, but it may mean that they do, and "gpm" may not show them (not sure)!&lt;BR /&gt;&lt;BR /&gt;- bd&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Nov 2005 14:03:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667266#M798096</guid>
      <dc:creator>Banibrata Dutta</dc:creator>
      <dc:date>2005-11-09T14:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_create()</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667267#M798097</link>
      <description>Yep. It has 8 processors.&lt;BR /&gt;&lt;BR /&gt;We have closely monitored the system and don't believe the PTHREAD_THREADS_MAX is being reached. This is currently set to 1024.&lt;BR /&gt;&lt;BR /&gt;Since the log does not provide any more details how can we determine what other resources could be maxed out?&lt;BR /&gt;&lt;BR /&gt;I also noticed that warning about joinable threads and was not sure if that contributes towards PTHREAD_THREADS_MAX. If so is there any way to tell if this value is being exceeded.&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Nov 2005 14:17:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667267#M798097</guid>
      <dc:creator>Krishnan_14</dc:creator>
      <dc:date>2005-11-09T14:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_create()</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667268#M798098</link>
      <description>What is the value of the max_thread_proc parameter setting in the kernel? Run the below command on both systems and post its output&lt;BR /&gt;&lt;BR /&gt;# kmtune -q max_thread_proc&lt;BR /&gt;&lt;BR /&gt;thanks!</description>
      <pubDate>Wed, 09 Nov 2005 15:42:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667268#M798098</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2005-11-09T15:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_create()</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667269#M798099</link>
      <description>max_thread_proc  1024&lt;BR /&gt;nkthread         20000&lt;BR /&gt;nproc            1461&lt;BR /&gt;maxuprc          1168&lt;BR /&gt;&lt;BR /&gt;Currently we have the above values on the production server which is the bad system.  The good system also has the same values and we don't get this problem there.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Nov 2005 16:11:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667269#M798099</guid>
      <dc:creator>Krishnan_14</dc:creator>
      <dc:date>2005-11-09T16:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_create()</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667270#M798100</link>
      <description>Try increasing the value of max_thread_proc beyond 1024 and see if the problem disappears. Also what are the values of the following parameters on both systems:&lt;BR /&gt;&lt;BR /&gt;maxdsiz&lt;BR /&gt;maxtsiz&lt;BR /&gt;maxssiz</description>
      <pubDate>Wed, 09 Nov 2005 17:44:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667270#M798100</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2005-11-09T17:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_create()</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667271#M798101</link>
      <description>There are simply too many unknowns here nor have you looked at differences in patches or shared libraries. I also see nothing about swapspace. I will say that you have really done one thing that is state of the art dumb. Essentially all of your resources on your production ("bad") box are smaller than their counterparts on the test, development ("good") box. The opposite condition should be true because you want the failures to occur in the test and/or development environment. I would make the test box like the production box and make sure that equivalent patches are applied and then try to reproduce the problem. You then increase one of your tunables at a time until the problem goes away -- in test.&lt;BR /&gt;&lt;BR /&gt;Again, EAGAIN is not a completely unexpected event during pthread_create and the software should cope with what is normally a transient situation --- that is the real fix.</description>
      <pubDate>Wed, 09 Nov 2005 18:22:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667271#M798101</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-11-09T18:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_create()</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667272#M798102</link>
      <description>Thanks for all the responses. I have passed the suggestions to the our unix admins to change the kernel parms this weekend. If we still have this issue I will look for help in this forum again.&lt;BR /&gt;</description>
      <pubDate>Wed, 09 Nov 2005 19:46:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667272#M798102</guid>
      <dc:creator>Krishnan_14</dc:creator>
      <dc:date>2005-11-09T19:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_create()</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667273#M798103</link>
      <description>Do you have measureware on the system ?  If so I would put down the thresholds so you capture process information every minute.  There are metrics that tell you the number of total threads for the OS and threads per process.  Then when the process dies you can go back into the measureware data and see how many threads the process had minutes before.&lt;BR /&gt;&lt;BR /&gt;If you dont have glance and measureware on the system you can load it once and use it for 60 days to "evaluate" the product.&lt;BR /&gt;&lt;BR /&gt;Good luck..</description>
      <pubDate>Wed, 09 Nov 2005 22:37:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667273#M798103</guid>
      <dc:creator>Emil Velez</dc:creator>
      <dc:date>2005-11-09T22:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_create()</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667274#M798104</link>
      <description>Hi Krishnan,&lt;BR /&gt;&lt;BR /&gt;Could you plz answer one of the questions in my previous post, i.e.--&lt;BR /&gt;&lt;BR /&gt;when the pthread_create() error does happen, then do you see a bunch of these (&amp;amp;/ other errors), or this is the single error for a sometime. also, what is the frequency of this error ?&lt;BR /&gt;&lt;BR /&gt;thanks,&lt;BR /&gt;banibrata</description>
      <pubDate>Wed, 09 Nov 2005 23:56:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667274#M798104</guid>
      <dc:creator>Banibrata Dutta</dc:creator>
      <dc:date>2005-11-09T23:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_create()</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667275#M798105</link>
      <description>Hi banibrata&lt;BR /&gt;&lt;BR /&gt;The pthread_create() error is noticed in the applications log. There are no associated problems seen either at the OS or with any other application. As I had indicated this is quite intermittent and we have not been able to reproduce this. The frequency is not consistent as well. Couple of times per week.&lt;BR /&gt;&lt;BR /&gt;Our unix admins have been monitoring the systems closely with gpm, glance etc. and are not able to find any resource issues that might trigger this.&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Nov 2005 16:09:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667275#M798105</guid>
      <dc:creator>Krishnan_14</dc:creator>
      <dc:date>2005-11-10T16:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_create()</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667276#M798106</link>
      <description>Krishnan,&lt;BR /&gt;&lt;BR /&gt;IMHO...the intermittency and frequency of the problem might correlate to load on the server. Your production server maybe getting impacted heavily during those two or three times/week spawning processes that create threads but don't destroy them.&lt;BR /&gt;&lt;BR /&gt;As for your other system where this application runs fine, is that a development box? If that's the case then try ramping up the load on your development box so that it matches production and see if you come across this error again. I'm saying so because many a times the development systems are not stress-tested to production's capacity.&lt;BR /&gt;&lt;BR /&gt;BTW, did you try increasing the max_thread_proc parameter? And what about the kernel values for maxtsiz/maxdsiz/maxssiz on both the systems.&lt;BR /&gt;&lt;BR /&gt;cheers!</description>
      <pubDate>Thu, 10 Nov 2005 21:01:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667276#M798106</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2005-11-10T21:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_create()</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667277#M798107</link>
      <description>Well Krishnan, I think you are on the right track but few things you need to note &amp;amp; do.&lt;BR /&gt;&lt;BR /&gt;1) max_thread_proc is a per-process limit, not a cumulative system limit.&lt;BR /&gt;&lt;BR /&gt;2) nkthread OTOH is a cumulative system limit. so if you have other processes which momentarily create too many thread, of too many processes get spawned with few threads, the nkthread may be hit, even though for your application max_thread_proc is not hit.&lt;BR /&gt;&lt;BR /&gt;so you need to watch out for no. of threads in your application, total number of threads in the system, while monitoring.&lt;BR /&gt;&lt;BR /&gt;One thing you can do though is to reduce the max_thread_proc to say about 80 (since you said your application, at max runs about 70 odd threads), and then see if the frequency of error increases. This may help in faster and controllable reproduction of the problem.&lt;BR /&gt;&lt;BR /&gt;If you are able to reproduce your problem more often, debugging shall become easier. I'd recommend this as the first step, not increasing any of the limits. &lt;BR /&gt;&lt;BR /&gt;my 2 cents,&lt;BR /&gt;bd</description>
      <pubDate>Fri, 11 Nov 2005 03:43:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667277#M798107</guid>
      <dc:creator>Banibrata Dutta</dc:creator>
      <dc:date>2005-11-11T03:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: pthread_create()</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667278#M798108</link>
      <description>Creating thread allocates additional memory (either by sbrk() or by mmap()) for its stack, thus when this call fail, pthread_create() fails too.&lt;BR /&gt;&lt;BR /&gt;Tru to install "tusc" to trace system calls, and check the mmap()/sbrk() calls for failures.&lt;BR /&gt;</description>
      <pubDate>Fri, 18 Nov 2005 07:56:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/pthread-create/m-p/3667278#M798108</guid>
      <dc:creator>Alexey Roytman</dc:creator>
      <dc:date>2005-11-18T07:56:14Z</dc:date>
    </item>
  </channel>
</rss>

