qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Toralf Lund <toralf.l...@pgs.com>
Subject Re: QPid 0.22 C++ client threading
Date Mon, 03 Nov 2014 14:52:41 GMT
On 31/10/14 16:13, Gordon Sim wrote:
> On 10/30/2014 01:30 PM, Toralf Lund wrote:
>> Hi,
>>
>> We have encountered a problem with an application using QPid 0.22/APQP
>> 0.10 with the C++ messaging API, which could be caused by creation of an
>> excessive number of threads. This might not be related to QPid, and the
>> issue may not even be threading in this application (the problem occurs
>> once every blue moon, so it's a bit hard to test theories), but in order
>> to get a clear picture of the situation, it would be good to know what
>> threads QPid creates, and if there are any issues with threading. Some
>> questions:
>>
>>   * When exactly does QPid create a new thread?
>
> There is a shared thread pool for all 0-10 connections, used for IO. 
> The maximum size is controlled by the max-iothreads option. This is by 
> default set to be the number of available cores (or 1 if that cannot 
> be determined), but can be overidden  e.g. by setting 
> QPID_MAX_IOTHREADS). The pool starts out empty and the size is 
> increased as connections are added, up to the configured limit. At 
> present there is nothing that will kill off threads once created however.
>
> In addition there is a single timer thread that is used for heartbeat 
> related time activities.
OK. Thanks.

>
>>   * Are there any known situations where one might end up with lots of
>>     runaway threads?
>
> Nothing known, no.
Good.

>
>>   * Do I have to do anything specific e.g. after a communication error
>>     in order to make sure old threads go away?
>
> No.
>
> [...]
>> The actual problem I'm talking about is that a pthread_create() call
>> used for something unrelated will sometimes fail with EAGAIN.
>
> Could you perhaps have a cron job that does a ptrace on the process in 
> question periodically, and stores it in a file somewhere, so that you 
> can see what threads were present if and when the problem occurs again?
Yes, that's probably a good idea.

So far I've focused on looking for memory leaks (which I'm assuming may 
also cause this kind of problem), but I haven't found anything.

Thanks.

- Toralf


>
>> An information anyone might have about the threading behaviour of QPid
>> would be helpful.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>


This e-mail, including any attachments and response string, may contain proprietary information
which is confidential and may be legally privileged. It is for the intended recipient only.
If you are not the intended recipient or transmission error has misdirected this e-mail, please
notify the author by return e-mail and delete this message and any attachment immediately.
If you are not the intended recipient you must not use, disclose, distribute, forward, copy,
print or rely on this e-mail in any way except as permitted by the author.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Mime
View raw message