From owner-freebsd-questions@FreeBSD.ORG Thu Apr 6 08:43:45 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DC6BB16A420 for ; Thu, 6 Apr 2006 08:43:45 +0000 (UTC) (envelope-from freunden@gmail.com) Received: from nproxy.gmail.com (nproxy.gmail.com [64.233.182.187]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0F5AA43D49 for ; Thu, 6 Apr 2006 08:43:44 +0000 (GMT) (envelope-from freunden@gmail.com) Received: by nproxy.gmail.com with SMTP id m18so57875nfc for ; Thu, 06 Apr 2006 01:43:42 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=Kaz/NeVeUVyjAsObmya4aIZudMviIUmn3C8P48NpBBaQF+Y3b031u19S2ugun6IdU/yHfBWrQHsPdfsFRTYj/xkxrDDsOHGM/7ij9bOx9TMy/GVFn7/VZZca2OrXbgD37YtwPBL8QCQnGbnGQWjX6ygobIty5GmLpPmlHh4SApk= Received: by 10.49.81.11 with SMTP id i11mr423111nfl; Thu, 06 Apr 2006 01:43:42 -0700 (PDT) Received: by 10.48.234.14 with HTTP; Thu, 6 Apr 2006 01:43:42 -0700 (PDT) Message-ID: <42a5f58c0604060143g5e68e806r870761a1beeefbb5@mail.gmail.com> Date: Thu, 6 Apr 2006 16:43:42 +0800 From: "Karl Ma" To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Giving more CPU time to a swapping process? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Apr 2006 08:43:45 -0000 Hi, I have a python program in freebsd, doing a heavey indexing job involving a mega size array. The process is so memory-hungry that it starts swap after the physical RAM max out. (To be exact, I've lowered the per-process limitation to make this possible). However, when I use top to monitor the status, the STATE of the process started to stay as "swread" for most of the time (instead of RUN before using swap) and its priority has dropped to -20; and the corresponding WCPU drops to around 1% only. And the CPU consumption time in total (for the whole job) would only increase a minute or two even the process has been running for more than a few hours. In Windows XP, which has less per-task resource restriction (I guess?), I did successfully complete the task on the same hardware machine; although i= t takes more than 30 mins. How can I push up the priority of the whole paging task? How can I allocate more CPU attention to this process? I've tried using "nice" but it does not help. Please refer to the below top's snapshots at different times. (A) is earlie= r than (B), and so on. Thanks for your help in advance. =3D (A) =3D last pid: 766; load averages: 0.66, 0.21, 0.11 up 0+00:19:54 23:23:04 63 processes: 2 running, 61 sleeping CPU states: 96.6% user, 0.0% nice, 3.4% system, 0.0% interrupt, 0.0%idl= e Mem: 341M Active, 35M Inact, 98M Wired, 704K Cache, 91M Buf, 522M Free Swap: 998M Total, 998M Free PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMAND 751 root 1 118 0 245M 244M RUN 0:59 96.57% python =3D (B) =3D last pid: 792; load averages: 1.02, 0.70, 0.36 up 0+00:24:20 23:27:30 62 processes: 2 running, 60 sleeping CPU states: 92.5% user, 0.0% nice, 6.0% system, 1.5% interrupt, 0.0%idl= e Mem: 766M Active, 67M Inact, 115M Wired, 45M Cache, 109M Buf, 3636K Free Swap: 998M Total, 37M Used, 962M Free, 3% Inuse, 17M Out PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMAND 751 root 1 128 0 744M 743M RUN 5:14 94.63% python =3D (C) =3D last pid: 792; load averages: 1.06, 0.81, 0.43 up 0+00:25:54 23:29:04 62 processes: 2 running, 60 sleeping CPU states: 95.5% user, 0.0% nice, 4.1% system, 0.4% interrupt, 0.0%idl= e Mem: 849M Active, 2868K Inact, 115M Wired, 28M Cache, 109M Buf, 1656K Free Swap: 998M Total, 95M Used, 903M Free, 9% Inuse, 236K Out PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMAND 751 root 1 128 0 848M 841M RUN 6:42 91.46% python =3D (D) =3D last pid: 792; load averages: 1.15, 0.87, 0.47 up 0+00:26:36 23:29:46 62 processes: 1 running, 61 sleeping CPU states: 28.6% user, 0.0% nice, 18.8% system, 1.5% interrupt, 51.1%idl= e Mem: 843M Active, 5380K Inact, 116M Wired, 31M Cache, 109M Buf, 1656K Free Swap: 998M Total, 142M Used, 856M Free, 14% Inuse, 932K In, 56M Out PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMAND 751 root 1 -20 0 878M 841M swread 7:14 79.05% python =3D (E) =3D last pid: 817; load averages: 0.06, 0.36, 0.36 up 0+00:32:31 23:35:41 62 processes: 1 running, 61 sleeping CPU states: 4.9% user, 0.0% nice, 7.1% system, 0.0% interrupt, 88.0%idl= e Mem: 803M Active, 76M Inact, 88M Wired, 28M Cache, 109M Buf, 1656K Free Swap: 998M Total, 234M Used, 765M Free, 23% Inuse, 3148K In, 2284K Out PID USERNAME THR PRI NICE SIZE RES STATE TIME WCPU COMMAND 751 root 1 -20 0 915M 756M swread 8:01 1.03% python