Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-14 Thread Nikita Tsukanov
Should be fixed with
https://github.com/mono/mono/commit/a31b580fdcbaa9a8a16d59ffb12d04f5872f54e8

Please, try to compile a fresh version of mono and check if the issue is
still present.


2013/8/13 Nikita Tsukanov kek...@gmail.com

 I've filled a bug report:
 https://bugzilla.xamarin.com/show_bug.cgi?id=13933 (also increased thread
 count from 2 to 10 to make it easier to reproduce the issue).


 2013/8/12 Nikita Tsukanov kek...@gmail.com


 Oh, great. I've got lockup and segfault (on different runs) with this
 code:
  static INancyEngine _engine;

 public static void Main(string[] args)
 {
 var pool = new SmartThreadPool ();


 var bt = new DefaultNancyBootstrapper ();
 bt.Initialise ();
 _engine = bt.GetEngine ();
 for (int c=0; c2; c++)
 new Thread (ThreadProc).Start ();
 Thread.Sleep (-1);
 }

 static void ThreadProc ()
 {
 int crid = 0;
 while (true) {
 crid ++;
 var resp = _engine.HandleRequest (

 new Request (GET, /,
  new Dictionarystring,
 IEnumerablestring (),
  RequestStream.FromStream (
 new MemoryStream (), 0, 0), http, , 127.0.0.1));
 resp.Response.Contents (new MemoryStream
 ());
 Console.WriteLine (Request #{0} done,
 crid);
 }
 }

 It just uses nancyfx engine from 2 threads.



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-14 Thread Alfred Hall
So far so good, done few tests and no lockups.
-Original message-
From: Nikita Tsukanov kek...@gmail.com
Sent: Wednesday 14th August 2013 15:04
To: mono-devel-list@lists.ximian.com
Subject: Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux


Should be fixed with 
https://github.com/mono/mono/commit/a31b580fdcbaa9a8a16d59ffb12d04f5872f54e8

Please, try to compile a fresh version of mono and check if the issue is still 
present.


2013/8/13 Nikita Tsukanov kek...@gmail.com mailto:kek...@gmail.com 
I've filled a bug report: https://bugzilla.xamarin.com/show_bug.cgi?id=13933 
(also increased thread count from 2 to 10 to make it easier to reproduce the 
issue).


2013/8/12 Nikita Tsukanov kek...@gmail.com mailto:kek...@gmail.com 

Oh, great. I've got lockup and segfault (on different runs) with this code:
                static INancyEngine _engine;

public static void Main(string[] args)
{
var pool = new SmartThreadPool ();


var bt = new DefaultNancyBootstrapper ();
bt.Initialise ();
_engine = bt.GetEngine ();
for (int c=0; c2; c++)
new Thread (ThreadProc).Start ();
Thread.Sleep (-1);
}

static void ThreadProc ()
{
int crid = 0;
while (true) {
crid ++;
var resp = _engine.HandleRequest (

new Request (GET, /,
 new Dictionarystring, 
IEnumerablestring (),
 RequestStream.FromStream (new 
MemoryStream (), 0, 0), http, , 127.0.0.1));
resp.Response.Contents (new MemoryStream ());
Console.WriteLine (Request #{0} done, crid);
}
}  

It just uses nancyfx engine from 2 threads.



___

Mono-devel-list mailing list

Mono-devel-list@lists.ximian.com

http://lists.ximian.com/mailman/listinfo/mono-devel-list



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-12 Thread Nikita Tsukanov
Hello.
I've reproduced the problem without ANY I/O only with NancyFx.

Following code leads to lock up:

 class MainClass
{
public static void Main(string[] args)
{
var bt = new DefaultNancyBootstrapper ();
bt.Initialise ();
var engine = bt.GetEngine ();
int rid = 0;
while (true)
{
var crid = rid++;

ThreadPool.QueueUserWorkItem (_ =
{
var resp = engine.HandleRequest (
new Request (GET, /,
  new Dictionarystring,
 IEnumerablestring (),
  RequestStream.
FromStream (new MemoryStream (), 0, 0), http, , 127.0.0.1));
resp.Response.Contents (new
MemoryStream ());
Console.WriteLine(Request #{0} done
, crid);
});
Console.WriteLine(Request #{0} added, crid
);

}
}


}

public class TestController : NancyModule
{
public TestController ()
{
Get [/] = _ = test;
}
}


It works fine with mono 2.10.8 from Ubuntu repos.




2013/8/8 Nikita Tsukanov kek...@gmail.com

 I'm unable to reproduce the issue with HttpListener/Sockets alone. It
 needs INancyEngine.ProcessReqiest() somewhere in request processing
 pipeline. So I'm still investigating, what conditions are needed to
 repoduce the bug (and I suspect that it doesn't have to do with I/O at all,
 since it reproduces even with my hand-made send/recv sockets backend).


 2013/8/7 Andrés G. Aragoneses kno...@gmail.com

 If you're able to reproduce it with 3.3 and not with 2.10.x, you should
 definitely open a bug report for it in http://bugzilla.xamarin.com/stating 
 [regression] in the bug summary.

 Also, I would open a separate bug report for the segfault you're getting
 when running with MONO_DISABLE_AIO (pasting the backtrace of the segfault,
 with debug symbols installed).


 On 07/08/13 14:02, Alfred Hall wrote:

 Tried running it with sgen or boehm on 2.10? Worth trying both I think.
 Also how about 3.3 (master) ?

 -Original message-
 *From:* Nikita Tsukanov kek...@gmail.com
 *Sent:* Wednesday 7th August 2013 12:54
 *To:* 
 mono-devel-list@lists.ximian.**commono-devel-list@lists.ximian.com
 *Subject:* Re: [Mono-dev] NancyFX self hosting (HttpListener)

 locking up on linux

 I've rewritten my SCGI server to work with TPL directly instead of
 using async/await to make it run on mono 2.10. Then I've tried to
 run it with mono 2.10.8.1 and mono 3.2 with System.Net.Sockets
 backend and to hammer it with jmeter. 500K requests without any
 lockups on Mono 2.10, lockup at 22164th request on mono 3.2.

 Server source code is still on GitHub -
 
 https://github.com/kekekeks/**scgi-sharphttps://github.com/kekekeks/scgi-sharp


 2013/8/7 Greg Young gregoryyou...@gmail.com
 mailto:gregoryyoung1@gmail.**com gregoryyou...@gmail.com


 I believe attaching a debugger changes things like optimizations
 from occurring (not positive but it does in clr)


 On Wednesday, August 7, 2013, Nikita Tsukanov wrote:

 Huh, it doesn't require debugger to be _attched_, just
 debugging subsystem initialized i. e. if I launch this
 program as a debugger it doesn't lock up.

 publicstaticvoidMain(string[]**args)
 {
 intport=27042;
 if(args.Length !=0)
 port=int.Parse(args[0]);
 while(true)
 {
 varvm= Mono.Debugger.Soft.**VirtualMachineManager.Listen(**
 newIPEndPoint(IPAddress.**Loopback,port));
 vm.Resume();
 vm.Detach();
 }
 }

 I'll use running with
 --debugger-agent=transport=dt_**socket,address=
 127.0.0.1:27042
 http://127.0.0.1:27042 as a temporary workaround since

 performance doesn't degrade a lot.


 2013/8/7 Nikita Tsukanov kek...@gmail.com

 I suspect that the problem is actually with thread pool
 itself. I've created socket layer implementation using
 libevent (wrapped with Oars) and send/recv that utilizes
 thread pool for cases when it's unable to complete
 operation synchronously. It survives longer, but still
 locks up after a while. Same behavior with debugger -
 I'm unable to reproduce

Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-12 Thread Nikita Tsukanov
Oh, great. I've got lockup and segfault (on different runs) with this code:
 static INancyEngine _engine;
public static void Main(string[] args)
{
var pool = new SmartThreadPool ();

var bt = new DefaultNancyBootstrapper ();
bt.Initialise ();
_engine = bt.GetEngine ();
for (int c=0; c2; c++)
new Thread (ThreadProc).Start ();
Thread.Sleep (-1);
}

static void ThreadProc ()
{
int crid = 0;
while (true) {
crid ++;
var resp = _engine.HandleRequest (
new Request (GET, /,
 new Dictionarystring,
IEnumerablestring (),
 RequestStream.FromStream (new
MemoryStream (), 0, 0), http, , 127.0.0.1));
resp.Response.Contents (new MemoryStream ())
;
Console.WriteLine (Request #{0} done, crid
);
}
}

It just uses nancyfx engine from 2 threads.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-12 Thread Nikita Tsukanov
I've filled a bug report:
https://bugzilla.xamarin.com/show_bug.cgi?id=13933(also increased
thread count from 2 to 10 to make it easier to reproduce
the issue).


2013/8/12 Nikita Tsukanov kek...@gmail.com


 Oh, great. I've got lockup and segfault (on different runs) with this code:
  static INancyEngine _engine;

 public static void Main(string[] args)
 {
 var pool = new SmartThreadPool ();


 var bt = new DefaultNancyBootstrapper ();
 bt.Initialise ();
 _engine = bt.GetEngine ();
 for (int c=0; c2; c++)
 new Thread (ThreadProc).Start ();
 Thread.Sleep (-1);
 }

 static void ThreadProc ()
 {
 int crid = 0;
 while (true) {
 crid ++;
 var resp = _engine.HandleRequest (

 new Request (GET, /,
  new Dictionarystring,
 IEnumerablestring (),
  RequestStream.FromStream (new
  MemoryStream (), 0, 0), http, , 127.0.0.1));
 resp.Response.Contents (new MemoryStream
 ());
 Console.WriteLine (Request #{0} done,
 crid);
 }
 }

 It just uses nancyfx engine from 2 threads.

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-08 Thread Alfred Hall
Nikita: Have you filed a bug for this yet? If so please give me the bug number 
so I can follow it.


-Original message-
 From:quot;Andrés G. Aragonesesquot; kno...@gmail.com 
 mailto:kno...@gmail.com 
 Sent: Wednesday 7th August 2013 13:15
 To: mono-devel-list@lists.ximian.com 
 mailto:mono-devel-list@lists.ximian.com 
 Subject: Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on 
 linux
 
 If you're able to reproduce it with 3.3 and not with 2.10.x, you should 
 definitely open a bug report for it in http://bugzilla.xamarin.com 
 http://bugzilla.xamarin.com / 
 stating [regression] in the bug summary.
 
 Also, I would open a separate bug report for the segfault you're getting 
 when running with MONO_DISABLE_AIO (pasting the backtrace of the 
 segfault, with debug symbols installed).
 
 On 07/08/13 14:02, Alfred Hall wrote:
  Tried running it with sgen or boehm on 2.10? Worth trying both I think.
  Also how about 3.3 (master) ?
 
  -Original message-
  *From:* Nikita Tsukanov kek...@gmail.com mailto:kek...@gmail.com 
  *Sent:* Wednesday 7th August 2013 12:54
  *To:* mono-devel-list@lists.ximian.com 
  mailto:mono-devel-list@lists.ximian.com 
  *Subject:* Re: [Mono-dev] NancyFX self hosting (HttpListener)
  locking up on linux
 
  I've rewritten my SCGI server to work with TPL directly instead of
  using async/await to make it run on mono 2.10. Then I've tried to
  run it with mono 2.10.8.1 and mono 3.2 with System.Net.Sockets
  backend and to hammer it with jmeter. 500K requests without any
  lockups on Mono 2.10, lockup at 22164th request on mono 3.2.
 
  Server source code is still on GitHub -
  https://github.com/kekekeks/scgi-sharp
 
 
  2013/8/7 Greg Young gregoryyou...@gmail.com 
  mailto:gregoryyou...@gmail.com 
  mailto:gregoryyou...@gmail.com mailto:gregoryyou...@gmail.com 
 
  I believe attaching a debugger changes things like optimizations
  from occurring (not positive but it does in clr)
 
 
  On Wednesday, August 7, 2013, Nikita Tsukanov wrote:
 
  Huh, it doesn't require debugger to be _attched_, just
  debugging subsystem initialized i. e. if I launch this
  program as a debugger it doesn't lock up.
 
  publicstaticvoidMain(string[]args)
  {
  intport=27042;
  if(args.Length !=0)
  port=int.Parse(args[0]);
  while(true)
  {
  varvm= 
  Mono.Debugger.Soft.VirtualMachineManager.Listen(newIPEndPoint(IPAddress.Loopback,port));
  vm.Resume();
  vm.Detach();
  }
  }
 
  I'll use running with
  --debugger-agent=transport=dt_socket,address=127.0.0.1:27042
  http://127.0.0.1:27042 as a temporary workaround since
  performance doesn't degrade a lot.
 
 
  2013/8/7 Nikita Tsukanov kek...@gmail.com 
  mailto:kek...@gmail.com 
 
  I suspect that the problem is actually with thread pool
  itself. I've created socket layer implementation using
  libevent (wrapped with Oars) and send/recv that utilizes
  thread pool for cases when it's unable to complete
  operation synchronously. It survives longer, but still
  locks up after a while. Same behavior with debugger -
  I'm unable to reproduce the issue when running under it.
  I also unable to grab thread stack traces, it prints
  Full thread dump:  and nothing else.
 
 
  2013/8/7 Greg Young gregoryyou...@gmail.com 
  mailto:gregoryyou...@gmail.com 
 
  We will see your test then as it will probably
  affect us as well
 
 
  On Tuesday, August 6, 2013, Nikita Tsukanov wrote:
 
  Greg, I've tried running my server with mono
  compiled from master (with pull request #703
  merged in), still freezes after a while.
 
 
  2013/8/7 Greg Young gregoryyou...@gmail.com 
  mailto:gregoryyou...@gmail.com 
 
  Do you have our pull req? We are stable
  after (and seriously read history of this list)
 
 
  On Tuesday, August 6, 2013, Nikita Tsukanov
  wrote:
 
  https://github.com/kekekeks/scgi-sharp -
  here is my SCGI server with host for
  NancyFx. If you run Sandbox.exe with
  --echo-server it will not use nancy
  infrastructure and will respond
  directly. It locks up after several

Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-08 Thread Nikita Tsukanov
I'm unable to reproduce the issue with HttpListener/Sockets alone. It needs
INancyEngine.ProcessReqiest() somewhere in request processing pipeline. So
I'm still investigating, what conditions are needed to repoduce the bug
(and I suspect that it doesn't have to do with I/O at all, since it
reproduces even with my hand-made send/recv sockets backend).


