Re: [go-nuts] runtime/cgo: pthread_create failed: Resource temporarily unavailable

2020-02-05 Thread Robert Engels
>> the input stage hangs (you tube download hangs, etc.), the whole process >>>> is going to hang. >>>> >>>> Did you debug the number of threads and go routines the process has while >>>> running? I am betting these are continually increas

Re: [go-nuts] runtime/cgo: pthread_create failed: Resource temporarily unavailable

2020-02-05 Thread Robert Engels
>>> >>> Did you debug the number of threads and go routines the process has while >>> running? I am betting these are continually increasing. (Another check >>> would be that all Waits() complete). >>> >>> Finally, I would use a CommandContext

Re: [go-nuts] runtime/cgo: pthread_create failed: Resource temporarily unavailable

2020-02-05 Thread jnaderlowe
process has while >> running? I am betting these are continually increasing. (Another check >> would be that all Waits() complete). >> >> Finally, I would use a CommandContext with a Deadline to ensure >> stragglers are cleaned-up. >> >> >> &

Re: [go-nuts] runtime/cgo: pthread_create failed: Resource temporarily unavailable

2020-02-05 Thread Robert Engels
rs >> are cleaned-up. >> >> >> >> -Original Message- >> >From: Ian Lance Taylor >> >Sent: Feb 5, 2020 8:32 AM >> >To: jnade...@gmail.com >> >Cc: golang-nuts >> >Subject: Re: [go-nuts] runtime/cgo: pthrea

Re: [go-nuts] runtime/cgo: pthread_create failed: Resource temporarily unavailable

2020-02-05 Thread jnaderlowe
gt; are cleaned-up. > > > > -Original Message- > >From: Ian Lance Taylor > > >Sent: Feb 5, 2020 8:32 AM > >To: jnade...@gmail.com > >Cc: golang-nuts > > >Subject: Re: [go-nuts] runtime/cgo: pthread_create failed: Resource > tem

Re: [go-nuts] runtime/cgo: pthread_create failed: Resource temporarily unavailable

2020-02-05 Thread Robert Engels
) complete). Finally, I would use a CommandContext with a Deadline to ensure stragglers are cleaned-up. -Original Message- >From: Ian Lance Taylor >Sent: Feb 5, 2020 8:32 AM >To: jnaderl...@gmail.com >Cc: golang-nuts >Subject: Re: [go-nuts] runtime/cgo: pthrea

Re: [go-nuts] runtime/cgo: pthread_create failed: Resource temporarily unavailable

2020-02-05 Thread Ian Lance Taylor
On Tue, Feb 4, 2020 at 11:22 PM wrote: > > I don't think that is the issue. I have tried it on a few different servers. > Most recent one with 100 gig's of ram and 50 cores. The load average never > goes above 9, but the ram slowly but surely on htop starts to go up. The go > binary ends up

Re: [go-nuts] runtime/cgo: pthread_create failed: Resource temporarily unavailable

2020-02-04 Thread jnaderlowe
I don't think that is the issue. I have tried it on a few different servers. Most recent one with 100 gig's of ram and 50 cores. The load average never goes above 9, but the ram slowly but surely on htop starts to go up. The go binary ends up climbing slowly in it's ram use over time, then

Re: [go-nuts] runtime/cgo: pthread_create failed: Resource temporarily unavailable

2020-02-04 Thread Robert Engels
Are you certain you are not just starting too many processes? Ie use a “worker pool” so you have at most N conversions happening at the same time. > On Feb 4, 2020, at 2:34 PM, Robert Engels wrote: > >  > I will take a more in-depth look this evening. > >>> On Feb 4, 2020, at 2:19 PM, jnade

Re: [go-nuts] runtime/cgo: pthread_create failed: Resource temporarily unavailable

2020-02-04 Thread Robert Engels
I will take a more in-depth look this evening. > On Feb 4, 2020, at 2:19 PM, jnaderl...@gmail.com wrote: > >  > I also thought the Wait() took care of closing the file descriptors? Are you > saying I should add a pipe3.Close()? Or a youtube.Close()? > -- > You received this message because yo

Re: [go-nuts] runtime/cgo: pthread_create failed: Resource temporarily unavailable

2020-02-04 Thread jnaderlowe
I also thought the Wait() took care of closing the file descriptors? Are you saying I should add a pipe3.Close()? Or a youtube.Close()? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from

Re: [go-nuts] runtime/cgo: pthread_create failed: Resource temporarily unavailable

2020-02-04 Thread jnaderlowe
After spending some time in the gophers slack chat, I ended up changing the fuction to this func pipeThruFfmpegToMp4(vi *VideoInfo, rw web.ResponseWriter) error { var ffmpeg *exec.Cmd ffmpeg = exec.Command( "ffmpeg", "-i", "-", "-i", "pipe:3", "-c:v", "cop

Re: [go-nuts] runtime/cgo: pthread_create failed: Resource temporarily unavailable

2020-02-04 Thread Robert Engels
When you reassign the file descriptors you need to close the old ones - this does not happen automatically. You also need to close the ffmpeg fds. By not closing the descriptors the pipe structures are remaining in the kernel. That’s my first guess anyway. > On Feb 4, 2020, at 7:21 AM, jnade

[go-nuts] runtime/cgo: pthread_create failed: Resource temporarily unavailable

2020-02-04 Thread jnaderlowe
Hi everyone, I posted this question on StackOverfow here with a 200 point bounty, but per the git issue I opened here , someone suggested