Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #64217

Re: Python Scalability TCP Server + Background Game

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.014
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'subject:Python': 0.06; 'element': 0.07; 'pursuing': 0.07; 'rest,': 0.07; 'subject: + ': 0.07; 'assuming': 0.09; 'http': 0.09; 'lines.': 0.09; 'api': 0.11; 'cc:addr:python-list': 0.11; 'jan': 0.12; 'mostly': 0.14; "(you're": 0.16; 'ack': 0.16; 'api,': 0.16; 'caching': 0.16; 'for,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'implies': 0.16; 'make,': 0.16; 'responses.': 0.16; 'rough': 0.16; 'sat,': 0.16; 'fix': 0.17; 'wrote:': 0.18; 'fit': 0.20; 'manual': 0.22; 'cc:addr:python.org': 0.22; 'bytes': 0.24; 'instance,': 0.24; 'tend': 0.24; 'test.': 0.24; 'fairly': 0.24; 'cc:2**0': 0.24; 'mention': 0.26; 'second': 0.26; 'post': 0.26; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; 'point': 0.28; 'rest': 0.29; 'direction': 0.30; 'message-id:@mail.gmail.com': 0.30; '(which': 0.31; 'requests': 0.31; 'you?': 0.31; 'fixing': 0.31; 'forces': 0.31; 'ones.': 0.31; 'text': 0.33; 'call.': 0.33; 'maybe': 0.34; 'could': 0.34; "can't": 0.35; 'connection': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'google': 0.35; 'there': 0.35; 'replies': 0.36; 'method': 0.36; 'minimum': 0.38; 'server': 0.38; 'handle': 0.38; 'pm,': 0.38; 'that,': 0.38; 'expect': 0.39; 'expensive': 0.39; 'extremely': 0.39; 'supporting': 0.39; 'enough': 0.39; 'either': 0.39; 'how': 0.40; 'read': 0.60; 'most': 0.60; 'hope': 0.61; 'new': 0.61; 'simple': 0.61; "you're": 0.61; 'further': 0.61; "you'll": 0.62; 'maximum': 0.63; 'more': 0.64; 'size.': 0.65; 'within': 0.65; 'worth': 0.66; 'response.': 0.68; 'reads': 0.68; 'receive': 0.70; 'internet': 0.71; 'calculations': 0.84; 'each,': 0.84; 'game,': 0.84; 'response,': 0.91; 'smoke': 0.91; 'subject:Game': 0.91; 'subject:Server': 0.91; 'to:none': 0.92; 'responses': 0.93
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type:content-transfer-encoding; bh=mMvXBiU257USdSPLVc3gyJYrJtpFyu/VqwvxCi544jg=; b=QFGZgWq7WvMYHFdWn1adJBder8/NVfZeTiHNJsq5IpSmf13b5qsEHbeAbIChVfor3y 58/lWa2eeEfl0rsEsJ0VBMM2io5Gqy4sh6b8a8cC+OYGmMq5m8RMicoV5lPxccSnlJer FD+TJLeXOnJIwOIm7Sm/moP7DfwnGChe95CRSghEmBBQFvfNxNpCERv1VpoDBxkqwU4I ZB290/qHHFE0ApOm2VBoOiAoG94gjrd5zixxhex01ssoMkaS0JLSUdKspkXqX+hkeDvV WOObTwO3+xkqdo7MLEcRcCmSS9lvKDKN0kmlLICc8dNZ97Gem6Z/0Nu2U3xKofEyww0q plYQ==
MIME-Version 1.0
X-Received by 10.66.141.165 with SMTP id rp5mr6942143pab.90.1390032107134; Sat, 18 Jan 2014 00:01:47 -0800 (PST)
In-Reply-To <0ab89748-bce2-436f-a00b-41e8199430f6@googlegroups.com>
References <27bae268-20a6-4ac3-a0dc-bd5be04d1da1@googlegroups.com> <mailman.5544.1389820104.18130.python-list@python.org> <0ab89748-bce2-436f-a00b-41e8199430f6@googlegroups.com>
Date Sat, 18 Jan 2014 19:01:47 +1100
Subject Re: Python Scalability TCP Server + Background Game
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding quoted-printable
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.5670.1390032110.18130.python-list@python.org> (permalink)
Lines 53
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1390032110 news.xs4all.nl 2967 [2001:888:2000:d::a6]:44783
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:64217

Show key headers only | View raw


On Sat, Jan 18, 2014 at 6:44 PM,  <phiwer@gmail.com> wrote:
>> Quick smoke test. How big are your requests/responses? You mention
>>
>> REST, which implies they're going to be based on HTTP. I would expect
>>
>> you would have some idea of the rough size. Multiply that by 50,000,
>>
>> and see whether your connection can handle it. For instance, if you
>>
>> have a 100Mbit/s uplink, supporting 50K requests/sec means your
>>
>> requests and responses have to fit within about 256 bytes each,
>>
>> including all overhead. You'll need a gigabit uplink to be able to
>>
>> handle a 2KB request or response, and that's assuming perfect
>>
>> throughput. And is 2KB enough for you?
>>
>>
>>
>> ChrisA
>
> My assumption is that there will be mostly reads and some writes; maybe in the order of 80-20%. There is a time element in the game, which forces player's entity to update on-demand. This is part of the reason why I wanted the server to be able to handle so many reques, so that it could handle the read part without having any caching layer.
>

(You're using Google Groups, which means your replies are
double-spaced and your new text is extremely long lines. Please fix
this, either by the fairly manual job of fixing every post you make,
or the simple method of switching to a better client. Thanks.)

My point was just about the REST API, nothing else. You have to handle
a request and a response for every API call. Whether they're reads or
writes, you need to receive an HTTP request and send an HTTP response
for each one. In order to support the 50k requests per second you hope
for, you would have to handle 50k requests coming in and 50k responses
going out. To do that, you would need - at a very VERY rough estimate
- a maximum request size of 2KB and a gigabit internet connection
(which is expensive). No further calculations are worth pursuing if
you can't handle those requests and responses.

(And small requests tend to be more expensive than large ones. Since
you'll need a minimum of >SYN, <SYN/ACK, >ACK, >DATA, <DATA, >FIN,
<FIN/ACK, >ACK in order to transmit and receive one single packet's
worth of data each way, you're looking at roughly 8 packets minimum
for a one-byte message and one-byte response. But at a very very rough
estimate, 2KB each direction is the most you can sustain.)

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Python Scalability TCP Server + Background Game phiwer@gmail.com - 2014-01-15 10:37 -0800
  Re: Python Scalability TCP Server + Background Game Chris Angelico <rosuav@gmail.com> - 2014-01-16 08:08 +1100
    Re: Python Scalability TCP Server + Background Game phiwer@gmail.com - 2014-01-17 23:44 -0800
      Re: Python Scalability TCP Server + Background Game Chris Angelico <rosuav@gmail.com> - 2014-01-18 19:01 +1100
        Re: Python Scalability TCP Server + Background Game phiwer@gmail.com - 2014-01-18 03:54 -0800
  Re: Python Scalability TCP Server + Background Game Asaf Las <roegltd@gmail.com> - 2014-01-18 04:13 -0800
    Re: Python Scalability TCP Server + Background Game phiwer@gmail.com - 2014-01-18 04:40 -0800
      Re: Python Scalability TCP Server + Background Game Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-01-18 13:19 +0000
        Re: Python Scalability TCP Server + Background Game Philip Werner <phiwer@gmail.com> - 2014-01-19 12:53 -0600
          Re: Python Scalability TCP Server + Background Game Chris Angelico <rosuav@gmail.com> - 2014-01-20 05:58 +1100
            Re: Python Scalability TCP Server + Background Game Philip Werner <phiwer@gmail.com> - 2014-01-21 03:59 -0600

csiph-web