<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Performance issues]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=6393</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=6393&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Performance issues.]]></description>
		<lastBuildDate>Thu, 01 Sep 2016 13:10:33 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Performance issues]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=26226#p26226</link>
			<description><![CDATA[<p>Try the MySQLtuner to adjust the server parameters and rebuild the indices.</p><p>You might want to optimise your FA db using my <a href="https://github.com/apmuthu/frontaccounting/blob/master/FAMods/sql/alter_to_latest2.3.sql">FAMods</a> with upgradation caveats.</p><p>Closing and deleting previous years after suitable backups will improve usage latencies.</p><p>The <strong>includes/db_pager.inc</strong> already has the efficient LIMIT clause in line 326:<br /></p><div class="codebox"><pre><code>        $sql .= &quot; LIMIT $offset, $page_len&quot;;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Thu, 01 Sep 2016 13:10:33 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=26226#p26226</guid>
		</item>
		<item>
			<title><![CDATA[Re: Performance issues]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=26225#p26225</link>
			<description><![CDATA[<p>3gp volume of data is too heavy for your server. You better increase your RAM speed and cache size to get the your FA work faster like before.&nbsp; It&#039;s not in code issue,&nbsp; I feel you have to increase your system speed.</p>]]></description>
			<author><![CDATA[null@example.com (kvvaradha)]]></author>
			<pubDate>Thu, 01 Sep 2016 12:34:54 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=26225#p26225</guid>
		</item>
		<item>
			<title><![CDATA[Re: Performance issues]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=26220#p26220</link>
			<description><![CDATA[<p>FA get slow... i have using FA from latest 3 years ...and i seen its take much time to load many pages .... specially that function db_pager .....</p><p>its requested to ADMIN to see FA indexing ...ajax ...load ..etc proper ...i have more then 3gb data ...its take 7-8min time to load for some pages ... i have increase many setting in php.inc etc ...</p>]]></description>
			<author><![CDATA[null@example.com (tester1)]]></author>
			<pubDate>Thu, 01 Sep 2016 11:39:12 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=26220#p26220</guid>
		</item>
		<item>
			<title><![CDATA[Re: Performance issues]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=26040#p26040</link>
			<description><![CDATA[<p>It is probably the scaling (rounding off) of the height with respect to the actual width (if smaller) or that of the width if the height is smaller, that may be the cause of the error. Any way to avoid scaling altogether as distortion occurs sometimes?</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Wed, 17 Aug 2016 05:07:51 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=26040#p26040</guid>
		</item>
		<item>
			<title><![CDATA[Re: Performance issues]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=26033#p26033</link>
			<description><![CDATA[<p>Hello,</p><p>I am not sure how to fix this. We use the tcpdf class member function Image(($img, $x, $y, $w, $h);</p><p>On line 75 in header2.inc we use the function AddImage($logo, $ccol, $this-&gt;row, 0, 40); This function in turn calls the tcpdf Image member function.</p><p>The parameter 40 is the height of the display. If the width is 0, then the width is calculated relative from the original width based on the height / image height.</p><p>During the years I have heard nothing about problems with the logo printing. Try to change the logo or laborate with the function parameters. Save the original line. Maybe you find a suitable solution.</p><p>/Joe<br />PS. I have involved Janusz in this problem. Maybe he can fix something.</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Tue, 16 Aug 2016 22:31:58 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=26033#p26033</guid>
		</item>
		<item>
			<title><![CDATA[Re: Performance issues]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=26026#p26026</link>
			<description><![CDATA[<p>On further investigation, it appears that the logo width, if too high only results in truncation of image when displayed in the report header. </p><p>Some sort of cache may be playing havoc.</p><p>The solution is to <br />1. upload some other Company logo (Setup -&gt; Company Setup) and update the company and then <br />2. revert back to the original logo and update the company and then <br />3. print range of invoices</p><p> Attached is a set of logos of varying widths and the way they get displayed in the Invoice header.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Tue, 16 Aug 2016 04:38:15 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=26026#p26026</guid>
		</item>
		<item>
			<title><![CDATA[Re: Performance issues]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=26025#p26025</link>
			<description><![CDATA[<p>All usual config settings on timeouts of PHP/Apache, were exhausted and finally the range of invoices printing issue was solved by reducing the width of the logo that initially spanned 660 pixels!</p><p><a href="http://stackoverflow.com/questions/849549/diagnosing-memory-leaks-allowed-memory-size-of-bytes-exhausted">Diagnosing Memory Leaks - Allowed memory size of # bytes exhausted</a></p><p>When a large width logo is used, the FA&#039;s PDF object cannot spawn a NewPage and the webserver dies ceasing browser output that makes the system appear to hang.</p><p>The attachment shows the diagnostic for a small logo where the output is as desired and has been wikied.</p><p>Other References:<br /><a href="http://paul-m-jones.com/archives/262">Memory Leaks With Objects in PHP 5</a><br /><a href="http://stackoverflow.com/questions/16068301/how-to-find-which-php-script-is-leaking-memory">How to find which PHP script is leaking memory?</a></p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Tue, 16 Aug 2016 03:26:52 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=26025#p26025</guid>
		</item>
		<item>
			<title><![CDATA[Re: Performance issues]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=26024#p26024</link>
			<description><![CDATA[<p>It is imperative for the <strong>stock_id</strong> field to be indexed in the <strong>debtor_trans_details</strong> table for all FA databases used with the equivalent of:</p><div class="codebox"><pre><code>ALTER TABLE `0_debtor_trans_details` ADD INDEX `stock_trans` (`stock_id`);</code></pre></div><p>The <strong><em>function</em> get_customer_trans_details()</strong> in the file <strong>sales/icludes/db/cust_trans_details_db.inc</strong> is used in <strong>reporting/rep107.php</strong> (and in <strong>110</strong>, <strong>113</strong> reports as well) to acquire the transaction list filtered as appropriate. The non filtered SQL in it is:</p><div class="codebox"><pre><code>SELECT trans.*,
       trans.unit_price + trans.unit_tax AS FullUnitPrice,
       trans.description AS StockDescription,
       stock.units,
       stock.mb_flag
FROM 0_debtor_trans_details trans
        INNER JOIN 0_stock_master stock USING (stock_id)
ORDER BY id;</code></pre></div><p>As the <strong>stock_master.stock_id </strong>and <strong>debtor_trans_details.id</strong> fields are primary keys, they stand already indexed. Hence the foreign key <strong>debtor_trans_details.stock_id</strong> is the one that is left to be indexed as it is the INNER JOIN field.</p><p>The said function can be modified to be:</p><div class="codebox"><pre><code>function get_customer_trans_details($debtor_trans_type, $debtor_trans_no)
{
    if (!is_array($debtor_trans_no))
        $debtor_trans_no = array( 0=&gt;$debtor_trans_no );
    $sql = &quot;SELECT trans.*,
        trans.unit_price + trans.unit_tax AS FullUnitPrice,
        trans.description As StockDescription,
        stock.units, stock.mb_flag
        FROM &quot;.TB_PREF.&quot;debtor_trans_details trans
             INNER JOIN &quot;.TB_PREF.&quot;stock_master stock USING (stock_id)
         WHERE (&quot;;

    $tr=array();
    foreach ($debtor_trans_no as $trans_no)
        $tr[] = &#039;debtor_trans_no=&#039;.db_escape($trans_no);
    $sql .= implode(&#039; OR &#039;, $tr);

    $sql.=    &quot;) AND debtor_trans_type=&quot;.db_escape($debtor_trans_type).&quot;
        ORDER BY id&quot;;
    return db_query($sql, &quot;The debtor transaction detail could not be queried&quot;);
}</code></pre></div><p>@joe: want to include it in the core? <a href="https://github.com/apmuthu/frontaccounting/commit/bce0eb853751b30dc8ed9f198a4f5062e3841b20">Committed in my FAMods</a>.</p><p>I can confirm that even after this, when a range of invoices is attempted to be printed, the webserver hangs. Single invoice printing works. Multi Invoice (range) printing fails at second invoice call of <strong>function get_sales_parent_lines()</strong> in file <strong>sales/includes/sales_db.inc</strong>.<br />In the first invoice call in the Training Co (Demo Co) it succeeds:</p><div class="codebox"><pre><code>SELECT parent.*
FROM 1_debtor_trans_details parent
    LEFT JOIN 0_debtor_trans_details trans 
        ON trans.src_id=parent.id
WHERE trans.debtor_trans_type=&#039;10&#039; 
  AND trans.debtor_trans_no=&#039;17&#039; 
GROUP BY parent.debtor_trans_no 
ORDER BY parent.debtor_trans_no;</code></pre></div><p>SQL SELECT debug Trail attached.</p><p>Web Server hangs when the statement <strong>$rep-&gt;NewPage()</strong> tries to get executed for the second page in <strong>rep107.php</strong> - tested in XAMPP v1.7.3 on WinXP SP3 / FireFox v37.0.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Mon, 15 Aug 2016 14:30:05 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=26024#p26024</guid>
		</item>
		<item>
			<title><![CDATA[Re: Performance issues]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=26023#p26023</link>
			<description><![CDATA[<p>between the issue that i was have is that the print sales invoice report is not open because of the huge number of invoices that we have, we change the from invoice and to invoice parameter to be filtered like list search.</p>]]></description>
			<author><![CDATA[null@example.com (xodaix)]]></author>
			<pubDate>Sun, 14 Aug 2016 22:17:26 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=26023#p26023</guid>
		</item>
		<item>
			<title><![CDATA[Re: Performance issues]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=26022#p26022</link>
			<description><![CDATA[<p>Many thanks apmuthu all is good now <img src="https://frontaccounting.com/punbb/img/smilies/smile.png" width="15" height="15" alt="smile" /><br />may i ask how i can register my name as frontaccounting developer contributor</p>]]></description>
			<author><![CDATA[null@example.com (xodaix)]]></author>
			<pubDate>Sun, 14 Aug 2016 22:07:55 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=26022#p26022</guid>
		</item>
		<item>
			<title><![CDATA[Re: Performance issues]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=25913#p25913</link>
			<description><![CDATA[<p>Make sure you have removed redundant indexes and have some <a href="https://github.com/apmuthu/frontaccounting/blob/master/FAMods/sql/alter_to_latest2.3.sql">needed indexes</a> in place. Also, some reports are cycled through in php on a per sql query basis instead of being acquired in a single sql query possibly as atomic requests use less memory.</p><p>Which reports slow you down? Has your MySQL been &quot;<a href="https://frontaccounting.com/fawiki/index.php?n=Devel.OptimizeAndDefragmentMySQLTables">tuned and defragmented</a>&quot; ?</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Mon, 01 Aug 2016 18:44:49 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=25913#p25913</guid>
		</item>
		<item>
			<title><![CDATA[Performance issues]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=25911#p25911</link>
			<description><![CDATA[<p>Hi,</p><p>When printing some reports or even when you access some page that taking a lot of time to retrieve the data from database we see the progress image gone and new yellow image with exclamation mark begin show, this due to the large data that i have, what is the correct solution, to make this not happens ?</p><p>Regards</p>]]></description>
			<author><![CDATA[null@example.com (xodaix)]]></author>
			<pubDate>Mon, 01 Aug 2016 18:01:16 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=25911#p25911</guid>
		</item>
	</channel>
</rss>