2013/8/7 Andrés G. Aragoneses kno...@gmail.com

 If you're able to reproduce it with 3.3 and not with 2.10.x, you should
 definitely open a bug report for it in http://bugzilla.xamarin.com/stating 
 [regression] in the bug summary.

 Also, I would open a separate bug report for the segfault you're getting
 when running with MONO_DISABLE_AIO (pasting the backtrace of the segfault,
 with debug symbols installed).


 On 07/08/13 14:02, Alfred Hall wrote:

 Tried running it with sgen or boehm on 2.10? Worth trying both I think.
 Also how about 3.3 (master) ?

 -Original message-
 *From:* Nikita Tsukanov kek...@gmail.com
 *Sent:* Wednesday 7th August 2013 12:54
 *To:* 
 mono-devel-list@lists.ximian.**commono-devel-list@lists.ximian.com
 *Subject:* Re: [Mono-dev] NancyFX self hosting (HttpListener)

 locking up on linux

 I've rewritten my SCGI server to work with TPL directly instead of
 using async/await to make it run on mono 2.10. Then I've tried to
 run it with mono 2.10.8.1 and mono 3.2 with System.Net.Sockets
 backend and to hammer it with jmeter. 500K requests without any
 lockups on Mono 2.10, lockup at 22164th request on mono 3.2.

 Server source code is still on GitHub -
 
 https://github.com/kekekeks/**scgi-sharphttps://github.com/kekekeks/scgi-sharp


 2013/8/7 Greg Young gregoryyou...@gmail.com
 mailto:gregoryyoung1@gmail.**com gregoryyou...@gmail.com


 I believe attaching a debugger changes things like optimizations
 from occurring (not positive but it does in clr)


 On Wednesday, August 7, 2013, Nikita Tsukanov wrote:

 Huh, it doesn't require debugger to be _attched_, just
 debugging subsystem initialized i. e. if I launch this
 program as a debugger it doesn't lock up.

 publicstaticvoidMain(string[]**args)
 {
 intport=27042;
 if(args.Length !=0)
 port=int.Parse(args[0]);
 while(true)
 {
 varvm= Mono.Debugger.Soft.**VirtualMachineManager.Listen(**
 newIPEndPoint(IPAddress.**Loopback,port));
 vm.Resume();
 vm.Detach();
 }
 }

 I'll use running with
 --debugger-agent=transport=dt_**socket,address=
 127.0.0.1:27042
 http://127.0.0.1:27042 as a temporary workaround since

 performance doesn't degrade a lot.


 2013/8/7 Nikita Tsukanov kek...@gmail.com

 I suspect that the problem is actually with thread pool
 itself. I've created socket layer implementation using
 libevent (wrapped with Oars) and send/recv that utilizes
 thread pool for cases when it's unable to complete
 operation synchronously. It survives longer, but still
 locks up after a while. Same behavior with debugger -
 I'm unable to reproduce the issue when running under it.
 I also unable to grab thread stack traces, it prints
 Full thread dump:  and nothing else.


 2013/8/7 Greg Young gregoryyou...@gmail.com

 We will see your test then as it will probably
 affect us as well


 On Tuesday, August 6, 2013, Nikita Tsukanov wrote:

 Greg, I've tried running my server with mono
 compiled from master (with pull request #703
 merged in), still freezes after a while.


 2013/8/7 Greg Young gregoryyou...@gmail.com

 Do you have our pull req? We are stable
 after (and seriously read history of this
 list)


 On Tuesday, August 6, 2013, Nikita Tsukanov
 wrote:

 
 https://github.com/kekekeks/**scgi-sharphttps://github.com/kekekeks/scgi-sharp-
 here is my SCGI server with host for
 NancyFx. If you run Sandbox.exe with
 --echo-server it will not use nancy
 infrastructure and will respond
 directly. It locks up after several
 thousands of requests under jmeter.

 Simple nginx configuration:

 location

Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-07 Thread Nikita Tsukanov
Huh, it doesn't require debugger to be _attched_, just debugging subsystem
initialized i. e. if I launch this program as a debugger it doesn't lock
up.

public static void Main (string[] args)
{
  int port = 27042;
  if (args.Length != 0)
port = int.Parse (args [0]);
  while (true)
  {
var vm = Mono.Debugger.Soft.VirtualMachineManager.Listen (new IPEndPoint
 (IPAddress.Loopback, port));
vm.Resume ();
vm.Detach ();
  }
}

I'll use running with --debugger-agent=transport=dt_socket,address=
127.0.0.1:27042 as a temporary workaround since performance doesn't degrade
a lot.


2013/8/7 Nikita Tsukanov kek...@gmail.com

 I suspect that the problem is actually with thread pool itself. I've
 created socket layer implementation using libevent (wrapped with Oars) and
 send/recv that utilizes thread pool for cases when it's unable to complete
 operation synchronously. It survives longer, but still locks up after a
 while. Same behavior with debugger - I'm unable to reproduce the issue when
 running under it. I also unable to grab thread stack traces, it prints
 Full thread dump:  and nothing else.


 2013/8/7 Greg Young gregoryyou...@gmail.com

 We will see your test then as it will probably affect us as well


 On Tuesday, August 6, 2013, Nikita Tsukanov wrote:

 Greg, I've tried running my server with mono compiled from master (with
 pull request #703 merged in), still freezes after a while.


 2013/8/7 Greg Young gregoryyou...@gmail.com

 Do you have our pull req? We are stable after (and seriously read
 history of this list)


 On Tuesday, August 6, 2013, Nikita Tsukanov wrote:

 https://github.com/kekekeks/scgi-sharp - here is my SCGI server with
 host for NancyFx. If you run Sandbox.exe with --echo-server it will not use
 nancy infrastructure and will respond directly. It locks up after several
 thousands of requests under jmeter.

 Simple nginx configuration:

 location /
 {
include /etc/nginx/scgi_params;
scgi_pass 127.0.0.1:10081;
 }

 Now I'm looking for alternative socket library to use it as a
 replacement for System.Net.Sockets.


 2013/8/6 Greg Young gregoryyou...@gmail.com

 Actually not that surprised we also found out file stream.flush(true)
 only works sometimes and ms never back supported it to actually work :)


 On Tuesday, August 6, 2013, Alfred Hall wrote:

 **
 Yeah you're having exactly the same issues as I am. I'm surprised others
 haven't had this problem before. Not sure who works on this area of the
 mono codebase these days. If you got a minimal test case it may be worth us
 raising a Xamarin bug in bugzilla.

 -Original message-
 *From:* Nikita Tsukanov kek...@gmail.com
 *Sent:* Tuesday 6th August 2013 20:18
 *To:* mono-devel-list@lists.ximian.com
 *Subject:* Re: [Mono-dev] NancyFX self hosting (HttpListener) locking
 up on linux

 Running with mono from master haven't helped.

 And I'm not sure what the hell is going on, but I cann't reproduce the
 issue when running under... Monodevelop's debugger. It runs perfectly under
 it, but when I try to run the same binary from console (even with --debug
 option) it locks up or segfaults. Does anyone know what does it mean?


 2013/8/6 Nikita Tsukanov kek...@gmail.com

 Great. It locked up with my more complex logic.
 Funny fact: NancyFx increases request processing time from 2ms to 70ms
 with the same echo response.
 Another funny fact: with MONO_DISABLE_AIO I've got segfault.

 Now I'll try to use build patched mono. Not sure that it's the same
 issue, because in my case it never tries to read and write simultaneously
  on the same socket.


 2013/8/6 Greg Young gregoryyou...@gmail.com

 There are many cases the patch we provided does not affect eg no overlap
 in io between send/receive


 On Tuesday, August 6, 2013, Nikita Tsukanov wrote:

 Interesting... I've written a simple server using only
 Socket.BeginRecieve and Socket.BeginSend. It just reads 100 bytes and then
 sends hardcoded HTTP response. Now jmeter is working for 5 minutes and it
 still responds with Lorem ipsum ... perfectly. I'll try to port my SCGI
 server logic from NetworkStream to Socket and see what will happen.


 2013/8/6 Andrés G. Aragoneses kno...@gmail.com

 On 06/08/13 18:42, Nikita Tsukanov wrote:

 Ubuntu 13.04, Mono JIT compiler version 3.2.0 (tarball Tue Jul 30
 21:08:00 UTC 2013)


 Mono 3.2.0 does *not* hav



 --
 Le doute n'est pas une condition agréable, mais la certitude est absurde.



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-07 Thread Greg Young
I believe attaching a debugger changes things like optimizations from
occurring (not positive but it does in clr)

On Wednesday, August 7, 2013, Nikita Tsukanov wrote:

 Huh, it doesn't require debugger to be _attched_, just debugging subsystem
 initialized i. e. if I launch this program as a debugger it doesn't lock
 up.

 public static void Main (string[] args)
 {
   int port = 27042;
   if (args.Length != 0)
 port = int.Parse (args [0]);
   while (true)
   {
 var vm = Mono.Debugger.Soft.VirtualMachineManager.Listen (new
 IPEndPoint (IPAddress.Loopback, port));
 vm.Resume ();
 vm.Detach ();
   }
 }

 I'll use running with --debugger-agent=transport=dt_socket,address=
 127.0.0.1:27042 as a temporary workaround since performance doesn't
 degrade a lot.


 2013/8/7 Nikita Tsukanov kek...@gmail.com

 I suspect that the problem is actually with thread pool itself. I've
 created socket layer implementation using libevent (wrapped with Oars) and
 send/recv that utilizes thread pool for cases when it's unable to complete
 operation synchronously. It survives longer, but still locks up after a
 while. Same behavior with debugger - I'm unable to reproduce the issue when
 running under it. I also unable to grab thread stack traces, it prints
 Full thread dump:  and nothing else.


 2013/8/7 Greg Young gregoryyou...@gmail.com

 We will see your test then as it will probably affect us as well


 On Tuesday, August 6, 2013, Nikita Tsukanov wrote:

 Greg, I've tried running my server with mono compiled from master (with
 pull request #703 merged in), still freezes after a while.


 2013/8/7 Greg Young gregoryyou...@gmail.com

 Do you have our pull req? We are stable after (and seriously read history
 of this list)


 On Tuesday, August 6, 2013, Nikita Tsukanov wrote:

 https://github.com/kekekeks/scgi-sharp - here is my SCGI server with host
 for NancyFx. If you run Sandbox.exe with --echo-server it will not use
 nancy infrastructure and will respond directly. It locks up after several
 thousands of requests under jmeter.

 Simple nginx configuration:

 location /
 {
include /etc/nginx/scgi_params;
scgi_pass 127.0.0.1:10081;
 }

 Now I'm looking for alternative socket library to use it as a replacement
 for System.Net.Sockets.


 2013/8/6 Greg Young gregoryyou...@gmail.com

 Actually not that surprised we also found out file stream.flush(true) only
 works sometimes and ms never back supported it to actually work :)


 On Tuesday, August 6, 2013, Alfred Hall wrote:

 **
 Yeah you're having exactly the same issues as I am. I'm surprised others
 haven't had this problem before. Not sure who works on this area of the
 mono codebase these days. If you got a minimal test case it may be worth us
 raising a Xamarin bug in bugzilla.

 -Original message-
 *From:* Nikita Tsukanov kek...@gmail.com
 *Sent:* Tuesday 6th August 2013 20:18
 *To:* mono-devel-list@lists.ximian.com
 *Subject:* Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up
 on linux

 Running with mono from master haven't helped.

 And I'm not sure what the hell is going on, but I cann't reproduce the
 issue when running under... Monodevelop's debugger. It runs perfectly under
 it, but when I try to run the same binary from console (even with --debug
 option) it locks up or segfaults. Does anyone know what does it mean?


 2013/8/6 Nikita Tsukanov kek...@gmail.com

 Great. It locked up with my more complex logic.
 Funny fact: NancyFx increases request processing time from 2ms to 70ms
 with the same echo response.
 Another funny fact: with MONO_DISABLE_AIO I've got segfault.

 Now I'll try to use build patched mono. Not sure that it's the same issue,
 because in my case it never tries to read and write simultane



