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


Groups > comp.lang.python > #15688

Re: Py2.7/FreeBSD: maximum number of open files

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <lists@cheimes.de>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.017
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; '2.7': 0.04; 'behavior.': 0.07; 'python': 0.08; 'subject:files': 0.09; 'though:': 0.09; 'binary': 0.13; 'cc:addr:python-list': 0.15; 'thanks!': 0.15; '2.x)': 0.16; 'backported': 0.16; 'tobias': 0.16; 'bytes': 0.18; 'string,': 0.18; "doesn't": 0.23; 'wonder': 0.23; 'header:In- Reply-To:1': 0.23; 'cc:2**0': 0.25; 'unicode': 0.28; 'cc:addr:python.org': 0.29; 'seem': 0.30; '3.x': 0.30; 'str': 0.30; 'subject:number': 0.30; 'version': 0.31; 'go.': 0.32; "can't": 0.32; "i've": 0.33; 'there': 0.33; 'header:User-Agent:1': 0.33; 'causing': 0.34; 'creates': 0.34; 'file.': 0.34; 'probably': 0.34; 'towards': 0.35; "what's": 0.35; 'subject:/': 0.35; 'file': 0.36; 'but': 0.37; 'received:org': 0.37; 'open': 0.38; 'option': 0.38; 'either': 0.39; 'subject:: ': 0.39; 'data': 0.40; 'getting': 0.40; 'files': 0.40; 'more': 0.60; 'opened': 0.64; 'taking': 0.66; 'non-unicode': 0.84; 'opportunity!': 0.84; 'schrieb': 0.84; 'old,': 0.97
Date Mon, 14 Nov 2011 20:34:31 +0100
From Christian Heimes <lists@cheimes.de>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1
MIME-Version 1.0
To Tobias Oberstein <tobias.oberstein@tavendo.de>
Subject Re: Py2.7/FreeBSD: maximum number of open files
References <634914A010D0B943A035D226786325D42D0C264772@EXVMBX020-12.exch020.serverdata.net> <j9rfda$mfs$1@dough.gmane.org> <634914A010D0B943A035D226786325D42D0C2647C8@EXVMBX020-12.exch020.serverdata.net> <4EC1470B.90403@cheimes.de> <mailman.2705.1321290230.27778.python-list@python.org> <e3901b26-33ab-41b4-a8b1-82d08f15c125@u6g2000vbg.googlegroups.com> <634914A010D0B943A035D226786325D42D0C26481A@EXVMBX020-12.exch020.serverdata.net> <j9rl5k$5i1$1@dough.gmane.org> <634914A010D0B943A035D226786325D42D0C26485F@EXVMBX020-12.exch020.serverdata.net>
In-Reply-To <634914A010D0B943A035D226786325D42D0C26485F@EXVMBX020-12.exch020.serverdata.net>
X-Enigmail-Version 1.4a1pre
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding 7bit
Cc "python-list@python.org" <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2711.1321299276.27778.python-list@python.org> (permalink)
Lines 26
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1321299277 news.xs4all.nl 6881 [2001:888:2000:d::a6]:52146
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:15688

Show key headers only | View raw


Am 14.11.2011 19:28, schrieb Tobias Oberstein:
> Thanks! This is probably the most practical option I can go.
> 
> I've just tested: the backported new IO on Python 2.7 will indeed
> open >32k files on FreeBSD. It also creates the files much faster.
> The old, non-monkey-patched version was getting slower and
> slower as more files were opened/created ..

I wonder what's causing the O(n^2) behavior. Is it the old file type or
BSD's fopen() fault?


> There seem to be slight differences though:
> 
> Non-monkey patched: I can write to the file a non-Unicode string,
> even when the file was opened non-Binary.
> 
> With monkey patch: either open the file Binary-mode, or
> write Unicode strings ..

Python 3.x doesn't collate data and text but distinguishes between bytes
(str type in Python 2.x) and unicode. You can't write unicode to a
binary file and str to a text file. See it as an opportunity! You are
taking the first step towards Python 3 compatibility. :)

Christian

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


Thread

AW: Py2.7/FreeBSD: maximum number of open files Tobias Oberstein <tobias.oberstein@tavendo.de> - 2011-11-14 09:03 -0800
  Re: Py2.7/FreeBSD: maximum number of open files Jon Clements <joncle@googlemail.com> - 2011-11-14 09:33 -0800
    AW: Py2.7/FreeBSD: maximum number of open files Tobias Oberstein <tobias.oberstein@tavendo.de> - 2011-11-14 09:46 -0800
    Re: Py2.7/FreeBSD: maximum number of open files Christian Heimes <lists@cheimes.de> - 2011-11-14 19:03 +0100
    AW: Py2.7/FreeBSD: maximum number of open files Tobias Oberstein <tobias.oberstein@tavendo.de> - 2011-11-14 10:28 -0800
    Re: Py2.7/FreeBSD: maximum number of open files Christian Heimes <lists@cheimes.de> - 2011-11-14 20:34 +0100
      Re: Py2.7/FreeBSD: maximum number of open files Chris Torek <nospam@torek.net> - 2011-11-30 19:29 +0000

csiph-web