Hi fontconfig list: 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. 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 render a small graph, it takes a normal (short) amount of time. But when I run the same call via CGI script it takes roughly 100 times longer. I wrote to the Apache and graphviz lists about this problem and got the following response: A hunch is that some cache is not seen or is not available. Could be the fontconfig cache. It could be the case that you have a ~dyamins/.fontconfig but httpd is not able to create one and there is no system cache. This seems precisely to be the problem. I do have a ~/.fontconfig directory containing cache files. When I delete it, the performance of the command line script is just as slow as the cgi script until the next time the command is run (e.g. after the cache is remade). So I guess the question becomes: how do I get apache and the CGI script to see and use the .fontconfig caches? I posted this question back to the apache list and got the following responses:> On Mac OS X Apache runs as the user www, which does indeed have its shellset to /usr/bin/false so you can''t log in to it.> Maybe there''s an environment variable that can be set to tell fontconfigto look for its caches somewhere else? You might need to ask the fontconfig list about that.>Apache doesn''t care about them. Maybe your CGI does, but setting up >the execution environment for your CGI isn''t really something OT here. >write to the fontconfig list>When you run your script (any script) as a cgi program under Apache, itruns under the user-id under which Apache itself runs.>That user-id may, or may not, have the same environment as when you run thescript from the command-line, under (presumbaly) your own user-id.>If the environment for your own user-id includes some environment variableswhich need to be set to indicate to the script where to find certain things>What we Apache guys do not know, is what exactly your script needs as anenvironment. That is off-topic here, and you must find this out in the appropriate command documentation, or on some related help forum. So I''m to your list to ask if any of you know how I should proceed. Please let me know if I haven''t provide enough, or the right, information, Thanks! Dan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.freedesktop.org/archives/fontconfig/attachments/20090520/2683730f/attachment.htm
On 05/20/2009 06:43 PM, Dan Yamins wrote:> So I''m to your list to ask if any of you know how I should proceed. > Please let me know if I haven''t provide enough, or the right, information,Try running "fc-cache -f -r" as root and see if that helps. behdad> Thanks! > Dan
On Thu, May 21, 2009 at 3:59 AM, Behdad Esfahbod <behdad at behdad.org> wrote:> On 05/20/2009 06:43 PM, Dan Yamins wrote: > > So I''m to your list to ask if any of you know how I should proceed. >> Please let me know if I haven''t provide enough, or the right, information, >> > > Try running "fc-cache -f -r" as root and see if that helps. >I did this -- it was one of the suggestion from the Apache list guys. It does not help. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.freedesktop.org/archives/fontconfig/attachments/20090521/cb8ef44e/attachment.html
On Wed, May 20, 2009 at 6:43 PM, Dan Yamins <dyamins at gmail.com> wrote:> Hi fontconfig list: > > 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. 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 render a > small graph, it takes a normal (short) amount of time. But when I run the > same call via CGI script it takes roughly 100 times longer. I wrote to > the Apache and graphviz lists about this problem and got the following > response: > > A hunch is that some cache is not seen or is not available. > Could be the fontconfig cache. It could be the case that you > have a ~dyamins/.fontconfig but httpd is not able to create one > and there is no system cache. > > This seems precisely to be the problem. I do have a ~/.fontconfig > directory containing cache files. When I delete it, the performance of the > command line script is just as slow as the cgi script until the next time > the command is run (e.g. after the cache is remade). > > So I guess the question becomes: how do I get apache and the CGI script to > see and use the .fontconfig caches? I posted this question back to the > apache list and got the following responses: > > > On Mac OS X Apache runs as the user www, which does indeed have its shell > set to /usr/bin/false so you can''t log in to it. > > Maybe there''s an environment variable that can be set to tell fontconfig > to look for its caches somewhere else? You might need to ask the fontconfig > list about that. > > > >When you run your script (any script) as a cgi program under Apache, it > runs under the user-id under which Apache itself runs. > >That user-id may, or may not, have the same environment as when you run > the script from the command-line, under (presumbaly) your own user-id. > >If the environment for your own user-id includes some environment > variables which need to be set to indicate to the script where to find > certain things > >What we Apache guys do not know, is what exactly your script needs as an > environment. That is off-topic here, and you must find this out in the > appropriate command documentation, or on some related help forum. > >The answer to this problem, by the way, is the "HOME" environment variable, containing the absolute path the user home directory. This environment variable was not being set in environment of the CGI script, but once it''s set explicitly, the caches are seen and run fast. This leads to my having the following question: if I want to set the cache directory explicitly (e.g. to use some shared cache area instead of the one in the user''s directory), how would I do that? Is there some environment variable I can set other than "HOME" that fontconfig will recognize? Thanks, Dan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.freedesktop.org/archives/fontconfig/attachments/20090601/ced010d2/attachment.html