curl-library
RE: Memory when threading curl
Date: Tue, 30 Jun 2009 12:19:41 -0700
Daniel Stenberg wrote:
>
> On Mon, 29 Jun 2009, John D wrote:
>
> > The issue is how much ram curl it is requiring. I literally must
> leave the
> > default stack size within debian at 8mb. So with 16gb of ram I am
> getting
> > 1800-2000 threads. Any more and I will encounter a seg fault in
> relation to
> > thread resources. A lower stack and it is curl's chance to seg
fault.
>
> I know people have used libcurl in more threads with less RAM with no
> problems. Each easy handle allocates perhaps 100K on average. (And if
> we
> wanted to we could work on shrinking that.)
>
We run libcurl on a thread stack of about 4KB. The only issue we have
ever encountered is deep recursion of the dprintf_formatf(), which
allocates
MAX_PARAMETERS * (sizeof(va_stack_t) + sizeof(char *)) +
BUFFSIZE * sizeof(char) + (some misc. vars)
on the stack for each recursion instance. We have our own local
workaround for this, which we haven't generalized and submitted as a
patch....yet.
We don't see issues with HTTPS, but we are using axTLS for our
encryption engine.
GaryM at Casabi
Received on 2009-06-30