<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:12.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:12.0pt;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> Newbie here, just got a work assignment to look into some performance issues with mapserver-6.0.1-3_0.el6.x86_64 – specifically, at one time, it rendered radar images very fast, then it degraded and seemed
to consume a lot more CPU. So – the EC2 instance side was upgraded significantly – and it still performs badly and uses a lot of CPU. It also seems to be getting slowly worse over time (days/months, not seconds/minutes). I asked this on IRC, but it looks like
email might be a better route.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> During all of this, the same mapserver instance renders satellite images quickly. These seem to be a similar, or in some cases larger size png to start with, rendered onto the same final map/size.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> So – the obvious answer is that it isn’t using the CPU to render/re-render, but rather spending it on something else – I/O most likely – eg: a network request, disk I/O, SQL query?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> The previous person working on it tried turning on debug at various levels – but unfortunately that made it even slower, making it tricky to answer “what is making it slow when debug is turned off?”<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> My first instinct was to try an strace and nothing was obvious. Next up – a flame graph from strace, and/or trying dtrace – but my understanding is that dtrace is a little weak on RHEL/CentOS/Amazon Linux
6.0 *<b>and</b>* I’m not particularly good at that. Also, we’re using fcgi, so attaching to the correct process is a bit tricky.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> My next instinct was to look at release notes and see if the current stable has anything fixes/improvements that directly address this – there aren’t any that are obvious to my eyes, but you developers have
been busy! So many things! Including some performance fixes and one “significant” performance fix.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Current config file:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">AddHandler fcgid-script fcgi<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">FcgidIPCDir /var/run/mod_fcgid<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">FcgidProcessTableFile /var/run/mod_fcgid/fcgid_shm<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">FcgidMaxProcesses 10<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">FcgidMaxProcessesPerClass 10<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">FcgidMaxRequestInMem 196608<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">FcgidInitialEnv PROJ_LIB /usr/share/proj<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">FcgidInitialEnv LD_LIBRARY_PATH "/usr/local/lib:/usr/pgsql-9.1/lib"<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">So – suggestions for my next move? I currently plan to take a quick swing at building 7.6 for RHEL 6.0, knowing there might be old libraries and whatnot that make that a non-starter. Of course – we’ve got
other infra running on this same instance, so upgrading everything is a much bigger task.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> Strace flame graph? <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> Stretch and try dtrace?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> A better way to use debug?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"> Something else I’m missing – eg: differences between the image types that make them perform so differently?
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Paul<o:p></o:p></span></p>
</div>
</body>
</html>