-- 
Le doute n'est pas une condition agréable, mais la certitude est absurde.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-07 Thread Nikita Tsukanov
Ehm. Tried to run NancyFx with HttpListener on mono 2.10.8.1 (from ubuntu
repos) on my desktop machine. No lockups.


2013/8/7 Nikita Tsukanov kek...@gmail.com

 I've rewritten my SCGI server to work with TPL directly instead of using
 async/await to make it run on mono 2.10. Then I've tried to run it with
 mono 2.10.8.1 and mono 3.2 with System.Net.Sockets backend and to hammer it
 with jmeter. 500K requests without any lockups on Mono 2.10, lockup at
 22164th request on mono 3.2.

 Server source code is still on GitHub -
 https://github.com/kekekeks/scgi-sharp


 2013/8/7 Greg Young gregoryyou...@gmail.com

 I believe attaching a debugger changes things like optimizations from
 occurring (not positive but it does in clr)


 On Wednesday, August 7, 2013, Nikita Tsukanov wrote:

 Huh, it doesn't require debugger to be _attched_, just debugging
 subsystem initialized i. e. if I launch this program as a debugger it
 doesn't lock up.

 public static void Main (string[] args)
 {
   int port = 27042;
   if (args.Length != 0)
 port = int.Parse (args [0]);
   while (true)
   {
 var vm = Mono.Debugger.Soft.VirtualMachineManager.Listen (new
 IPEndPoint (IPAddress.Loopback, port));
 vm.Resume ();
 vm.Detach ();
   }
 }

 I'll use running with --debugger-agent=transport=dt_socket,address=
 127.0.0.1:27042 as a temporary workaround since performance doesn't
 degrade a lot.


 2013/8/7 Nikita Tsukanov kek...@gmail.com

 I suspect that the problem is actually with thread pool itself. I've
 created socket layer implementation using libevent (wrapped with Oars) and
 send/recv that utilizes thread pool for cases when it's unable to complete
 operation synchronously. It survives longer, but still locks up after a
 while. Same behavior with debugger - I'm unable to reproduce the issue when
 running under it. I also unable to grab thread stack traces, it prints
 Full thread dump:  and nothing else.


 2013/8/7 Greg Young gregoryyou...@gmail.com

 We will see your test then as it will probably affect us as well


 On Tuesday, August 6, 2013, Nikita Tsukanov wrote:

 Greg, I've tried running my server with mono compiled from master (with
 pull request #703 merged in), still freezes after a while.


 2013/8/7 Greg Young gregoryyou...@gmail.com

 Do you have our pull req? We are stable after (and seriously read
 history of this list)


 On Tuesday, August 6, 2013, Nikita Tsukanov wrote:

 https://github.com/kekekeks/scgi-sharp - here is my SCGI server with
 host for NancyFx. If you run Sandbox.exe with --echo-server it will not use
 nancy infrastructure and will respond directly. It locks up after several
 thousands of requests under jmeter.

 Simple nginx configuration:

 location /
 {
include /etc/nginx/scgi_params;
scgi_pass 127.0.0.1:10081;
 }

 Now I'm looking for alternative socket library to use it as a
 replacement for System.Net.Sockets.


 2013/8/6 Greg Young gregoryyou...@gmail.com

 Actually not that surprised we also found out file stream.flush(true)
 only works sometimes and ms never back supported it to actually work :)


 On Tuesday, August 6, 2013, Alfred Hall wrote:

 **
 Yeah you're having exactly the same issues as I am. I'm surprised others
 haven't had this problem before. Not sure who works on this area of the
 mono codebase these days. If you got a minimal test case it may be worth us
 raising a Xamarin bug in bugzilla.

 -Original message-
 *From:* Nikita Tsukanov kek...@gmail.com
 *Sent:* Tuesday 6th August 2013 20:18
 *To:* mono-devel-list@lists.ximian.com
 *Subject:* Re: [Mono-dev] NancyFX self hosting (HttpListener) locking
 up on linux

 Running with mono from master haven't helped.

 And I'm not sure what the hell is going on, but I cann't reproduce the
 issue when running under... Monodevelop's debugger. It runs perfectly under
 it, but when I try to run the same binary from console (even with --debug
 option) it locks up or segfaults. Does anyone know what does it mean?


 2013/8/6 Nikita Tsukanov kek...@gmail.com

 Great. It locked up with my more complex logic.
 Funny fact: NancyFx increases request processing time from 2ms to 70ms
 with the same echo response.
 Another funny fact: with MONO_DISABLE_AIO I've got segfault.

 Now I'll try to use build patched mono. Not sure that it's the same
 issue, because in my case it never tries to read and write simultane



 --
 Le doute n'est pas une condition agréable, mais la certitude est absurde.



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-07 Thread Alfred Hall
Tried running it with sgen or boehm on 2.10? Worth trying both I think. Also 
how about 3.3 (master) ?
-Original message-
From: Nikita Tsukanov kek...@gmail.com
Sent: Wednesday 7th August 2013 12:54
To: mono-devel-list@lists.ximian.com
Subject: Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

I've rewritten my SCGI server to work with TPL directly instead of using 
async/await to make it run on mono 2.10. Then I've tried to run it with mono 
2.10.8.1 and mono 3.2 with System.Net.Sockets backend and to hammer it with 
jmeter. 500K requests without any lockups on Mono 2.10, lockup at 22164th 
request on mono 3.2. 

Server source code is still on GitHub - https://github.com/kekekeks/scgi-sharp


2013/8/7 Greg Young gregoryyou...@gmail.com mailto:gregoryyou...@gmail.com 
I believe attaching a debugger changes things like optimizations from occurring 
(not positive but it does in clr)


On Wednesday, August 7, 2013, Nikita Tsukanov wrote:
Huh, it doesn't require debugger to be _attched_, just debugging subsystem 
initialized i. e. if I launch this program as a debugger it doesn't lock up.

public static void Main (string[] args)
{
  int port = 27042;
  if (args.Length != 0)
    port = int.Parse (args [0]);
  while (true)
  {
    var vm = Mono.Debugger.Soft.VirtualMachineManager.Listen (new IPEndPoint 
(IPAddress.Loopback, port));
    vm.Resume ();
    vm.Detach ();
  }
}

I'll use running with 
--debugger-agent=transport=dt_socket,address=127.0.0.1:27042 
http://127.0.0.1:27042 as a temporary workaround since performance doesn't 
degrade a lot.


2013/8/7 Nikita Tsukanov kek...@gmail.com
I suspect that the problem is actually with thread pool itself. I've created 
socket layer implementation using libevent (wrapped with Oars) and send/recv 
that utilizes thread pool for cases when it's unable to complete operation 
synchronously. It survives longer, but still locks up after a while. Same 
behavior with debugger - I'm unable to reproduce the issue when running under 
it. I also unable to grab thread stack traces, it prints Full thread dump:  
and nothing else.


2013/8/7 Greg Young gregoryyou...@gmail.com
We will see your test then as it will probably affect us as well


On Tuesday, August 6, 2013, Nikita Tsukanov wrote:
Greg, I've tried running my server with mono compiled from master (with pull 
request #703 merged in), still freezes after a while.


2013/8/7 Greg Young gregoryyou...@gmail.com
Do you have our pull req? We are stable after (and seriously read history of 
this list)


On Tuesday, August 6, 2013, Nikita Tsukanov wrote:
https://github.com/kekekeks/scgi-sharp - here is my SCGI server with host for 
NancyFx. If you run Sandbox.exe with --echo-server it will not use nancy 
infrastructure and will respond directly. It locks up after several thousands 
of requests under jmeter.

Simple nginx configuration:

location /
{
   include /etc/nginx/scgi_params;
   scgi_pass 127.0.0.1:10081 http://127.0.0.1:10081 ;
}

Now I'm looking for alternative socket library to use it as a replacement for 
System.Net.Sockets.


2013/8/6 Greg Young gregoryyou...@gmail.com
Actually not that surprised we also found out file stream.flush(true) only 
works sometimes and ms never back supported it to actually work :)


On Tuesday, August 6, 2013, Alfred Hall wrote:
 
Yeah you're having exactly the same issues as I am. I'm surprised others 
haven't had this problem before. Not sure who works on this area of the mono 
codebase these days. If you got a minimal test case it may be worth us raising 
a Xamarin bug in bugzilla.
-Original message-
From: Nikita Tsukanov kek...@gmail.com
Sent: Tuesday 6th August 2013 20:18
To: mono-devel-list@lists.ximian.com
Subject: Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

Running with mono from master haven't helped.

And I'm not sure what the hell is going on, but I cann't reproduce the issue 
when running under... Monodevelop's debugger. It runs perfectly under it, but 
when I try to run the same binary from console (even with --debug option) it 
locks up or segfaults. Does anyone know what does it mean?


2013/8/6 Nikita Tsukanov kek...@gmail.com
Great. It locked up with my more complex logic. 
Funny fact: NancyFx increases request processing time from 2ms to 70ms with the 
same echo response.
Another funny fact: with MONO_DISABLE_AIO I've got segfault.

Now I'll try to use build patched mono. Not sure that it's the same issue, 
because in my case it never tries to read and write simultane


-- 
Le doute n'est pas une condition agréable, mais la certitude est absurde.


___

Mono-devel-list mailing list

Mono-devel-list@lists.ximian.com

http://lists.ximian.com/mailman/listinfo/mono-devel-list



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-07 Thread Andrés G. Aragoneses
If you're able to reproduce it with 3.3 and not with 2.10.x, you should 
definitely open a bug report for it in http://bugzilla.xamarin.com/ 
stating [regression] in the bug summary.


Also, I would open a separate bug report for the segfault you're getting 
when running with MONO_DISABLE_AIO (pasting the backtrace of the 
segfault, with debug symbols installed).


On 07/08/13 14:02, Alfred Hall wrote:

Tried running it with sgen or boehm on 2.10? Worth trying both I think.
Also how about 3.3 (master) ?

-Original message-
*From:* Nikita Tsukanov kek...@gmail.com
*Sent:* Wednesday 7th August 2013 12:54
*To:* mono-devel-list@lists.ximian.com
*Subject:* Re: [Mono-dev] NancyFX self hosting (HttpListener)
locking up on linux

I've rewritten my SCGI server to work with TPL directly instead of
using async/await to make it run on mono 2.10. Then I've tried to
run it with mono 2.10.8.1 and mono 3.2 with System.Net.Sockets
backend and to hammer it with jmeter. 500K requests without any
lockups on Mono 2.10, lockup at 22164th request on mono 3.2.

Server source code is still on GitHub -
https://github.com/kekekeks/scgi-sharp


2013/8/7 Greg Young gregoryyou...@gmail.com
mailto:gregoryyou...@gmail.com

I believe attaching a debugger changes things like optimizations
from occurring (not positive but it does in clr)


On Wednesday, August 7, 2013, Nikita Tsukanov wrote:

Huh, it doesn't require debugger to be _attched_, just
debugging subsystem initialized i. e. if I launch this
program as a debugger it doesn't lock up.

publicstaticvoidMain(string[]args)
{
intport=27042;
if(args.Length !=0)
port=int.Parse(args[0]);
while(true)
{
varvm= 
Mono.Debugger.Soft.VirtualMachineManager.Listen(newIPEndPoint(IPAddress.Loopback,port));
vm.Resume();
vm.Detach();
}
}

I'll use running with
--debugger-agent=transport=dt_socket,address=127.0.0.1:27042
http://127.0.0.1:27042 as a temporary workaround since
performance doesn't degrade a lot.


