From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.229.87.136 with SMTP id w8cs82436qcl; Fri, 21 Jan 2011 04:59:16 -0800 (PST) Return-Path: Received-SPF: pass (google.com: domain of rack-devel+bncCJiRqd7pARChhubpBBoEsRWpnA@googlegroups.com designates 10.223.83.4 as permitted sender) client-ip=10.223.83.4; Authentication-Results: mr.google.com; spf=pass (google.com: domain of rack-devel+bncCJiRqd7pARChhubpBBoEsRWpnA@googlegroups.com designates 10.223.83.4 as permitted sender) smtp.mail=rack-devel+bncCJiRqd7pARChhubpBBoEsRWpnA@googlegroups.com; dkim=pass header.i=rack-devel+bncCJiRqd7pARChhubpBBoEsRWpnA@googlegroups.com Received: from mr.google.com ([10.223.83.4]) by 10.223.83.4 with SMTP id d4mr160164fal.11.1295614755861 (num_hops = 1); Fri, 21 Jan 2011 04:59:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=domainkey-signature:x-beenthere:received-spf:mime-version:subject :from:in-reply-to:date:message-id:references:to:x-mailer :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :sender:list-subscribe:list-unsubscribe:content-type :content-transfer-encoding; bh=ou52Q8bs2U793QKwPAv4IMBdYqz3Zy/D4Zywh1Cfk0E=; b=cpTQFuz0sZi7Ny2/71CYspN7ZduCg3Fb77qoWpJivB87NVRC6uO6/cvcoJ4kNGL0rB 9hnxI1q0nvp+dORacLUmdO1NKiQvP+YZtffLzmDKjmut1Vdy+CLlrAc+NODNXj5lm6UO KKWNVXbJ60EGPdReIBtxlApBtYryucBXMuFuE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlegroups.com; s=beta; h=x-beenthere:received-spf:mime-version:subject:from:in-reply-to:date :message-id:references:to:x-mailer:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe:content-type:content-transfer-encoding; b=uKw8Flk0H5EjDaszUcG6mYCHJwCX68QnSWsraERUXVj77ImQoczlZzRzJGM6KKBL3s 9AECk9fwbaPSw6/bMcWb6zQvrBEnxcNOhTSwMTMiU/rYJGhJXPnKHj7AZs2dA7EJACHd 8rIU7lmLcWP3MZnKLmSB+jIeFBwwF8eFctP/E= Received: by 10.223.83.4 with SMTP id d4mr36436fal.11.1295614753361; Fri, 21 Jan 2011 04:59:13 -0800 (PST) X-BeenThere: rack-devel@googlegroups.com Received: by 10.223.144.87 with SMTP id y23ls388080fau.1.p; Fri, 21 Jan 2011 04:59:11 -0800 (PST) Received: by 10.223.74.144 with SMTP id u16mr57337faj.8.1295614751783; Fri, 21 Jan 2011 04:59:11 -0800 (PST) Received: by 10.223.74.144 with SMTP id u16mr57336faj.8.1295614751739; Fri, 21 Jan 2011 04:59:11 -0800 (PST) Received: from mail-bw0-f51.google.com (mail-bw0-f51.google.com [209.85.214.51]) by gmr-mx.google.com with ESMTPS id n23si1073992fam.9.2011.01.21.04.59.11 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 21 Jan 2011 04:59:11 -0800 (PST) Received-SPF: neutral (google.com: 209.85.214.51 is neither permitted nor denied by best guess record for domain of k.haase@finn.de) client-ip=209.85.214.51; Received: by bwz10 with SMTP id 10so1553029bwz.24 for ; Fri, 21 Jan 2011 04:59:11 -0800 (PST) Received: by 10.204.60.14 with SMTP id n14mr553670bkh.118.1295614750870; Fri, 21 Jan 2011 04:59:10 -0800 (PST) Received: from [10.110.1.34] (p5DDBB859.dip.t-dialin.net [93.219.184.89]) by mx.google.com with ESMTPS id x38sm4568356bkj.1.2011.01.21.04.59.07 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 21 Jan 2011 04:59:08 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1081) Subject: Re: multithreading not working for requests to the same url From: Konstantin Haase In-Reply-To: <97f5216f-a83e-439d-9fcc-bb241df23037@m13g2000yqb.googlegroups.com> Date: Fri, 21 Jan 2011 13:59:05 +0100 Message-Id: References: <97f5216f-a83e-439d-9fcc-bb241df23037@m13g2000yqb.googlegroups.com> To: rack-devel@googlegroups.com X-Mailer: Apple Mail (2.1081) X-Original-Sender: k.haase@finn.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 209.85.214.51 is neither permitted nor denied by best guess record for domain of k.haase@finn.de) smtp.mail=k.haase@finn.de Reply-To: rack-devel@googlegroups.com Precedence: list Mailing-list: list rack-devel@googlegroups.com; contact rack-devel+owners@googlegroups.com List-ID: List-Post: , List-Help: , List-Archive: Sender: rack-devel@googlegroups.com List-Subscribe: , List-Unsubscribe: , Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Concurrency is up to the concrete Rack handler (webserver), not rack. Konstantin On Jan 21, 2011, at 13:47 , Mathijs wrote: > Hi all, > > > In my application, a lot of time is spent on /inbox. > However, it looks as if rack does not support handling multiple > requests to the same url simultaneously. > > I used this 'demo' app: > class HelloWorld > def call(env) > sleep 15 > [200, {'Content-Type' => 'text/plain'}, ["Hello world!"]] > end > end > run Helloworld.new > > run with rackup demo.ru > open 3 browser tabs, enter these urls: > - http://localhost:9292/path1 > - http://localhost:9292/path1 > - http://localhost:9292/path2 > > You'll see that if you start the requests roughly at the same time, > the first path1 and path2 will complete at the same time. > The second path1 comes 15sec behind. > > Passing params (localhost:9292/path1?blah=3) will > trick the app to handle the request in parallel. Also, aliasing > localhost does the trick. > So it looks as if rack does some locking per url. > I couldn't find anything though. > > I tried this under REE with mongrel and webrick and under jruby with > trinidad and webrick. > They all behave the same. > > Is anyone aware of this behavior? What is the cause? > Thanks, > Mathijs