Ya, it does seem to reproduce. Maybe the first step to investigating is to 
write a super-minimal Julia server that does nothing but listens for TCP 
connections, spawn a task which sends a fixed response on accepted connection, 
and then closes the socket.If that still has this problem, then it might relate 
to a low-level issue with tasks/libuv. 

> On Oct 16, 2015, at 8:52 AM, nikolai.mar...@icloud.com wrote:
> 
> Sure, here it is: https://github.com/JuliaWeb/HttpServer.jl/issues/78
> I hope you can reproduce this behaviour.
> 
> Any ideas how to investigate it?
> 
> On Friday, October 16, 2015 at 4:29:44 PM UTC+3, Jonathan Malmaud wrote:
> Can you file this as an issue on https://github.com/JuliaWeb/HttpServer.jl 
> <https://github.com/JuliaWeb/HttpServer.jl>? 
> 
> On Friday, October 16, 2015 at 7:31:34 AM UTC-5, nikolai...@icloud.com <> 
> wrote:
> Status update.
> 
> I have updated to Julia 0.4 and added keep-alive support to HttpServer and 
> now ab -k works quite fine.
> However when there is no keep-alive and each request is made in a separate 
> connection, then Julia still hangs around request #16k.
> My first idea of how to profile it was this:
> 
> using HttpServer
> gc_enable(false)
> const Z = "HELLO WORLD"
> c = 0s = open("./prof.txt", "w")
> http = HttpHandler() do req::Request, res::Response
>    global c    r = Response(Z)    c += 1    if c == 16000       
> Profile.clear()
>    end    if c > 16428
>       c = 0       Profile.print(s, C=true, cols=500)       close(s)    end    
> rend
> server = Server( http )
> @profile run( server, 8000 )
> 
> However the output I got is 19k lines long and I have no idea how to use it. 
> Here's a top of it:
> 3     /private/tmp/julia20151012-99535-1c7kouk/src/builtins.c; jl_egal; line: 
> 3061     /private/tmp/julia20151012-99535-1c7kouk/src/builtins.c; jl_f_isa; 
> line: 3701     /private/tmp/julia20151012-99535-1c7kouk/src/gc.c; 
> jl_gc_alloc_3w; line: 23321     
> /private/tmp/julia20151012-99535-1c7kouk/src/gf.c; jl_apply_generic; line: 
> 17111     /private/tmp/julia20151012-99535-1c7kouk/src/jltypes.c; jl_is_type; 
> line: 691     /private/tmp/julia20151012-99535-1c7kouk/src/jltypes.c; 
> jl_subtype_le; line: 25591683  
> /private/tmp/julia20151012-99535-1c7kouk/src/task.c; jl_apply; line: 2415     
> /private/tmp/julia20151012-99535-1c7kouk/src/task.c; throw_if_exception_set; 
> line: 2301     /usr/lib/system/libsystem_c.dylib; strlen; (unknown line)1     
> /usr/lib/system/libsystem_kernel.dylib; __accept; (unknown line)1     
> /usr/lib/system/libsystem_kernel.dylib; __ioctl; (unknown line)7     
> /usr/lib/system/libsystem_kernel.dylib; close; (unknown line)26463 
> /usr/lib/system/libsystem_kernel.dylib; kevent; (unknown line)4     
> /usr/lib/system/libsystem_kernel.dylib; mach_timebase_info; (unknown line)1   
>   /usr/lib/system/libsystem_kernel.dylib; read; (unknown line)4     
> /usr/lib/system/libsystem_kernel.dylib; shutdown; (unknown line)30    
> /usr/lib/system/libsystem_kernel.dylib; write; (unknown line)39    
> /usr/lib/system/libsystem_platform.dylib; _platform_bzero$VARIANT$Unknown; 
> (unknown line)2     /usr/lib/system/libsystem_platform.dylib; 
> _platform_memcmp; (unknown line)5     
> /usr/lib/system/libsystem_platform.dylib; _platform_memmove$VARIANT$Unknown; 
> (unknown line)1     /usr/lib/system/libsystem_platform.dylib; 
> _platform_memset$VARIANT$Unknown; (unknown line)2     
> /usr/lib/system/libsystem_platform.dylib; _setjmp; (unknown line)1     /
> ...

Reply via email to