2013/8/7 Nikita Tsukanov kek...@gmail.com

I suspect that the problem is actually with thread pool
itself. I've created socket layer implementation using
libevent (wrapped with Oars) and send/recv that utilizes
thread pool for cases when it's unable to complete
operation synchronously. It survives longer, but still
locks up after a while. Same behavior with debugger -
I'm unable to reproduce the issue when running under it.
I also unable to grab thread stack traces, it prints
Full thread dump:  and nothing else.


2013/8/7 Greg Young gregoryyou...@gmail.com

We will see your test then as it will probably
affect us as well


On Tuesday, August 6, 2013, Nikita Tsukanov wrote:

Greg, I've tried running my server with mono
compiled from master (with pull request #703
merged in), still freezes after a while.


2013/8/7 Greg Young gregoryyou...@gmail.com

Do you have our pull req? We are stable
after (and seriously read history of this list)


On Tuesday, August 6, 2013, Nikita Tsukanov
wrote:

https://github.com/kekekeks/scgi-sharp -
here is my SCGI server with host for
NancyFx. If you run Sandbox.exe with
--echo-server it will not use nancy
infrastructure and will respond
directly. It locks up after several
thousands of requests under jmeter.

Simple nginx configuration:

location /
{
include /etc/nginx/scgi_params;
scgi_pass 127.0.0.1:10081
http://127.0.0.1:10081;
}

Now I'm looking for alternative socket
library to use it as a replacement for
System.Net.Sockets.


2013/8/6 Greg Young
gregoryyou...@gmail.com

