Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Fri Apr 19, 2024 1:49 am
Predictive Dialer


All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: ratecard page very slow
PostPosted: Mon Feb 15, 2010 4:26 pm 
Offline

Joined: Mon Feb 15, 2010 4:14 pm
Posts: 6
Hello,
I had A2billing 1.3.3 and i've just updated in version 1.5.1.
Everything is ok except one thing: the page ratecard.
This one is very very slow, the page appears in maybe 2 minutes.

I searched in the database and i found this page request the view cc_callplan_lcr. This view is created with table cc_ratecard and cc_prefix.
With 18000 entries in table cc_prefix, the request in cc_callplan_lcr is very slow (2 minutes to display the page).
With 283 entries in table cc_prefix, no problem the page ratecard appears in 1 second.

Am i the only one to have this problem ?
How many entries do you have in cc_prefix table ?
Isthere a fix for my problem ?

Thank you !


Top
 Profile  
 
 Post subject: Re: ratecard page very slow
PostPosted: Wed Feb 17, 2010 1:07 pm 
Offline

Joined: Thu Apr 10, 2008 10:33 pm
Posts: 37
Hi

NO I was having the same issue.. Question: Are you using IE? With IE I was getting Error: Failed to open file.
Try Firefox it seems to work better for uploading the rate cards. Same rate cards cvs file uploaded correctly with firefox.

Marcias


Top
 Profile  
 
 Post subject: Re: ratecard page very slow
PostPosted: Wed Feb 17, 2010 3:23 pm 
Offline

Joined: Mon Feb 15, 2010 4:14 pm
Posts: 6
Hello Marcias, thanks for your answer.
But my problem is not when i want to generate the cvs file to create the ratecard table.

My problem appears, when i want to go in a2billing application for customer, and i click on "ratecard" in the menu.
The page appears 2 minutes later.

I saw the problem is here when i have many entries in cc_ratecard table (21,204 entries) and cc_prefix table (18,694 entries).


Top
 Profile  
 
 Post subject: Re: ratecard page very slow
PostPosted: Thu Feb 18, 2010 10:21 am 
Offline

Joined: Mon Feb 15, 2010 4:14 pm
Posts: 6
I think there is a problem in the request called to display ratecards. I think there is no limit and the request is done on all the entire view.
But i can't find this in the code. Any help ?


Top
 Profile  
 
 Post subject: Re: ratecard page very slow
PostPosted: Fri Feb 19, 2010 8:25 am 
Offline

Joined: Mon Feb 15, 2010 4:14 pm
Posts: 6
I updated in version 1.6.0, and same problem appears again.


Top
 Profile  
 
 Post subject: Re: ratecard page very slow - now with more detail!
PostPosted: Wed Jun 20, 2012 5:25 pm 
Offline

Joined: Thu Jun 05, 2008 5:35 pm
Posts: 37
I'm resurrecting this thread because I've done some research into why and how this is happening. On our system, the process is unbearably slow - it takes more than 8 minutes to do the database query, and this is often further exacerbated by either A2Billing's logout timer, or the fact that anyone who actually tries this goes off to play Solitaire while they wait.

I found that the problem was with the database query being run when initially requesting the ratecard page. In MySQL I ran the following query while I was forced to wait for the new page:

Code:
SHOW FULL PROCESSLIST;


which told me that the following query was running:

Code:
SELECT SQL_CALC_FOUND_ROWS cc_prefix.destination, cc_ratecard.dialprefix, cc_ratecard.buyrate, cc_ratecard.rateinitial, cc_ratecard.startdate, cc_ratecard.stopdate, cc_ratecard.initblock, cc_ratecard.connectcharge, cc_ratecard.id_trunk , cc_ratecard.idtariffplan , cc_ratecard.id FROM cc_ratecard LEFT JOIN cc_prefix ON prefix=cc_ratecard.destination ORDER BY  dialprefix ASC LIMIT 0,10;


Further research revealed that left joins are particularly expensive, and the time it takes to do them really adds up when doing them on thousands or tens of thousands of rows (we have about 40,000 rows in our ratecard table). Therefore, it is important to reduce the number of rows that we're doing right joins on. It's not feasible to reduce the actual size of the ratecard table, since allowing our customers to dial anywhere in the world is our business plan. And clearly, setting a limit on the results returned isn't doing anyone any good. So after tinkering a bit, I found that the best way to reduce the processing time in this query is to add a WHERE clause to narrow the results from the SELECT statement.

In the MySQL command line, I obtained excellent results by using some kind of default dialprefix from the cc_ratecard table. After all, the whole point of the initial rates page isn't to display all of the rates, but to ask the user for a rate to display. It would probably be an even better idea to display no results at all, and wait for the user to search for a dial prefix.

This is definitely a bug. I would post a patch if I had either the time or the expertise, but I suspect one of the regular developers on the project would be able to do it *much* faster than I could in any case. FYI, issuing a patch would be much appreciated, since our version of A2Billing has been customized somewhat, making upgrading to a new version painful at best.


Top
 Profile  
 
 Post subject: Re: ratecard page very slow
PostPosted: Wed Jun 20, 2012 6:16 pm 
Offline

Joined: Thu Jun 05, 2008 5:35 pm
Posts: 37
Actually, there's an easy quick and dirty way of fixing this:

  • edit $WEBROOT/a2billing/admin/Public/templates/default/main.tpl
  • Find the line ending with the text "echo gettext("Rates"). This line has the html link that goes to the rates page.
  • Remove the text "A2B_entity_def_ratecard.php?atmenu=ratecard&section=6" and replace it with "A2B_entity_def_ratecard.php?atmenu=ratecard&section=6&filterprefix=01120&filterfield=dialprefix" This replacement link searches for the dialprefix 01120, which is the country code for Egypt. You can replace "01120" with any dialprefix you like that may be more relevant to you.
  • Save the file and test.

Note: On our dev server, we needed to make $WEBROOT/a2billing/templates_c writeable for the userid running the web daemon after making this change, but this wasn't the case on our production server. You may get an error from A2Billing after making this change, complaining about permissions on this directory, but the solution is fairly simple.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 
Hosted Voice Broadcast


All times are UTC


Who is online

Users browsing this forum: No registered users and 24 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group