﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Ayende Rahien commented on Challenge: What killed the application?</title><description>Actually, it handled that really nicely.
</description><link>http://ayende.com/4475/challenge-what-killed-the-application#comment29</link><guid>http://ayende.com/4475/challenge-what-killed-the-application#comment29</guid><pubDate>Fri, 30 Apr 2010 13:03:41 GMT</pubDate></item><item><title>Mark commented on Challenge: What killed the application?</title><description>Because you dumped 90,000 tasks into the Parallel Framework task scheduler?
</description><link>http://ayende.com/4475/challenge-what-killed-the-application#comment28</link><guid>http://ayende.com/4475/challenge-what-killed-the-application#comment28</guid><pubDate>Fri, 30 Apr 2010 12:20:05 GMT</pubDate></item><item><title>Derek Fowler commented on Challenge: What killed the application?</title><description>Are you enumerating the entire contents of bulk_docs for every request to check your filename is unique?
</description><link>http://ayende.com/4475/challenge-what-killed-the-application#comment27</link><guid>http://ayende.com/4475/challenge-what-killed-the-application#comment27</guid><pubDate>Thu, 29 Apr 2010 07:47:05 GMT</pubDate></item><item><title>Felix commented on Challenge: What killed the application?</title><description>Don't know if the  Paralle.ForEach uses some sort of I/O port completion, but if so, I would think than blocking time waiting for socket reply ( the http request ) will be used, and do other file handles open and evantually run out of maximum file handles available. If I remember well, file handles are forced to some not so large count, in order to prevent buggy/malicious software to arm the system
</description><link>http://ayende.com/4475/challenge-what-killed-the-application#comment26</link><guid>http://ayende.com/4475/challenge-what-killed-the-application#comment26</guid><pubDate>Wed, 28 Apr 2010 20:59:54 GMT</pubDate></item><item><title>Francisco Velazquez commented on Challenge: What killed the application?</title><description>Maybe it could be a problem with max http connections by server: 
  
  
[stackoverflow.com/.../improving-performance-of-...](http://stackoverflow.com/questions/388908/improving-performance-of-multithreaded-httpwebrequests-in-net)</description><link>http://ayende.com/4475/challenge-what-killed-the-application#comment25</link><guid>http://ayende.com/4475/challenge-what-killed-the-application#comment25</guid><pubDate>Wed, 28 Apr 2010 18:11:13 GMT</pubDate></item><item><title>Dan Finucane commented on Challenge: What killed the application?</title><description>This article discusses the WININET limit 
[http://support.microsoft.com/kb/183110](http://support.microsoft.com/kb/183110)</description><link>http://ayende.com/4475/challenge-what-killed-the-application#comment24</link><guid>http://ayende.com/4475/challenge-what-killed-the-application#comment24</guid><pubDate>Wed, 28 Apr 2010 17:11:14 GMT</pubDate></item><item><title>Dan Finucane commented on Challenge: What killed the application?</title><description>The .NET thread pool does not create a thread unless there is a processor/core on your system that is doing nothing.  If there are no processors available the thread pool puts your request in a queue.  You shouldn't use with ThreadPool.SetMaxThreads.  The problem is that a thread is created and it blocks immediately when WININET already has two connections to a given host.  When it blocks the processor it was running on is freed and the thread pool takes a request out of its queue and schedules a thread.  You end up with all these threads blocked each taking up 1-2mb of virtual address space and they are all waiting for the same WININET resource to become available.
</description><link>http://ayende.com/4475/challenge-what-killed-the-application#comment23</link><guid>http://ayende.com/4475/challenge-what-killed-the-application#comment23</guid><pubDate>Wed, 28 Apr 2010 17:08:51 GMT</pubDate></item><item><title>tobi commented on Challenge: What killed the application?</title><description>I am impressed because many creative solutions have been posted. By coincidence I faced the same issue 5min ago. It was the threadpool. Breaking in the debugger and executing ThreadPool.SetMaxThreads in the immediate window helped so I did not have to restart my long-running batch job.
</description><link>http://ayende.com/4475/challenge-what-killed-the-application#comment22</link><guid>http://ayende.com/4475/challenge-what-killed-the-application#comment22</guid><pubDate>Wed, 28 Apr 2010 14:21:02 GMT</pubDate></item><item><title>Dag commented on Challenge: What killed the application?</title><description>HttpWebRequest.KeepAlive was set to its default "true" value?
</description><link>http://ayende.com/4475/challenge-what-killed-the-application#comment21</link><guid>http://ayende.com/4475/challenge-what-killed-the-application#comment21</guid><pubDate>Wed, 28 Apr 2010 13:35:56 GMT</pubDate></item><item><title>otsdr commented on Challenge: What killed the application?</title><description>Does it have anything to do with TIME-WAIT? 
[msdn.microsoft.com/en-us/library/ms819739.aspx](http://msdn.microsoft.com/en-us/library/ms819739.aspx)</description><link>http://ayende.com/4475/challenge-what-killed-the-application#comment20</link><guid>http://ayende.com/4475/challenge-what-killed-the-application#comment20</guid><pubDate>Wed, 28 Apr 2010 13:17:18 GMT</pubDate></item><item><title>jonnii commented on Challenge: What killed the application?</title><description>Is it something to do with the fact that you're posting to the same uri over and over again?
  
  
I can imagine a scenario where at some point you decide to persist the documents, by recursively walking the documents to be written and because there are so many you end up blowing the stack somehow.
</description><link>http://ayende.com/4475/challenge-what-killed-the-application#comment19</link><guid>http://ayende.com/4475/challenge-what-killed-the-application#comment19</guid><pubDate>Wed, 28 Apr 2010 12:35:22 GMT</pubDate></item><item><title>Shaun commented on Challenge: What killed the application?</title><description>Is PostTo doing an async post? I can't imagine how Parallel.ForEach would be bogging down the server since it limits the number of parallel tasks to the number of cores that you have. So if you are doing synchronous POST requests, it is only going to be posting 2-4 requests at a time, which is obviously not a lot. 
</description><link>http://ayende.com/4475/challenge-what-killed-the-application#comment18</link><guid>http://ayende.com/4475/challenge-what-killed-the-application#comment18</guid><pubDate>Wed, 28 Apr 2010 12:32:11 GMT</pubDate></item><item><title>tobi commented on Challenge: What killed the application?</title><description>The thread-pool was spawning more and more threads (max by default is 250) because from its perspective the work was IO bound (waiting on the posts). It tries to saturate the CPU by spawning more threads.
</description><link>http://ayende.com/4475/challenge-what-killed-the-application#comment17</link><guid>http://ayende.com/4475/challenge-what-killed-the-application#comment17</guid><pubDate>Wed, 28 Apr 2010 12:12:44 GMT</pubDate></item><item><title>Dan Finucane commented on Challenge: What killed the application?</title><description>Unless you modify the registry to increase the limit WININET makes at most two distinct connections to the same remote host so you are only going to benefit from two threads.  The other threads are going to block waiting for one of the two connections and if you have more than two processors in your system you are going to spin up more and more threads out of the .NET thread pool all of them blocking and taking up 1-2mb of virtual address space.
</description><link>http://ayende.com/4475/challenge-what-killed-the-application#comment16</link><guid>http://ayende.com/4475/challenge-what-killed-the-application#comment16</guid><pubDate>Wed, 28 Apr 2010 11:49:27 GMT</pubDate></item><item><title>Uriel Katz commented on Challenge: What killed the application?</title><description>Richard:it is single-threaded
  
  
you hit max sockets,file descriptors per process/system.
  
[msdn.microsoft.com/.../ms739169%28VS.85%29.aspx](http://msdn.microsoft.com/en-us/library/ms739169%28VS.85%29.aspx)  
  
the deafult is 64.
</description><link>http://ayende.com/4475/challenge-what-killed-the-application#comment15</link><guid>http://ayende.com/4475/challenge-what-killed-the-application#comment15</guid><pubDate>Wed, 28 Apr 2010 11:49:15 GMT</pubDate></item><item><title>Barry commented on Challenge: What killed the application?</title><description>Was it getting the same set of files ..
</description><link>http://ayende.com/4475/challenge-what-killed-the-application#comment14</link><guid>http://ayende.com/4475/challenge-what-killed-the-application#comment14</guid><pubDate>Wed, 28 Apr 2010 11:46:10 GMT</pubDate></item><item><title>Richard Dingwall commented on Challenge: What killed the application?</title><description>90,000 files @ 100-200ms each, no limit on the degrees of parallelization - lemme guess you had around 8,000 threads active, with 1MB stack allocated each, and hit OOM?
</description><link>http://ayende.com/4475/challenge-what-killed-the-application#comment13</link><guid>http://ayende.com/4475/challenge-what-killed-the-application#comment13</guid><pubDate>Wed, 28 Apr 2010 11:21:16 GMT</pubDate></item><item><title>Paul commented on Challenge: What killed the application?</title><description>It effectively DoS'd the server by uploading too many files at the one time (there were more parallel threads going on the client than the server could accept, so they started to timeout). 
</description><link>http://ayende.com/4475/challenge-what-killed-the-application#comment12</link><guid>http://ayende.com/4475/challenge-what-killed-the-application#comment12</guid><pubDate>Wed, 28 Apr 2010 11:15:03 GMT</pubDate></item><item><title>Tim van der Weijde commented on Challenge: What killed the application?</title><description>A wild guess, doesthe Directory.GetFiles() method return a non-generic collection instead of a generic one? If so, you should cast it.
  
  
</description><link>http://ayende.com/4475/challenge-what-killed-the-application#comment11</link><guid>http://ayende.com/4475/challenge-what-killed-the-application#comment11</guid><pubDate>Wed, 28 Apr 2010 11:10:57 GMT</pubDate></item><item><title>Rafal commented on Challenge: What killed the application?</title><description>What about the underlying database - maybe it had some concurrency problems - deadlocks, transaction timeouts, or run out of pooled connections?
</description><link>http://ayende.com/4475/challenge-what-killed-the-application#comment10</link><guid>http://ayende.com/4475/challenge-what-killed-the-application#comment10</guid><pubDate>Wed, 28 Apr 2010 11:09:02 GMT</pubDate></item><item><title>manningj commented on Challenge: What killed the application?</title><description>hit OOM because the server was buffering all the post'ed files?  It's gotta get the whole request (including file contents) into memory before passing it along AFAIK
</description><link>http://ayende.com/4475/challenge-what-killed-the-application#comment9</link><guid>http://ayende.com/4475/challenge-what-killed-the-application#comment9</guid><pubDate>Wed, 28 Apr 2010 10:40:42 GMT</pubDate></item><item><title>Frank Quednau commented on Challenge: What killed the application?</title><description>Depending how your test is set up, could it be that Parallel ForEach and Raven DB are getting worker threads from the same thread pool?
</description><link>http://ayende.com/4475/challenge-what-killed-the-application#comment8</link><guid>http://ayende.com/4475/challenge-what-killed-the-application#comment8</guid><pubDate>Wed, 28 Apr 2010 10:32:15 GMT</pubDate></item><item><title>DK commented on Challenge: What killed the application?</title><description>Is it because the directory contains too many files?
</description><link>http://ayende.com/4475/challenge-what-killed-the-application#comment7</link><guid>http://ayende.com/4475/challenge-what-killed-the-application#comment7</guid><pubDate>Wed, 28 Apr 2010 10:27:45 GMT</pubDate></item><item><title>Henning Anderssen commented on Challenge: What killed the application?</title><description>Your testclient is sending more requests than the server can handle, maybe you're using some sort of queue on the server which overflows.
  
  
Wild guessing from my side.
</description><link>http://ayende.com/4475/challenge-what-killed-the-application#comment6</link><guid>http://ayende.com/4475/challenge-what-killed-the-application#comment6</guid><pubDate>Wed, 28 Apr 2010 10:25:54 GMT</pubDate></item><item><title>Ayende Rahien commented on Challenge: What killed the application?</title><description>Peter,
  
No, we haven't got that. But I run into this before.
  
It usually only pop up using HTTPS, or authenticated connections, though.
  
  
LS,
  
Actually, no, we parallelize the action, not the enumeration, but thanks for letting me know about the new API
</description><link>http://ayende.com/4475/challenge-what-killed-the-application#comment5</link><guid>http://ayende.com/4475/challenge-what-killed-the-application#comment5</guid><pubDate>Wed, 28 Apr 2010 10:10:05 GMT</pubDate></item><item><title>Ayende Rahien commented on Challenge: What killed the application?</title><description>Henning,
  
No, there is no association between the two.
</description><link>http://ayende.com/4475/challenge-what-killed-the-application#comment4</link><guid>http://ayende.com/4475/challenge-what-killed-the-application#comment4</guid><pubDate>Wed, 28 Apr 2010 10:09:09 GMT</pubDate></item><item><title>LS commented on Challenge: What killed the application?</title><description>Directory.GetFiles("Docs","*.json") should be Directory.EnumerateFiles("Docs","*.json") if you want to be Parallel.
</description><link>http://ayende.com/4475/challenge-what-killed-the-application#comment3</link><guid>http://ayende.com/4475/challenge-what-killed-the-application#comment3</guid><pubDate>Wed, 28 Apr 2010 09:23:31 GMT</pubDate></item><item><title>Peter Ibbotson commented on Challenge: What killed the application?</title><description>Wild guess is that it ran out of IP source port numbers?
</description><link>http://ayende.com/4475/challenge-what-killed-the-application#comment2</link><guid>http://ayende.com/4475/challenge-what-killed-the-application#comment2</guid><pubDate>Wed, 28 Apr 2010 09:20:49 GMT</pubDate></item><item><title>Henning Anderssen commented on Challenge: What killed the application?</title><description>The files in Directory.GetFiles("Docs","*.json") is the same directory as 
[http://localhost:9090/bulk_docs](http://localhost:9090/bulk_docs), so you have an ever increasing filecount?
</description><link>http://ayende.com/4475/challenge-what-killed-the-application#comment1</link><guid>http://ayende.com/4475/challenge-what-killed-the-application#comment1</guid><pubDate>Wed, 28 Apr 2010 09:19:22 GMT</pubDate></item></channel></rss>