Actually not that surprised we also
found out file stream.flush(true

Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-06 Thread Nikita Tsukanov
Hello. I've written a simple SCGI server, configured nginx to work with it,
hammered it with jmeter and... got the same issue. It works for a while and
then stops accepting new connections (some existing ones still waiting with
CLOSE_WAIT). I get it with new NetworkStream(TcpListener.AcceptSocket())
and BeginWrite/BeginRead. MONO_DISABLE_AIO actually helps it to survive for
20-30 more seconds but result is the same.

Now I'll try to use some alternative way of working with sockets, may be
libuv or something like that.

Ubuntu 13.04, Mono JIT compiler version 3.2.0 (tarball Tue Jul 30 21:08:00
UTC 2013)


2013/8/5 Alfred Hall ah...@ahall.org

 **
 Getting similar issues when using FastCGI/XSP proxied via Nginx using tcp
 and unix sockets (tried both). After hammering it with jmeter it ends up
 locking up. I'm wondering if other mono webapps have this issue. Would be
 useful if someone else here could do a similar loadtest using jmeter  and
 let me know if it happens to them.

 -Original message-
 *From:* Alfred Hall ah...@ahall.org
 *Sent:* Sunday 4th August 2013 17:41
 *To:* Nikita Tsukanov kek...@gmail.com; mono-devel-list@lists.ximian.com
 *Subject:* Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up
 on linux

  Hi Nikita.

 Full thread dump:

 threadpool thread tid=0x0x7fc4ad29d700 this=0x0x7fc4ad584c70 thread
 handle 0x80f state : not waiting owns ()


 IO Threadpool worker tid=0x0x7fc4ad25c700 this=0x0x7fc4ad584dd0 thread
 handle 0x810 state : interrupted state owns ()


 IO Threadpool worker tid=0x0x7fc4a7567700 this=0x0x7fc4a741d350 thread
 handle 0x845 state : interrupted state owns ()


 Threadpool worker tid=0x0x7fc4ac39a700 this=0x0x7fc4a6192270 thread
 handle 0x837 state : interrupted state owns ()
   at unknown 0x
   at (wrapper managed-to-native)
 object.__icall_wrapper_mono_gc_alloc_vector (intptr,intptr,intptr)
 0x
   at (wrapper alloc) object.AllocVector (intptr,intptr) 0x
   at System.Net.HttpConnection.BeginReadRequest () 0x0003a
   at System.Net.EndPointListener.OnAccept (object,System.EventArgs)
 0x00357
   at System.Net.Sockets.SocketAsyncEventArgs.OnCompleted
 (System.Net.Sockets.SocketAsyncEventArgs) 0x0002e
   at System.Net.Sockets.SocketAsyncEventArgs.AcceptCallback
 (System.IAsyncResult) 0x00336
   at System.Net.Sockets.SocketAsyncEventArgs.DispatcherCB
 (System.IAsyncResult) 0x0010f
   at (wrapper runtime-invoke) Module.runtime_invoke_void__this___object
 (object,intptr,intptr,intptr) 0x


 I then tried the same again and only got this in my trace:

 Full thread dump:

 threadpool thread tid=0x0x7f31b8ac5700 this=0x0x7f31b8da4c70 thread
 handle 0x80e state : not waiting owns ()


 IO Threadpool worker tid=0x0x7f31b8a84700 this=0x0x7f31b8da4dd0 thread
 handle 0x80f state : interrupted state owns ()

 Not sure why I'm not getting any dump here. Any more debugging I can do on
 there?

 What seems to happen is its coping well initially with the requests and
 then in all of a sudden it stops accepting connections and existing
 connections dont die off.

 Cheers,
 Alf

 -Original message-
 *From:* Nikita Tsukanov kek...@gmail.com
 *Sent:* Sunday 4th August 2013 16:13
 *To:* mono-devel-list@lists.ximian.com
 *Subject:* Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up
 on linux

 Alfred, please, try to send SIGQUIT to mono (i. e. kill -SIGQUIT {PID})
 when it stops processing requests. It will force mono to write thread stack
 traces to stdout. Grab them and post here, I suspect that the issue is
 simular to one experienced by me.


 2013/8/4 Nikita Tsukanov kek...@gmail.com

 Alfred, please, try to send SIGQUIT to mono (i. e. kill -SIGQUIT
 {PID}) when it stops processing requests. It will force mono to write
 thread stack traces to stdout. Grab them and post here, I suspect that
 the issue is simular to one experienced by me.


 ___

 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list

  ___

 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-06 Thread Yuriy Solodkyy
Nikita,

just interesting if it is the same issue.  Have you tried applying this
patch https://github.com/mono/mono/pull/703/ ?

Make sure you DO NOT set MONO_DISABLE_AIO  as only epoll/kqueue backend is
patched there.

Not sure if it is related, though.

thank you
-yuriy


On Tue, Aug 6, 2013 at 7:42 PM, Nikita Tsukanov kek...@gmail.com wrote:

 Hello. I've written a simple SCGI server, configured nginx to work with
 it, hammered it with jmeter and... got the same issue. It works for a while
 and then stops accepting new connections (some existing ones still waiting
 with CLOSE_WAIT). I get it with new
 NetworkStream(TcpListener.AcceptSocket()) and BeginWrite/BeginRead.
 MONO_DISABLE_AIO actually helps it to survive for 20-30 more seconds but
 result is the same.

 Now I'll try to use some alternative way of working with sockets, may be
 libuv or something like that.

 Ubuntu 13.04, Mono JIT compiler version 3.2.0 (tarball Tue Jul 30 21:08:00
 UTC 2013)


 2013/8/5 Alfred Hall ah...@ahall.org

 **
 Getting similar issues when using FastCGI/XSP proxied via Nginx using tcp
 and unix sockets (tried both). After hammering it with jmeter it ends up
 locking up. I'm wondering if other mono webapps have this issue. Would be
 useful if someone else here could do a similar loadtest using jmeter  and
 let me know if it happens to them.

 -Original message-
 *From:* Alfred Hall ah...@ahall.org
 *Sent:* Sunday 4th August 2013 17:41
 *To:* Nikita Tsukanov kek...@gmail.com;
 mono-devel-list@lists.ximian.com
 *Subject:* Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up
 on linux

  Hi Nikita.

 Full thread dump:

 threadpool thread tid=0x0x7fc4ad29d700 this=0x0x7fc4ad584c70 thread
 handle 0x80f state : not waiting owns ()


 IO Threadpool worker tid=0x0x7fc4ad25c700 this=0x0x7fc4ad584dd0 thread
 handle 0x810 state : interrupted state owns ()


 IO Threadpool worker tid=0x0x7fc4a7567700 this=0x0x7fc4a741d350 thread
 handle 0x845 state : interrupted state owns ()


 Threadpool worker tid=0x0x7fc4ac39a700 this=0x0x7fc4a6192270 thread
 handle 0x837 state : interrupted state owns ()
   at unknown 0x
   at (wrapper managed-to-native)
 object.__icall_wrapper_mono_gc_alloc_vector (intptr,intptr,intptr)
 0x
   at (wrapper alloc) object.AllocVector (intptr,intptr) 0x
   at System.Net.HttpConnection.BeginReadRequest () 0x0003a
   at System.Net.EndPointListener.OnAccept (object,System.EventArgs)
 0x00357
   at System.Net.Sockets.SocketAsyncEventArgs.OnCompleted
 (System.Net.Sockets.SocketAsyncEventArgs) 0x0002e
   at System.Net.Sockets.SocketAsyncEventArgs.AcceptCallback
 (System.IAsyncResult) 0x00336
   at System.Net.Sockets.SocketAsyncEventArgs.DispatcherCB
 (System.IAsyncResult) 0x0010f
   at (wrapper runtime-invoke) Module.runtime_invoke_void__this___object
 (object,intptr,intptr,intptr) 0x


 I then tried the same again and only got this in my trace:

 Full thread dump:

 threadpool thread tid=0x0x7f31b8ac5700 this=0x0x7f31b8da4c70 thread
 handle 0x80e state : not waiting owns ()


 IO Threadpool worker tid=0x0x7f31b8a84700 this=0x0x7f31b8da4dd0 thread
 handle 0x80f state : interrupted state owns ()

 Not sure why I'm not getting any dump here. Any more debugging I can do
 on there?

 What seems to happen is its coping well initially with the requests and
 then in all of a sudden it stops accepting connections and existing
 connections dont die off.

 Cheers,
 Alf

 -Original message-
 *From:* Nikita Tsukanov kek...@gmail.com
 *Sent:* Sunday 4th August 2013 16:13
 *To:* mono-devel-list@lists.ximian.com
 *Subject:* Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up
 on linux

 Alfred, please, try to send SIGQUIT to mono (i. e. kill -SIGQUIT {PID})
 when it stops processing requests. It will force mono to write thread stack
 traces to stdout. Grab them and post here, I suspect that the issue is
 simular to one experienced by me.


 2013/8/4 Nikita Tsukanov kek...@gmail.com

 Alfred, please, try to send SIGQUIT to mono (i. e. kill -SIGQUIT
 {PID}) when it stops processing requests. It will force mono to write
 thread stack traces to stdout. Grab them and post here, I suspect that
 the issue is simular to one experienced by me.


 ___

 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list

  ___

 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list



 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list




-- 
Yuriy Solodkyy
(y.solod...@gmail.com)
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-06 Thread Andrés G. Aragoneses

On 06/08/13 18:42, Nikita Tsukanov wrote:

Ubuntu 13.04, Mono JIT compiler version 3.2.0 (tarball Tue Jul 30
21:08:00 UTC 2013)


Mono 3.2.0 does *not* have Yuri's patch.


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-06 Thread Nikita Tsukanov
Interesting... I've written a simple server using only Socket.BeginRecieve
and Socket.BeginSend. It just reads 100 bytes and then sends hardcoded HTTP
response. Now jmeter is working for 5 minutes and it still responds with
Lorem ipsum ... perfectly. I'll try to port my SCGI server logic from
NetworkStream to Socket and see what will happen.


2013/8/6 Andrés G. Aragoneses kno...@gmail.com

 On 06/08/13 18:42, Nikita Tsukanov wrote:

 Ubuntu 13.04, Mono JIT compiler version 3.2.0 (tarball Tue Jul 30
 21:08:00 UTC 2013)


 Mono 3.2.0 does *not* have Yuri's patch.



 __**_
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.**com Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/**mailman/listinfo/mono-devel-**listhttp://lists.ximian.com/mailman/listinfo/mono-devel-list

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-06 Thread Greg Young
There are many cases the patch we provided does not affect eg no overlap in
io between send/receive

On Tuesday, August 6, 2013, Nikita Tsukanov wrote:

 Interesting... I've written a simple server using only Socket.BeginRecieve
 and Socket.BeginSend. It just reads 100 bytes and then sends hardcoded HTTP
 response. Now jmeter is working for 5 minutes and it still responds with
 Lorem ipsum ... perfectly. I'll try to port my SCGI server logic from
 NetworkStream to Socket and see what will happen.


 2013/8/6 Andrés G. Aragoneses kno...@gmail.com javascript:_e({},
 'cvml', 'kno...@gmail.com');

 On 06/08/13 18:42, Nikita Tsukanov wrote:

 Ubuntu 13.04, Mono JIT compiler version 3.2.0 (tarball Tue Jul 30
 21:08:00 UTC 2013)


 Mono 3.2.0 does *not* have Yuri's patch.



 __**_
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.**com javascript:_e({}, 'cvml',
 'Mono-devel-list@lists.ximian.com');
 http://lists.ximian.com/**mailman/listinfo/mono-devel-**listhttp://lists.ximian.com/mailman/listinfo/mono-devel-list




-- 
Le doute n'est pas une condition agréable, mais la certitude est absurde.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-06 Thread Nikita Tsukanov
Great. It locked up with my more complex logic.
Funny fact: NancyFx increases request processing time from 2ms to 70ms with
the same echo response.
Another funny fact: with MONO_DISABLE_AIO I've got segfault.

Now I'll try to use build patched mono. Not sure that it's the same issue,
because in my case it never tries to read and write simultaneously  on the
same socket.


2013/8/6 Greg Young gregoryyou...@gmail.com

 There are many cases the patch we provided does not affect eg no overlap
 in io between send/receive


 On Tuesday, August 6, 2013, Nikita Tsukanov wrote:

 Interesting... I've written a simple server using only
 Socket.BeginRecieve and Socket.BeginSend. It just reads 100 bytes and then
 sends hardcoded HTTP response. Now jmeter is working for 5 minutes and it
 still responds with Lorem ipsum ... perfectly. I'll try to port my SCGI
 server logic from NetworkStream to Socket and see what will happen.


 2013/8/6 Andrés G. Aragoneses kno...@gmail.com

 On 06/08/13 18:42, Nikita Tsukanov wrote:

 Ubuntu 13.04, Mono JIT compiler version 3.2.0 (tarball Tue Jul 30
 21:08:00 UTC 2013)


 Mono 3.2.0 does *not* have Yuri's patch.



 __**_
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.**com
 http://lists.ximian.com/**mailman/listinfo/mono-devel-**listhttp://lists.ximian.com/mailman/listinfo/mono-devel-list




 --
 Le doute n'est pas une condition agréable, mais la certitude est absurde.

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-06 Thread Nikita Tsukanov
Running with mono from master haven't helped.

And I'm not sure what the hell is going on, but I cann't reproduce the
issue when running under... Monodevelop's debugger. It runs perfectly under
it, but when I try to run the same binary from console (even with --debug
option) it locks up or segfaults. Does anyone know what does it mean?


2013/8/6 Nikita Tsukanov kek...@gmail.com

 Great. It locked up with my more complex logic.
 Funny fact: NancyFx increases request processing time from 2ms to 70ms
 with the same echo response.
 Another funny fact: with MONO_DISABLE_AIO I've got segfault.

 Now I'll try to use build patched mono. Not sure that it's the same issue,
 because in my case it never tries to read and write simultaneously  on the
 same socket.


 2013/8/6 Greg Young gregoryyou...@gmail.com

 There are many cases the patch we provided does not affect eg no overlap
 in io between send/receive


 On Tuesday, August 6, 2013, Nikita Tsukanov wrote:

 Interesting... I've written a simple server using only
 Socket.BeginRecieve and Socket.BeginSend. It just reads 100 bytes and then
 sends hardcoded HTTP response. Now jmeter is working for 5 minutes and it
 still responds with Lorem ipsum ... perfectly. I'll try to port my SCGI
 server logic from NetworkStream to Socket and see what will happen.


 2013/8/6 Andrés G. Aragoneses kno...@gmail.com

 On 06/08/13 18:42, Nikita Tsukanov wrote:

 Ubuntu 13.04, Mono JIT compiler version 3.2.0 (tarball Tue Jul 30
 21:08:00 UTC 2013)


 Mono 3.2.0 does *not* have Yuri's patch.



 __**_
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.**com
 http://lists.ximian.com/**mailman/listinfo/mono-devel-**listhttp://lists.ximian.com/mailman/listinfo/mono-devel-list




 --
 Le doute n'est pas une condition agréable, mais la certitude est absurde.



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-06 Thread Alfred Hall
Yeah you're having exactly the same issues as I am. I'm surprised others 
haven't had this problem before. Not sure who works on this area of the mono 
codebase these days. If you got a minimal test case it may be worth us raising 
a Xamarin bug in bugzilla.
-Original message-
From: Nikita Tsukanov kek...@gmail.com
Sent: Tuesday 6th August 2013 20:18
To: mono-devel-list@lists.ximian.com
Subject: Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

Running with mono from master haven't helped.

And I'm not sure what the hell is going on, but I cann't reproduce the issue 
when running under... Monodevelop's debugger. It runs perfectly under it, but 
when I try to run the same binary from console (even with --debug option) it 
locks up or segfaults. Does anyone know what does it mean?


2013/8/6 Nikita Tsukanov kek...@gmail.com mailto:kek...@gmail.com 
Great. It locked up with my more complex logic. 
Funny fact: NancyFx increases request processing time from 2ms to 70ms with the 
same echo response.
Another funny fact: with MONO_DISABLE_AIO I've got segfault.

Now I'll try to use build patched mono. Not sure that it's the same issue, 
because in my case it never tries to read and write simultaneously  on the same 
socket.


2013/8/6 Greg Young gregoryyou...@gmail.com mailto:gregoryyou...@gmail.com 
There are many cases the patch we provided does not affect eg no overlap in io 
between send/receive


On Tuesday, August 6, 2013, Nikita Tsukanov wrote:
Interesting... I've written a simple server using only Socket.BeginRecieve and 
Socket.BeginSend. It just reads 100 bytes and then sends hardcoded HTTP 
response. Now jmeter is working for 5 minutes and it still responds with Lorem 
ipsum ... perfectly. I'll try to port my SCGI server logic from 
NetworkStream to Socket and see what will happen.


2013/8/6 Andrés G. Aragoneses kno...@gmail.com
On 06/08/13 18:42, Nikita Tsukanov wrote:
Ubuntu 13.04, Mono JIT compiler version 3.2.0 (tarball Tue Jul 30
21:08:00 UTC 2013)

Mono 3.2.0 does *not* have Yuri's patch.



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list 
http://lists.ximian.com/mailman/listinfo/mono-devel-list 



-- 
Le doute n'est pas une condition agréable, mais la certitude est absurde.



___

Mono-devel-list mailing list

Mono-devel-list@lists.ximian.com

http://lists.ximian.com/mailman/listinfo/mono-devel-list



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-06 Thread Andrés G. Aragoneses
I guess it means that it is a race condition which is not reproducible 
inside the debugger (as the debugger slows things down).



On 06/08/13 21:18, Nikita Tsukanov wrote:

Running with mono from master haven't helped.

And I'm not sure what the hell is going on, but I cann't reproduce the
issue when running under... Monodevelop's debugger. It runs perfectly
under it, but when I try to run the same binary from console (even with
--debug option) it locks up or segfaults. Does anyone know what does it
mean?


2013/8/6 Nikita Tsukanov kek...@gmail.com mailto:kek...@gmail.com

Great. It locked up with my more complex logic.
Funny fact: NancyFx increases request processing time from 2ms to
70ms with the same echo response.
Another funny fact: with MONO_DISABLE_AIO I've got segfault.

Now I'll try to use build patched mono. Not sure that it's the same
issue, because in my case it never tries to read and write
simultaneously  on the same socket.


2013/8/6 Greg Young gregoryyou...@gmail.com
mailto:gregoryyou...@gmail.com

There are many cases the patch we provided does not affect eg no
overlap in io between send/receive


On Tuesday, August 6, 2013, Nikita Tsukanov wrote:

Interesting... I've written a simple server using only
Socket.BeginRecieve and Socket.BeginSend. It just reads 100
bytes and then sends hardcoded HTTP response. Now jmeter is
working for 5 minutes and it still responds with Lorem
ipsum ... perfectly. I'll try to port my SCGI server
logic from NetworkStream to Socket and see what will happen.


2013/8/6 Andrés G. Aragoneses kno...@gmail.com

On 06/08/13 18:42, Nikita Tsukanov wrote:

Ubuntu 13.04, Mono JIT compiler version 3.2.0
(tarball Tue Jul 30
21:08:00 UTC 2013)


Mono 3.2.0 does *not* have Yuri's patch.



_
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.__com
http://lists.ximian.com/__mailman/listinfo/mono-devel-__list
http://lists.ximian.com/mailman/listinfo/mono-devel-list




--
Le doute n'est pas une condition agréable, mais la certitude est
absurde.





___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list




___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-06 Thread Greg Young
This has been going on for almost nine months look in list for tcp issues
which is why I'm curious that patch may not fix. It has with significant
(thousands of hours of testing) fixed problem for us. What os etc is being
run.

We have frankly also been surprised that this reported behaviour almost a
year ago is apparently considered not very important.

Greg

On Tuesday, August 6, 2013, Alfred Hall wrote:

 **
 Yeah you're having exactly the same issues as I am. I'm surprised others
 haven't had this problem before. Not sure who works on this area of the
 mono codebase these days. If you got a minimal test case it may be worth us
 raising a Xamarin bug in bugzilla.

 -Original message-
 *From:* Nikita Tsukanov kek...@gmail.com javascript:_e({}, 'cvml',
 'kek...@gmail.com');
 *Sent:* Tuesday 6th August 2013 20:18
 *To:* mono-devel-list@lists.ximian.com javascript:_e({}, 'cvml',
 'mono-devel-list@lists.ximian.com');
 *Subject:* Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up
 on linux

 Running with mono from master haven't helped.

 And I'm not sure what the hell is going on, but I cann't reproduce the
 issue when running under... Monodevelop's debugger. It runs perfectly under
 it, but when I try to run the same binary from console (even with --debug
 option) it locks up or segfaults. Does anyone know what does it mean?


 2013/8/6 Nikita Tsukanov kek...@gmail.com javascript:_e({}, 'cvml',
 'kek...@gmail.com');

 Great. It locked up with my more complex logic.
 Funny fact: NancyFx increases request processing time from 2ms to 70ms
 with the same echo response.
 Another funny fact: with MONO_DISABLE_AIO I've got segfault.

 Now I'll try to use build patched mono. Not sure that it's the same
 issue, because in my case it never tries to read and write simultaneously
  on the same socket.


 2013/8/6 Greg Young gregoryyou...@gmail.com javascript:_e({}, 'cvml',
 'gregoryyou...@gmail.com');

 There are many cases the patch we provided does not affect eg no overlap
 in io between send/receive


 On Tuesday, August 6, 2013, Nikita Tsukanov wrote:

 Interesting... I've written a simple server using only
 Socket.BeginRecieve and Socket.BeginSend. It just reads 100 bytes and then
 sends hardcoded HTTP response. Now jmeter is working for 5 minutes and it
 still responds with Lorem ipsum ... perfectly. I'll try to port my SCGI
 server logic from NetworkStream to Socket and see what will happen.


 2013/8/6 Andrés G. Aragoneses kno...@gmail.com

 On 06/08/13 18:42, Nikita Tsukanov wrote:

 Ubuntu 13.04, Mono JIT compiler version 3.2.0 (tarball Tue Jul 30
 21:08:00 UTC 2013)


 Mono 3.2.0 does *not* have Yuri's patch.



 __**_
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.**com
 http://lists.ximian.com/**mailman/listinfo/mono-devel-**listhttp://lists.ximian.com/mailman/listinfo/mono-devel-list




 --
 Le doute n'est pas une condition agréable, mais la certitude est absurde.



 ___

 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com javascript:_e({}, 'cvml', 
 'Mono-devel-list@lists.ximian.com');
 http://lists.ximian.com/mailman/listinfo/mono-devel-list



-- 
Le doute n'est pas une condition agréable, mais la certitude est absurde.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-06 Thread Greg Young
Actually not that surprised we also found out file stream.flush(true) only
works sometimes and ms never back supported it to actually work :)

On Tuesday, August 6, 2013, Alfred Hall wrote:

 **
 Yeah you're having exactly the same issues as I am. I'm surprised others
 haven't had this problem before. Not sure who works on this area of the
 mono codebase these days. If you got a minimal test case it may be worth us
 raising a Xamarin bug in bugzilla.

 -Original message-
 *From:* Nikita Tsukanov kek...@gmail.com javascript:_e({}, 'cvml',
 'kek...@gmail.com');
 *Sent:* Tuesday 6th August 2013 20:18
 *To:* mono-devel-list@lists.ximian.com javascript:_e({}, 'cvml',
 'mono-devel-list@lists.ximian.com');
 *Subject:* Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up
 on linux

 Running with mono from master haven't helped.

 And I'm not sure what the hell is going on, but I cann't reproduce the
 issue when running under... Monodevelop's debugger. It runs perfectly under
 it, but when I try to run the same binary from console (even with --debug
 option) it locks up or segfaults. Does anyone know what does it mean?


 2013/8/6 Nikita Tsukanov kek...@gmail.com javascript:_e({}, 'cvml',
 'kek...@gmail.com');

 Great. It locked up with my more complex logic.
 Funny fact: NancyFx increases request processing time from 2ms to 70ms
 with the same echo response.
 Another funny fact: with MONO_DISABLE_AIO I've got segfault.

 Now I'll try to use build patched mono. Not sure that it's the same
 issue, because in my case it never tries to read and write simultaneously
  on the same socket.


 2013/8/6 Greg Young gregoryyou...@gmail.com javascript:_e({}, 'cvml',
 'gregoryyou...@gmail.com');

 There are many cases the patch we provided does not affect eg no overlap
 in io between send/receive


 On Tuesday, August 6, 2013, Nikita Tsukanov wrote:

 Interesting... I've written a simple server using only
 Socket.BeginRecieve and Socket.BeginSend. It just reads 100 bytes and then
 sends hardcoded HTTP response. Now jmeter is working for 5 minutes and it
 still responds with Lorem ipsum ... perfectly. I'll try to port my SCGI
 server logic from NetworkStream to Socket and see what will happen.


 2013/8/6 Andrés G. Aragoneses kno...@gmail.com

 On 06/08/13 18:42, Nikita Tsukanov wrote:

 Ubuntu 13.04, Mono JIT compiler version 3.2.0 (tarball Tue Jul 30
 21:08:00 UTC 2013)


 Mono 3.2.0 does *not* have Yuri's patch.



 __**_
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.**com
 http://lists.ximian.com/**mailman/listinfo/mono-devel-**listhttp://lists.ximian.com/mailman/listinfo/mono-devel-list




 --
 Le doute n'est pas une condition agréable, mais la certitude est absurde.



 ___

 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com javascript:_e({}, 'cvml', 
 'Mono-devel-list@lists.ximian.com');
 http://lists.ximian.com/mailman/listinfo/mono-devel-list



-- 
Le doute n'est pas une condition agréable, mais la certitude est absurde.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-06 Thread Nikita Tsukanov
https://github.com/kekekeks/scgi-sharp - here is my SCGI server with host
for NancyFx. If you run Sandbox.exe with --echo-server it will not use
nancy infrastructure and will respond directly. It locks up after several
thousands of requests under jmeter.

Simple nginx configuration:

location /
{
   include /etc/nginx/scgi_params;
   scgi_pass 127.0.0.1:10081;
}

Now I'm looking for alternative socket library to use it as a replacement
for System.Net.Sockets.


2013/8/7 Nikita Tsukanov kek...@gmail.com

 https://github.com/kekekeks/scgi-sharp - here is my SCGI server with host
 for NancyFx. If you run Sandbox.exe with --echo-server it will not use
 nancy infrastructure and will respond directly. It locks up after several
 thousands of requests under jmeter.

 Simple nginx configuration:

 location /
 {
include /etc/nginx/scgi_params;
scgi_pass 127.0.0.1:10081;
 }

 Now I'm looking for alternative socket library to use it as a replacement
 for System.Net.Sockets.


 2013/8/6 Greg Young gregoryyou...@gmail.com

 Actually not that surprised we also found out file stream.flush(true)
 only works sometimes and ms never back supported it to actually work :)


 On Tuesday, August 6, 2013, Alfred Hall wrote:

 **
 Yeah you're having exactly the same issues as I am. I'm surprised others
 haven't had this problem before. Not sure who works on this area of the
 mono codebase these days. If you got a minimal test case it may be worth us
 raising a Xamarin bug in bugzilla.

 -Original message-
 *From:* Nikita Tsukanov kek...@gmail.com
 *Sent:* Tuesday 6th August 2013 20:18
 *To:* mono-devel-list@lists.ximian.com
 *Subject:* Re: [Mono-dev] NancyFX self hosting (HttpListener) locking
 up on linux

 Running with mono from master haven't helped.

 And I'm not sure what the hell is going on, but I cann't reproduce the
 issue when running under... Monodevelop's debugger. It runs perfectly under
 it, but when I try to run the same binary from console (even with --debug
 option) it locks up or segfaults. Does anyone know what does it mean?


 2013/8/6 Nikita Tsukanov kek...@gmail.com

 Great. It locked up with my more complex logic.
 Funny fact: NancyFx increases request processing time from 2ms to 70ms
 with the same echo response.
 Another funny fact: with MONO_DISABLE_AIO I've got segfault.

 Now I'll try to use build patched mono. Not sure that it's the same
 issue, because in my case it never tries to read and write simultaneously
  on the same socket.


 2013/8/6 Greg Young gregoryyou...@gmail.com

 There are many cases the patch we provided does not affect eg no
 overlap in io between send/receive


 On Tuesday, August 6, 2013, Nikita Tsukanov wrote:

 Interesting... I've written a simple server using only
 Socket.BeginRecieve and Socket.BeginSend. It just reads 100 bytes and 
 then
 sends hardcoded HTTP response. Now jmeter is working for 5 minutes and it
 still responds with Lorem ipsum ... perfectly. I'll try to port my 
 SCGI
 server logic from NetworkStream to Socket and see what will happen.


 2013/8/6 Andrés G. Aragoneses kno...@gmail.com

 On 06/08/13 18:42, Nikita Tsukanov wrote:

 Ubuntu 13.04, Mono JIT compiler version 3.2.0 (tarball Tue Jul 30
 21:08:00 UTC 2013)


 Mono 3.2.0 does *not* have Yuri's patch.



 __**_
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.**com
 http://lists.ximian.com/**mailman/listinfo/mono-devel-**listhttp://lists.ximian.com/mailman/listinfo/mono-devel-list




 --
 Le doute n'est pas une condition agréable, mais la certitude est
 absurde.



 ___

 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list



 --
 Le doute n'est pas une condition agréable, mais la certitude est absurde.



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-06 Thread Greg Young
We will see your test then as it will probably affect us as well

On Tuesday, August 6, 2013, Nikita Tsukanov wrote:

 Greg, I've tried running my server with mono compiled from master (with
 pull request #703 merged in), still freezes after a while.


 2013/8/7 Greg Young gregoryyou...@gmail.com

 Do you have our pull req? We are stable after (and seriously read history
 of this list)


 On Tuesday, August 6, 2013, Nikita Tsukanov wrote:

 https://github.com/kekekeks/scgi-sharp - here is my SCGI server with host
 for NancyFx. If you run Sandbox.exe with --echo-server it will not use
 nancy infrastructure and will respond directly. It locks up after several
 thousands of requests under jmeter.

 Simple nginx configuration:

 location /
 {
include /etc/nginx/scgi_params;
scgi_pass 127.0.0.1:10081;
 }

 Now I'm looking for alternative socket library to use it as a replacement
 for System.Net.Sockets.


 2013/8/6 Greg Young gregoryyou...@gmail.com

 Actually not that surprised we also found out file stream.flush(true) only
 works sometimes and ms never back supported it to actually work :)


 On Tuesday, August 6, 2013, Alfred Hall wrote:

 **
 Yeah you're having exactly the same issues as I am. I'm surprised others
 haven't had this problem before. Not sure who works on this area of the
 mono codebase these days. If you got a minimal test case it may be worth us
 raising a Xamarin bug in bugzilla.

 -Original message-
 *From:* Nikita Tsukanov kek...@gmail.com
 *Sent:* Tuesday 6th August 2013 20:18
 *To:* mono-devel-list@lists.ximian.com
 *Subject:* Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up
 on linux

 Running with mono from master haven't helped.

 And I'm not sure what the hell is going on, but I cann't reproduce the
 issue when running under... Monodevelop's debugger. It runs perfectly under
 it, but when I try to run the same binary from console (even with --debug
 option) it locks up or segfaults. Does anyone know what does it mean?


 2013/8/6 Nikita Tsukanov kek...@gmail.com

 Great. It locked up with my more complex logic.
 Funny fact: NancyFx increases request processing time from 2ms to 70ms
 with the same echo response.
 Another funny fact: with MONO_DISABLE_AIO I've got segfault.

 Now I'll try to use build patched mono. Not sure that it's the same issue,
 because in my case it never tries to read and write simultaneously  on the
 same socket.


 2013/8/6 Greg Young gregoryyou...@gmail.com

 There are many cases the patch we provided does not affect eg no overlap
 in io between send/receive


 On Tuesday, August 6, 2013, Nikita Tsukanov wrote:

 Interesting... I've written a simple server using only Socket.BeginRecieve
 and Socket.BeginSend. It just reads 100 bytes and then sends hardcoded HTTP
 response. Now jmeter is working for 5 minutes and it still responds with
 Lorem ipsum ... perfectly. I'll try to port my SCGI server logic from
 NetworkStream to Socket and see what will happen.


 2013/8/6 Andrés G. Aragoneses kno...@gmail.com

 On 06/08/13 18:42, Nikita Tsukanov wrote:

 Ubuntu 13.04, Mono JIT compiler version 3.2.0 (tarball Tue Jul 30
 21:08:00 UTC 2013)


 Mono 3.2.0 does *not* hav



-- 
Le doute n'est pas une condition agréable, mais la certitude est absurde.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-05 Thread Alfred Hall
Getting similar issues when using FastCGI/XSP proxied via Nginx using tcp and 
unix sockets (tried both). After hammering it with jmeter it ends up locking 
up. I'm wondering if other mono webapps have this issue. Would be useful if 
someone else here could do a similar loadtest using jmeter  and let me know if 
it happens to them.

-Original message-
From: Alfred Hall ah...@ahall.org
Sent: Sunday 4th August 2013 17:41
To: Nikita Tsukanov kek...@gmail.com; mono-devel-list@lists.ximian.com
Subject: Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

 
Hi Nikita.

Full thread dump:

threadpool thread tid=0x0x7fc4ad29d700 this=0x0x7fc4ad584c70 thread handle 
0x80f state : not waiting owns ()


IO Threadpool worker tid=0x0x7fc4ad25c700 this=0x0x7fc4ad584dd0 thread handle 
0x810 state : interrupted state owns ()


IO Threadpool worker tid=0x0x7fc4a7567700 this=0x0x7fc4a741d350 thread handle 
0x845 state : interrupted state owns ()


Threadpool worker tid=0x0x7fc4ac39a700 this=0x0x7fc4a6192270 thread handle 
0x837 state : interrupted state owns ()
  at unknown 0x
  at (wrapper managed-to-native) object.__icall_wrapper_mono_gc_alloc_vector 
(intptr,intptr,intptr) 0x
  at (wrapper alloc) object.AllocVector (intptr,intptr) 0x
  at System.Net.HttpConnection.BeginReadRequest () 0x0003a
  at System.Net.EndPointListener.OnAccept (object,System.EventArgs) 0x00357
  at System.Net.Sockets.SocketAsyncEventArgs.OnCompleted 
(System.Net.Sockets.SocketAsyncEventArgs) 0x0002e
  at System.Net.Sockets.SocketAsyncEventArgs.AcceptCallback 
(System.IAsyncResult) 0x00336
  at System.Net.Sockets.SocketAsyncEventArgs.DispatcherCB (System.IAsyncResult) 
0x0010f
  at (wrapper runtime-invoke) Module.runtime_invoke_void__this___object 
(object,intptr,intptr,intptr) 0x


I then tried the same again and only got this in my trace:

Full thread dump:

threadpool thread tid=0x0x7f31b8ac5700 this=0x0x7f31b8da4c70 thread handle 
0x80e state : not waiting owns ()


IO Threadpool worker tid=0x0x7f31b8a84700 this=0x0x7f31b8da4dd0 thread handle 
0x80f state : interrupted state owns ()

Not sure why I'm not getting any dump here. Any more debugging I can do on 
there?

What seems to happen is its coping well initially with the requests and then in 
all of a sudden it stops accepting connections and existing connections dont 
die off.

Cheers,
Alf
-Original message-
From: Nikita Tsukanov kek...@gmail.com
Sent: Sunday 4th August 2013 16:13
To: mono-devel-list@lists.ximian.com
Subject: Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

Alfred, please, try to send SIGQUIT to mono (i. e. kill -SIGQUIT {PID}) when it 
stops processing requests. It will force mono to write thread stack traces to 
stdout. Grab them and post here, I suspect that the issue is simular to one 
experienced by me.


2013/8/4 Nikita Tsukanov kek...@gmail.com mailto:kek...@gmail.com 
Alfred, please, try to send SIGQUIT to mono (i. e. kill -SIGQUIT
{PID}) when it stops processing requests. It will force mono to write
thread stack traces to stdout. Grab them and post here, I suspect that
the issue is simular to one experienced by me.


___

Mono-devel-list mailing list

Mono-devel-list@lists.ximian.com

http://lists.ximian.com/mailman/listinfo/mono-devel-list




___

Mono-devel-list mailing list

Mono-devel-list@lists.ximian.com

http://lists.ximian.com/mailman/listinfo/mono-devel-list



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-04 Thread Nikita Tsukanov
 Hi there.

 I'm running the NancyFX web framework in self hosting mode which is using 
 HttpListener which basically means I deploy an executable and run it and it 
 will start a webserver on localhost on a TCP port of choice. I then use nginx 
 to proxy to it.

 I first ran my executable on my macbook pro and bombarded it with jmeter and 
 it coped fine and no issues.
 I then deployed on my debian wheezy 64 bit linux box running on top of KVM 
 using mono 3.2.0 and performed the same jmeter experiment. It locks up fairly 
 quickly and wont take any new requests. I've tried using both sgen and boehm 
 but they behave similarly although it seems to lock up faster when using 
 sgen. I also tried enabling MONO_DISABLE_AIO but it doesn't make any 
 difference.

 Anyone had similar issues?


I also experienced problems with HttpListener before (on Mono 2.6 and
2.10). Forcing mono to print stacktraces with SIGQUIT signal revealed
the fact that HttpListener hungs somewhere in
System.Net.HttpConnection.ProcessInput.
But in my case it works pretty fine behind nginx.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-04 Thread Daniel Lo Nigro
I've noticed the same issue with self-hosted ASP.NET WebAPI, which is
probably the same underlying cause.


On Sun, Aug 4, 2013 at 11:07 AM, Alfred Hall ah...@ahall.org wrote:

 **
 Hi there.

 I'm running the NancyFX web framework in self hosting mode which is using
 HttpListener which basically means I deploy an executable and run it and it
 will start a webserver on localhost on a TCP port of choice. I then use
 nginx to proxy to it.

 I first ran my executable on my macbook pro and bombarded it with jmeter
 and it coped fine and no issues.
 I then deployed on my debian wheezy 64 bit linux box running on top of KVM
 using mono 3.2.0 and performed the same jmeter experiment. It locks up
 fairly quickly and wont take any new requests. I've tried using both sgen
 and boehm but they behave similarly although it seems to lock up faster
 when using sgen. I also tried enabling MONO_DISABLE_AIO but it doesn't
 make any difference.

 Anyone had similar issues?

 I tried using self hosted ServiceStack which also uses HttpListener and
 had similar issues so I'm finding it unlikely that the bug is in NancyFX
 itself.

 I tried installing mono 2.10.8 to check if this is a regression, but
 getting exactly the same results.

 Any idea how I can debug this further or what could be going on.

 Cheers,
 Alf

 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-04 Thread Andrii Nakryiko
Hi,

Mono had a race in its TCP code for a long time, which caused a lot of
troubles for our project because under heavy load  TCP async methods
eventually stop receiving completion callbacks. But luckily a pull request
fixing this problem with epoll/kqueue backends by my colleague was merged
in to master, see  https://github.com/mono/mono/pull/703

So you can try latest master and see if problem is gone, possibly this bug
is the cause of your problem as symptoms are very similar.
4 серп. 2013 04:17, Alfred Hall ah...@ahall.org напис.

 **
 Hi there.

 I'm running the NancyFX web framework in self hosting mode which is using
 HttpListener which basically means I deploy an executable and run it and it
 will start a webserver on localhost on a TCP port of choice. I then use
 nginx to proxy to it.

 I first ran my executable on my macbook pro and bombarded it with jmeter
 and it coped fine and no issues.
 I then deployed on my debian wheezy 64 bit linux box running on top of KVM
 using mono 3.2.0 and performed the same jmeter experiment. It locks up
 fairly quickly and wont take any new requests. I've tried using both sgen
 and boehm but they behave similarly although it seems to lock up faster
 when using sgen. I also tried enabling MONO_DISABLE_AIO but it doesn't
 make any difference.

 Anyone had similar issues?

 I tried using self hosted ServiceStack which also uses HttpListener and
 had similar issues so I'm finding it unlikely that the bug is in NancyFX
 itself.

 I tried installing mono 2.10.8 to check if this is a regression, but
 getting exactly the same results.

 Any idea how I can debug this further or what could be going on.

 Cheers,
 Alf

 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-04 Thread Andrés G. Aragoneses

On 04/08/13 03:07, Alfred Hall wrote:

Hi there.

I'm running the NancyFX web framework in self hosting mode which is
using HttpListener which basically means I deploy an executable and run
it and it will start a webserver on localhost on a TCP port of choice. I
then use nginx to proxy to it.

I first ran my executable on my macbook pro and bombarded it with jmeter
and it coped fine and no issues.
I then deployed on my debian wheezy 64 bit linux box running on top of
KVM using mono 3.2.0 and performed the same jmeter experiment. It locks
up fairly quickly and wont take any new requests. I've tried using both
sgen and boehm but they behave similarly although it seems to lock up
faster when using sgen. I also tried enabling MONO_DISABLE_AIO but it
doesn't make any difference.

Anyone had similar issues?

I tried using self hosted ServiceStack which also uses HttpListener and
had similar issues so I'm finding it unlikely that the bug is in NancyFX
itself.

I tried installing mono 2.10.8 to check if this is a regression, but
getting exactly the same results.

Any idea how I can debug this further or what could be going on.


Hey Alfred.

Could you try mono master (3.3) instead of 3.2? I mention this because 
this pull request [1] has been merged recently, which could help in this 
situation (and wouldn't make much difference in Mac since the problem in 
this platform is worked-around by avoiding kqueue [2]).


[1] https://github.com/mono/mono/pull/703

[2] https://github.com/mono/mono/blob/master/configure.in#L1823

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-04 Thread Alfred Hall
I meant to say I tried master too:

root@mulder:~# /opt/ahall-mono/bin/mono -V
Mono JIT compiler version 3.3.0 (master/2354865 Sun Aug  4 00:42:51 BST 2013)
Copyright (C) 2002-2012 Novell, Inc, Xamarin Inc and Contributors. 
www.mono-project.com
TLS:           __thread
SIGSEGV:       altstack
Notifications: epoll
Architecture:  amd64
Disabled:      none
Misc:          softdebug
LLVM:          supported, not enabled.
GC:            sgen


That should have the fix in from https://github.com/ysw, but setting 
MONO_DISABLE_AIO should have worked around that anyway, as its meant to bypass 
the epoll backend.


My Nancy service is literally just returning a very simple JSON:


public class HelloWorldModule : NancyModule
{
public HelloWorldModule()
{
Get[/] = parameters = {
return Response.AsJson(new HomeResponse { Message = Test });
};
}
}

In JMeter I'm using 100 threads and loop count of 100 and it locks up after 
like 15 seconds even over the network. Very odd.


-Original message-
 From:quot;Andrés G. Aragonesesquot; kno...@gmail.com 
 mailto:kno...@gmail.com 
 Sent: Sunday 4th August 2013 10:03
 To: mono-devel-list@lists.ximian.com 
 mailto:mono-devel-list@lists.ximian.com 
 Subject: Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on 
 linux
 
 On 04/08/13 03:07, Alfred Hall wrote:
  Hi there.
 
  I'm running the NancyFX web framework in self hosting mode which is
  using HttpListener which basically means I deploy an executable and run
  it and it will start a webserver on localhost on a TCP port of choice. I
  then use nginx to proxy to it.
 
  I first ran my executable on my macbook pro and bombarded it with jmeter
  and it coped fine and no issues.
  I then deployed on my debian wheezy 64 bit linux box running on top of
  KVM using mono 3.2.0 and performed the same jmeter experiment. It locks
  up fairly quickly and wont take any new requests. I've tried using both
  sgen and boehm but they behave similarly although it seems to lock up
  faster when using sgen. I also tried enabling MONO_DISABLE_AIO but it
  doesn't make any difference.
 
  Anyone had similar issues?
 
  I tried using self hosted ServiceStack which also uses HttpListener and
  had similar issues so I'm finding it unlikely that the bug is in NancyFX
  itself.
 
  I tried installing mono 2.10.8 to check if this is a regression, but
  getting exactly the same results.
 
  Any idea how I can debug this further or what could be going on.
 
 Hey Alfred.
 
 Could you try mono master (3.3) instead of 3.2? I mention this because 
 this pull request [1] has been merged recently, which could help in this 
 situation (and wouldn't make much difference in Mac since the problem in 
 this platform is worked-around by avoiding kqueue [2]).
 
 [1] https://github.com/mono/mono/pull/703
 
 [2] https://github.com/mono/mono/blob/master/configure.in#L1823
 
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com mailto:Mono-devel-list@lists.ximian.com 
 http://lists.ximian.com/mailman/listinfo/mono-devel-list 
 http://lists.ximian.com/mailman/listinfo/mono-devel-list 
 
 

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-04 Thread hy...@hyber.dk
Hi Alfred

Are you sure its not a ulimit issue? I have had this issue before with the 
nofile limit as each tcp session is a file under /proc and when you have 
1024 open (or close wait) sessions the OS does not allow you to open more files 
and the code seems to hang for a bit until a session is completely gone. Eg. 
Timed out and you can create files again...


--
Esben
(on mobile)

- Reply message -
Fra: Alfred Hall ah...@ahall.org
Til: Andrés G. Aragoneses kno...@gmail.com, 
mono-devel-list@lists.ximian.com, mono-devel-list@lists.ximian.com
Emne: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux
Dato: søn., aug. 4, 2013 13:17
RE: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux


I meant to say I tried master too:
root@mulder:~# /opt/ahall-mono/bin/mono -VMono JIT compiler version 3.3.0 
(master/2354865 Sun Aug  4 00:42:51 BST 2013)Copyright (C) 2002-2012 Novell, 
Inc, Xamarin Inc and Contributors. www.mono-project.com TLS:   __thread 
SIGSEGV:   altstack Notifications: epoll Architecture:  amd64 Disabled: 
 none Misc:  softdebug LLVM:  supported, not enabled. GC:   
 sgen
That should have the fix in from https://github.com/ysw, but setting 
MONO_DISABLE_AIO should have worked around that anyway, as its meant to bypass 
the epoll backend.My Nancy service is literally just returning a very simple 
JSON:public class HelloWorldModule : NancyModule
{
public HelloWorldModule()
{
Get[/] = parameters = {
return Response.AsJson(new HomeResponse { Message = Test });
};
}
}In JMeter I'm using 100 threads and loop count of 100 and it locks up after 
like 15 seconds even over the network. Very odd.
-Original message-
 From:quot;Andrés G. Aragonesesquot; kno...@gmail.com
 Sent: Sunday 4th August 2013 10:03
 To: mono-devel-list@lists.ximian.com
 Subject: Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on 
 linux
 
 On 04/08/13 03:07, Alfred Hall wrote:
  Hi there.
 
  I'm running the NancyFX web framework in self hosting mode which is
  using HttpListener which basically means I deploy an executable and run
  it and it will start a webserver on localhost on a TCP port of choice. I
  then use nginx to proxy to it.
 
  I first ran my executable on my macbook pro and bombarded it with jmeter
  and it coped fine and no issues.
  I then deployed on my debian wheezy 64 bit linux box running on top of
  KVM using mono 3.2.0 and performed the same jmeter experiment. It locks
  up fairly quickly and wont take any new requests. I've tried using both
  sgen and boehm but they behave similarly although it seems to lock up
  faster when using sgen. I also tried enabling MONO_DISABLE_AIO but it
  doesn't make any difference.
 
  Anyone had similar issues?
 
  I tried using self hosted ServiceStack which also uses HttpListener and
  had similar issues so I'm finding it unlikely that the bug is in NancyFX
  itself.
 
  I tried installing mono 2.10.8 to check if this is a regression, but
  getting exactly the same results.
 
  Any idea how I can debug this further or what could be going on.
 
 Hey Alfred.
 
 Could you try mono master (3.3) instead of 3.2? I mention this because 
 this pull request [1] has been merged recently, which could help in this 
 situation (and wouldn't make much difference in Mac since the problem in 
 this platform is worked-around by avoiding kqueue [2]).
 
 [1] https://github.com/mono/mono/pull/703
 
 [2] https://github.com/mono/mono/blob/master/configure.in#L1823
 
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list
 
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-04 Thread Alfred Hall
Hi Esben.

Certainly a good suggestion. I've tried increasing it:

nitoback@mulder:~$ ulimit -Sn
20

nitoback@mulder:~$ ulimit -Hn
20

Doesn't really have any effect. Here's what happens when I start hammering it - 
regarding connections - The self host is running on port 9591:

root@mulder:~# lsof -n | grep -i 9591 | wc -l
93
root@mulder:~# lsof -n | grep -i 9591 | wc -l
642
root@mulder:~# lsof -n | grep -i 9591 | wc -l
573
root@mulder:~# lsof -n | grep -i 9591 | wc -l
677
root@mulder:~# lsof -n | grep -i 9591 | wc -l
1270
root@mulder:~# lsof -n | grep -i 9591 | wc -l
1270

The connection count goes up to 1270 and at that point it hangs, this is 
slightly different each time I run this.

After having stopped the tests and 10 minutes after it:

root@mulder:~# lsof -n | grep -i 9591 | wc -l
1170

Here is an example of the connections that are in the CLOSE_WAIT state:

mono      2788 2840   nitoback   71u     IPv4              65081      0t0       
 TCP 127.0.0.1:9591-127.0.0.1:40372 (CLOSE_WAIT)
mono      2788 2840   nitoback   72u     IPv4              65082      0t0       
 TCP 127.0.0.1:9591-127.0.0.1:40373 (CLOSE_WAIT)

They seem to be stuck in CLOSE_WAIT which I guess means that there is unread 
data on the socket. When it gets into this situation its not recoverable, just 
hangs and keeps the connections in CLOSE_WAIT state.
-Original message-
From: hy...@hyber.dk hy...@hyber.dk
Sent: Sunday 4th August 2013 14:39
To: Alfred Hall ah...@ahall.org
Cc: mono-devel-list@lists.ximian.com
Subject: SV: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

 
Hi Alfred

Are you sure its not a ulimit issue? I have had this issue before with the 
nofile limit as each tcp session is a file under /proc and when you have 
1024 open (or close wait) sessions the OS does not allow you to open more files 
and the code seems to hang for a bit until a session is completely gone. Eg. 
Timed out and you can create files again...


--
Esben
(on mobile)


- Reply message -
Fra: Alfred Hall ah...@ahall.org
Til: Andrés G. Aragoneses kno...@gmail.com, 
mono-devel-list@lists.ximian.com, mono-devel-list@lists.ximian.com
Emne: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux
Dato: søn., aug. 4, 2013 13:17


I meant to say I tried master too:

root@mulder:~# /opt/ahall-mono/bin/mono -V
Mono JIT compiler version 3.3.0 (master/2354865 Sun Aug  4 00:42:51 BST 2013)
Copyright (C) 2002-2012 Novell, Inc, Xamarin Inc and Contributors. 
www.mono-project.com
TLS:           __thread
SIGSEGV:       altstack
Notifications: epoll
Architecture:  amd64
Disabled:      none
Misc:          softdebug
LLVM:          supported, not enabled.
GC:            sgen


That should have the fix in from https://github.com/ysw, but setting 
MONO_DISABLE_AIO should have worked around that anyway, as its meant to bypass 
the epoll backend.


My Nancy service is literally just returning a very simple JSON:


public class HelloWorldModule : NancyModule
{
public HelloWorldModule()
{
Get[/] = parameters = {
return Response.AsJson(new HomeResponse { Message = Test });
};
}
}

In JMeter I'm using 100 threads and loop count of 100 and it locks up after 
like 15 seconds even over the network. Very odd.


-Original message-
 From:quot;Andrés G. Aragonesesquot; kno...@gmail.com 
 mailto:kno...@gmail.com 
 Sent: Sunday 4th August 2013 10:03
 To: mono-devel-list@lists.ximian.com 
 mailto:mono-devel-list@lists.ximian.com 
 Subject: Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on 
 linux
 
 On 04/08/13 03:07, Alfred Hall wrote:
  Hi there.
 
  I'm running the NancyFX web framework in self hosting mode which is
  using HttpListener which basically means I deploy an executable and run
  it and it will start a webserver on localhost on a TCP port of choice. I
  then use nginx to proxy to it.
 
  I first ran my executable on my macbook pro and bombarded it with jmeter
  and it coped fine and no issues.
  I then deployed on my debian wheezy 64 bit linux box running on top of
  KVM using mono 3.2.0 and performed the same jmeter experiment. It locks
  up fairly quickly and wont take any new requests. I've tried using both
  sgen and boehm but they behave similarly although it seems to lock up
  faster when using sgen. I also tried enabling MONO_DISABLE_AIO but it
  doesn't make any difference.
 
  Anyone had similar issues?
 
  I tried using self hosted ServiceStack which also uses HttpListener and
  had similar issues so I'm finding it unlikely that the bug is in NancyFX
  itself.
 
  I tried installing mono 2.10.8 to check if this is a regression, but
  getting exactly the same results.
 
  Any idea how I can debug this further or what could be going on.
 
 Hey Alfred.
 
 Could you try mono master (3.3) instead of 3.2? I mention this because 
 this pull request [1] has been merged recently, which could help in this 
 situation

Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-04 Thread Nikita Tsukanov
Alfred, please, try to send SIGQUIT to mono (i. e. kill -SIGQUIT {PID})
when it stops processing requests. It will force mono to write thread stack
traces to stdout. Grab them and post here, I suspect that the issue is
simular to one experienced by me.


2013/8/4 Nikita Tsukanov kek...@gmail.com

 Alfred, please, try to send SIGQUIT to mono (i. e. kill -SIGQUIT
 {PID}) when it stops processing requests. It will force mono to write
 thread stack traces to stdout. Grab them and post here, I suspect that
 the issue is simular to one experienced by me.

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-04 Thread Alfred Hall
Hi Nikita.

Full thread dump:

threadpool thread tid=0x0x7fc4ad29d700 this=0x0x7fc4ad584c70 thread handle 
0x80f state : not waiting owns ()


IO Threadpool worker tid=0x0x7fc4ad25c700 this=0x0x7fc4ad584dd0 thread handle 
0x810 state : interrupted state owns ()


IO Threadpool worker tid=0x0x7fc4a7567700 this=0x0x7fc4a741d350 thread handle 
0x845 state : interrupted state owns ()


Threadpool worker tid=0x0x7fc4ac39a700 this=0x0x7fc4a6192270 thread handle 
0x837 state : interrupted state owns ()
  at unknown 0x
  at (wrapper managed-to-native) object.__icall_wrapper_mono_gc_alloc_vector 
(intptr,intptr,intptr) 0x
  at (wrapper alloc) object.AllocVector (intptr,intptr) 0x
  at System.Net.HttpConnection.BeginReadRequest () 0x0003a
  at System.Net.EndPointListener.OnAccept (object,System.EventArgs) 0x00357
  at System.Net.Sockets.SocketAsyncEventArgs.OnCompleted 
(System.Net.Sockets.SocketAsyncEventArgs) 0x0002e
  at System.Net.Sockets.SocketAsyncEventArgs.AcceptCallback 
(System.IAsyncResult) 0x00336
  at System.Net.Sockets.SocketAsyncEventArgs.DispatcherCB (System.IAsyncResult) 
0x0010f
  at (wrapper runtime-invoke) Module.runtime_invoke_void__this___object 
(object,intptr,intptr,intptr) 0x


I then tried the same again and only got this in my trace:

Full thread dump:

threadpool thread tid=0x0x7f31b8ac5700 this=0x0x7f31b8da4c70 thread handle 
0x80e state : not waiting owns ()


IO Threadpool worker tid=0x0x7f31b8a84700 this=0x0x7f31b8da4dd0 thread handle 
0x80f state : interrupted state owns ()

Not sure why I'm not getting any dump here. Any more debugging I can do on 
there?

What seems to happen is its coping well initially with the requests and then in 
all of a sudden it stops accepting connections and existing connections dont 
die off.

Cheers,
Alf
-Original message-
From: Nikita Tsukanov kek...@gmail.com
Sent: Sunday 4th August 2013 16:13
To: mono-devel-list@lists.ximian.com
Subject: Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

Alfred, please, try to send SIGQUIT to mono (i. e. kill -SIGQUIT {PID}) when it 
stops processing requests. It will force mono to write thread stack traces to 
stdout. Grab them and post here, I suspect that the issue is simular to one 
experienced by me.


2013/8/4 Nikita Tsukanov kek...@gmail.com mailto:kek...@gmail.com 
Alfred, please, try to send SIGQUIT to mono (i. e. kill -SIGQUIT
{PID}) when it stops processing requests. It will force mono to write
thread stack traces to stdout. Grab them and post here, I suspect that
the issue is simular to one experienced by me.


___

Mono-devel-list mailing list

Mono-devel-list@lists.ximian.com

http://lists.ximian.com/mailman/listinfo/mono-devel-list



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on linux

2013-08-04 Thread Yuriy Solodkyy
Hi,

two notes:

1)

 That should have the fix in from https://github.com/ysw, but setting 
 MONO_DISABLE_AIO
should have worked around that anyway, as its meant to bypass the epoll
backend.
The problem we attempted to fix with async sockets is not only with epoll
backend.  i could reproduce it with plain poll backend as well.  Moreover
the patch we submitted only addresses it for epoll/kqueue and leaves poll
backend unpatched.

2)  From what I understand it is very unlikely it is related to the problem
described here.  The problem we fixed can only be observed if you have
parallel read and write operations on the same socket which is unlikely to
happen in RPC style protocols like HTTP, unless you do request pipelining
from the client.  However, if it is the same problem,  MONO_DISABLE_AIO won't
help as poll backend is not better than epoll/kqueue in this case.

-yuriy


On Sun, Aug 4, 2013 at 2:17 PM, Alfred Hall ah...@ahall.org wrote:

 **
 I meant to say I tried master too:

 root@mulder:~# /opt/ahall-mono/bin/mono -V
 Mono JIT compiler version 3.3.0 (master/2354865 Sun Aug  4 00:42:51 BST
 2013)
 Copyright (C) 2002-2012 Novell, Inc, Xamarin Inc and Contributors.
 www.mono-project.com
 TLS:   __thread
  SIGSEGV:   altstack
 Notifications: epoll
 Architecture:  amd64
  Disabled:  none
 Misc:  softdebug
 LLVM:  supported, not enabled.
  GC:sgen


 That should have the fix in from https://github.com/ysw, but setting 
 MONO_DISABLE_AIO should have worked around that anyway, as its meant to 
 bypass the epoll backend.

 My Nancy service is literally just returning a very simple JSON:

 public class HelloWorldModule : NancyModule
 {
 public HelloWorldModule()
 {
 Get[/] = parameters = {
 return Response.AsJson(new HomeResponse { Message = Test });
 };
 }
 }

 In JMeter I'm using 100 threads and loop count of 100 and it locks up
 after like 15 seconds even over the network. Very odd.


 -Original message-
  From:quot;Andrés G. Aragonesesquot; kno...@gmail.com

  Sent: Sunday 4th August 2013 10:03
  To: mono-devel-list@lists.ximian.com

  Subject: Re: [Mono-dev] NancyFX self hosting (HttpListener) locking up on 
  linux
 
  On 04/08/13 03:07, Alfred Hall wrote:
   Hi there.
  
   I'm running the NancyFX web framework in self hosting mode which is

   using HttpListener which basically means I deploy an executable and run
   it and it will start a webserver on localhost on a TCP port of choice. I
   then use nginx to proxy to it.
  

   I first ran my executable on my macbook pro and bombarded it with jmeter
   and it coped fine and no issues.
   I then deployed on my debian wheezy 64 bit linux box running on top of
   KVM using mono 3.2.0 and performed the same jmeter experiment. It locks

   up fairly quickly and wont take any new requests. I've tried using both
   sgen and boehm but they behave similarly although it seems to lock up
   faster when using sgen. I also tried enabling MONO_DISABLE_AIO but it

   doesn't make any difference.
  
   Anyone had similar issues?
  
   I tried using self hosted ServiceStack which also uses HttpListener and
   had similar issues so I'm finding it unlikely that the bug is in NancyFX

   itself.
  
   I tried installing mono 2.10.8 to check if this is a regression, but
   getting exactly the same results.
  
   Any idea how I can debug this further or what could be going on.

 
  Hey Alfred.
 
  Could you try mono master (3.3) instead of 3.2? I mention this because
  this pull request [1] has been merged recently, which could help in this
  situation (and wouldn't make much difference in Mac since the problem in

  this platform is worked-around by avoiding kqueue [2]).
 
  [1] https://github.com/mono/mono/pull/703

 
  [2] https://github.com/mono/mono/blob/master/configure.in#L1823

 
  ___
  Mono-devel-list mailing list
  Mono-devel-list@lists.ximian.com

  http://lists.ximian.com/mailman/listinfo/mono-devel-list

 
 


 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list




-- 
Yuriy Solodkyy
(y.solod...@gmail.com)
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list