WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

Re: [Xen-API] [PATCH] CA-45104: renice gzip so that it is nice to the ot

To: Marcus Granado <marcus.granado@xxxxxxxxxx>
Subject: Re: [Xen-API] [PATCH] CA-45104: renice gzip so that it is nice to the other dom0 processes
From: Lucas de Souza Santos <lucasdss@xxxxxxxxx>
Date: Fri, 24 Sep 2010 19:57:43 -0300
Cc: xen-api <xen-api@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 24 Sep 2010 15:58:27 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type; bh=vedu9APmKGAr/DIbZe70tptpLZ3YfmxCsn/zPu3v94s=; b=mD208XC99LVC5adGMpY37mnZZDvBENfz/biri6cxDjjcYTTfe5iljJ9q4kEQqDBy04 wMo0NzMRnhunB7z07GhU098w1NDMjrMMs+3J1j3T3/NzPx1JsTRaLxGTnpeEE4TWKY/u BOZRst9pOzw1nByB3McGy+/uA2pMz4NgYwBK0=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=x6QF9OF2VIWE61/4cuJB1CkuQ8bKqB3r4bxcI+Y67eF32tNNrp4IOMmcH2/kbqtSWO y4VhrEw9oGNR1GLjR5dkne9vKUe9k/x/YAJ2pXfizH7ciZbN8pVUNliqbBUlEoSiD70o Pd6Mttkpug9/pnwq+Bh5OTCmBTVyRXq7j12iY=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <2095ed131b6343e0a084.1284718603@localhost>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
References: <2095ed131b6343e0a084.1284718603@localhost>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
Hi Marcus,

Did you take a look at�http://www.zlib.net/pigz/�?
I did the same�idea of your patch here, but I exchanged gzip for pigz because it showed a good performance improvement.�

Regards,

Lucas de Souza Santos (ldss)


On Fri, Sep 17, 2010 at 7:16 AM, Marcus Granado <marcus.granado@xxxxxxxxxx> wrote:
�stdext/gzip.ml | �21 +++++++++++++++++++--
�1 files changed, 19 insertions(+), 2 deletions(-)


# HG changeset patch
# User Marcus Granado <marcus.granado@xxxxxxxxxx>
# Date 1284397485 -3600
# Node ID 2095ed131b6343e0a08406246705e793aecd5ee7
# Parent �164f63521e8262f541059a13a7f1d4d5f5ed7f2b
CA-45104: renice gzip so that it is nice to the other dom0 processes

Signed-off-by: Marcus Granado <marcus.granado@xxxxxxxxxxxxx>

diff -r 164f63521e82 -r 2095ed131b63 stdext/gzip.ml
--- a/stdext/gzip.ml
+++ b/stdext/gzip.ml
@@ -28,6 +28,20 @@
� | Active �(** we provide a function which writes into the compressor and a fd output *)
� | Passive (** we provide an fd input and a function which reads from the compressor *)

+(* renice/ionice the pid with lowest priority so that it doesn't *)
+(* use up all cpu resources in dom0 *)
+let lower_priority pid =
+ �let pid=Printf.sprintf "%d" (Forkhelpers.getpid pid) in
+ �(* renice 19 -p pid *)
+ �let renice="/usr/bin/renice" in
+ �let renice_args = ["19";"-p";pid] in
+ �let _=Forkhelpers.execute_command_get_output renice renice_args in
+ �(* ionice -c 3 [idle] -p pid *)
+ �let ionice="/usr/bin/ionice" in
+ �let ionice_args = ["-c";"3";"-p";pid] in
+ �let _=Forkhelpers.execute_command_get_output ionice ionice_args in
+ �()
+
�(** Runs a zcat process which is either:
� � i) a compressor; or (ii) a decompressor
� � and which has either
@@ -57,8 +71,11 @@
� � � � � � � zcat_out in � � � � � � � � � � � � � � � � (* close this before waitpid *)
� � � � let pid = Forkhelpers.safe_close_and_exec stdin stdout None [] gzip args in
� � � � close close_now;
- � � � �finally
- � � � � �(fun () -> f close_later)
+ � finally
+ � � (fun () ->
+ � � � lower_priority pid; �(* lowest priority to gzip *)
+ � � � f close_later
+ � � )
� � � � � (fun () ->
� � � � � � �let failwith_error s =
� � � � � � � �let mode = if mode = Compress then "Compression" else "Decompression" in

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api


_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
<Prev in Thread] Current Thread [Next in Thread>