From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.229.87.136 with SMTP id w8cs82310qcl; Fri, 21 Jan 2011 04:56:41 -0800 (PST) Return-Path: Received-SPF: pass (google.com: domain of rack-devel+bncCPeb27CUBBCHhebpBBoE1P8HCw@googlegroups.com designates 10.150.54.1 as permitted sender) client-ip=10.150.54.1; Authentication-Results: mr.google.com; spf=pass (google.com: domain of rack-devel+bncCPeb27CUBBCHhebpBBoE1P8HCw@googlegroups.com designates 10.150.54.1 as permitted sender) smtp.mail=rack-devel+bncCPeb27CUBBCHhebpBBoE1P8HCw@googlegroups.com; dkim=pass header.i=rack-devel+bncCPeb27CUBBCHhebpBBoE1P8HCw@googlegroups.com Received: from mr.google.com ([10.150.54.1]) by 10.150.54.1 with SMTP id c1mr222185yba.60.1295614601398 (num_hops = 1); Fri, 21 Jan 2011 04:56:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=domainkey-signature:x-beenthere:mime-version:date:x-ip:user-agent :x-http-useragent:message-id:subject:from:to:x-original-sender :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:sender:list-subscribe:list-unsubscribe:content-type; bh=2ua0jDHOyB4LwhfpLrKqqd4E3NaATl6jqK1ySzKDof8=; b=4M4xylb/OcY1z6icvV1ghhGN6Ti6tcpK+QYT1ICyqAxec+GUuvoKospamkL6HzjiJz 6Zsptn7dZFP7UW44xVU80Bypoc/Mo/GitV5Ej0q4Cfc9fXqpyeBEOeDXgC9T3Z8fBdGT uyNoxXa2jXpeR6Tv1K6B4EpCNpAZ5yejoth1A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlegroups.com; s=beta; h=x-beenthere:mime-version:date:x-ip:user-agent:x-http-useragent :message-id:subject:from:to:x-original-sender:reply-to:precedence :mailing-list:list-id:list-post:list-help:list-archive:sender :list-subscribe:list-unsubscribe:content-type; b=3gATQQa/rJ3NGV1v+P5JtEFZy3pms/+zbMkYg9HnWRU00fc4TPx/q+EmpYoiBb9XrB c5WMpcjTsv1mzT6vUTNBTrTzkwOnzvKU1giLAdRLAszxu81+QtlCUMLKUQoEbiVbONal ssLeLsZfq4mcKVhq3bjZaJazrxC6cu0j8FSs0= Received: by 10.150.54.1 with SMTP id c1mr49911yba.60.1295614599132; Fri, 21 Jan 2011 04:56:39 -0800 (PST) X-BeenThere: rack-devel@googlegroups.com Received: by 10.150.197.14 with SMTP id u14ls601267ybf.7.p; Fri, 21 Jan 2011 04:56:38 -0800 (PST) Received: by 10.150.96.11 with SMTP id t11mr254588ybb.41.1295614598230; Fri, 21 Jan 2011 04:56:38 -0800 (PST) MIME-Version: 1.0 Received: by 10.100.140.3 with SMTP id n3mr19016and.67.1295614030359; Fri, 21 Jan 2011 04:47:10 -0800 (PST) Received: by m13g2000yqb.googlegroups.com with HTTP; Fri, 21 Jan 2011 04:47:10 -0800 (PST) Date: Fri, 21 Jan 2011 04:47:10 -0800 (PST) X-IP: 145.103.102.84 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Ubuntu/9.10 Chromium/10.0.644.0 Chrome/10.0.644.0 Safari/534.16,gzip(gfe) Message-ID: <97f5216f-a83e-439d-9fcc-bb241df23037@m13g2000yqb.googlegroups.com> Subject: multithreading not working for requests to the same url From: Mathijs To: Rack Development X-Original-Sender: bluescreen303@gmail.com 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=ISO-8859-1 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