Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 6952 invoked from network); 26 Apr 2009 06:19:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 26 Apr 2009 06:19:14 -0000 Received: (qmail 2950 invoked by uid 500); 26 Apr 2009 06:19:11 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 2887 invoked by uid 500); 26 Apr 2009 06:19:10 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 2878 invoked by uid 99); 26 Apr 2009 06:19:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Apr 2009 06:19:10 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of j.zuckerman@gmail.com designates 209.85.217.157 as permitted sender) Received: from [209.85.217.157] (HELO mail-gx0-f157.google.com) (209.85.217.157) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Apr 2009 06:19:04 +0000 Received: by gxk1 with SMTP id 1so3760641gxk.0 for ; Sat, 25 Apr 2009 23:18:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=rV/lhxRpDibUzj2Ak/CF0PKM07DNuu5hjPuerlvC3oE=; b=qAFWqU42oF9IuBsHqD7aeoaLENJ/q7ZzYU+itnZQuudOiCYnlC6YnACw+hgQfo9FpG Ms86JB0WdWp7cfxInINyHS7mu/O6D2jTIwzUF2LeYtx3DQ7euq3hXx6wPV7o9zoSXgUk 789mPOOykrxP7Eei7/YIqgn0TEeLtvszQto1o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=W+Vt1J02Pu/Lun3J2TgsPshoWvhAKxGctl7NNLzMQIMtiLV7+DyQuzP1BQib9D2h6R 5sGCi6dbsvV5XKDY+bnrGB/GueSO2nSTPHzT/pFR7UrjPgMzwVSX9fNt9i3f5zIpU/ok y42FtjEtijPr/w68kTQEs9AqGhjO4Otih+3jU= MIME-Version: 1.0 Received: by 10.151.45.2 with SMTP id x2mr7450925ybj.48.1240726723618; Sat, 25 Apr 2009 23:18:43 -0700 (PDT) In-Reply-To: <15e4667e0904250923k250bc6b3h5a81412f8ff20d6a@mail.gmail.com> References: <15e4667e0904250923k250bc6b3h5a81412f8ff20d6a@mail.gmail.com> Date: Sat, 25 Apr 2009 23:18:43 -0700 Message-ID: <5ddb50770904252318o134b8658xb73831e34304d715@mail.gmail.com> From: Jonathan Zuckerman To: users@httpd.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [users@httpd] Dot extremely slow when called from python cgi script On Saturday, April 25, 2009, Dan Yamins wrote: > I'm having a problem with performance of the program "dot" (for rendering= graphs) when called from a python cgi script, served by an apache virtual = host.=A0 I'm writing this email both the apache httpd list as well as the g= raphviz users lists (hoping some intersection might be useful). > Have you got fastcgi enabled? I doubt seriously that it would account fir 3.94 seconds but might help a little bit.. I believe it caches opcode.. Also have you thought about reading the apache log? If the time differential really is on the apache side I'm sure there will be reams of data to slog through > I'm using OSX 10.5.6 and graphviz2.22 (built via macports). > > When I run a simple python script that calls dot (via a system call) to r= ender a small graph, it takes about .04 seconds, which is normal.=A0 But wh= en I run the same call via CGI script it takes roughly 100 times longer (4 = seconds).=A0=A0=A0=A0 I've tried graphs of various sizes, ranging from very= tiny graphs (4 nodes) to much larger graphs. =A0 The 4 seconds figure for = the CGI script doesn't change much except for very large graphs, so the tim= e spent in the CGI script is probably not coming from the actual rendering = itself. > > Not all system calls in my CGI scripts take longer than their "regular ca= lled at the prompt" version (e.g. if I do a simple 'pwd' it is comparable i= n time when called in the CGI script versus the non-served script.=A0=A0 (A= nd many others perform fine.)=A0=A0 The problem just seems to be with the g= raphviz dot executable. > > Below are the two test scripts that when run on my machine illustrate the= problem. > > Any help (from either community) would be great. > > Thanks! > Dan > > > Here's the python script: run as "python test.py" > > ------test.py----------------- > import os, time > > T =3D time.time() > os.system('/opt/local/bin/dot -Tsvg -o test.svg graph.dot') > print time.time() - T=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 #output h= ere is 0.04 seconds > T =3D time.time() > os.system('pwd > testout.txt') > print time.time() - T=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 #output h= ere is 0.003 seconds > > > Here's the CGI script:=A0 run by navigating to the proper URL for the vir= tual host on my local machine > > ------test.cgi---------------- > > #!/Library/Frameworks/Python.framework/Versions/Current/bin/python > > import time > import cgi, os > > print 'Content-Type: text/html; charset=3Dutf-8\n\n' > os.chdir('../../Temp') > T =3D time.time() > os.system('/opt/local/bin/dot -Tsvg -o test.svg graph.dot') > print time.time() - T=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 #ou= tput here is like 4 seconds > T =3D time.time() > os.system('pwd > testout.txt') > print time.time() - T=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 #outpu= t here is 0.003 seconds > > > > > --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org