CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Ajax calls slow
Pages: [1]

Author Topic: Ajax calls slow  (Read 2227 times)

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Ajax calls slow
September 29, 2011, 06:56:31 am
Hey there,

We are experiencing some slowness with Civi.  A particular offender is the Ajax autocomplete search box.  In a database with 12 contacts, it takes up to 8 seconds to do an auto-complete.  I'm reasonably sure this is to do with the amount of requests we are making (Searching for 'Third Sector Design' takes ages and is about 20 requests).

Is this maybe something to do with the fact that we are running apache prefork and should be running worker?  Are there some simple config changes we can make in apache to improve the response?

Background: we are running on Ubuntu 10.04 with pretty out of the box apache and mysql on an AWS small instance (see http://aws.amazon.com/ec2/instance-types/ wor its spec).  The ping is about 13ms and we can get 3.3MB/s between us and the server with scp so no problems there.  All our Drupal pages are nice and fast.
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Ajax calls slow
September 29, 2011, 07:04:29 am
If you can send me login credential I can check and let you know.. ( this way it might be faster to debug / fix )

Kurund
Found this reply helpful? Support CiviCRM

Michael McAndrew

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1274
  • Karma: 55
    • Third Sector Design
  • CiviCRM version: various
  • CMS version: Nearly always Drupal
  • MySQL version: 5.5
  • PHP version: 5.3
Re: Ajax calls slow
October 01, 2011, 11:26:49 am
In case it is relevant / related, when i look in Firebug, I am getting lots of 'Aborted' statuses for the Ajax requests when I am filling in the autocomplete in newer versions of CiviCRM.  In older versions of CiviCRM when the ajax was much faster (and looking around at other autocompletes, like github and googlemaps) these are all '200 OK'.

Maybe this is a red herring and I am paying it too much attention because it appears in red in my firebug but i thought it was worth reporting :)

Michael
Service providers: Grow your business, build your reputation and support CiviCRM. Become a partner today

Sean Madsen

  • I post occasionally
  • **
  • Posts: 98
  • Karma: 5
  • CiviCRM implementer/developer
    • Bikes Not Bombs
  • CiviCRM version: 4.6
  • CMS version: Drupal 7
Re: Ajax calls slow
January 31, 2012, 12:10:01 pm
I'm experiencing this slowness too, which is new for me after upgrading to 4.0 from 3.1. Version 3.1 had a pretty speedy auto-complete search for me (the contact search in the top left), but version 4.0 is noticeably slower and I'm getting complaints from all my staff that this is much less usable. My error log files don't have anything relevant. I'd love to know if there's a way I can fix this!

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Ajax calls slow
January 31, 2012, 01:48:03 pm

can u check what the search settings are here:

q=civicrm/admin/setting/search&reset=1

Try making it just contact name and see if that helps. How big is your contact db?

lobo


A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Ajax calls slow
January 31, 2012, 04:31:33 pm
Hi,

Same problem here. IMO, the solutions are (in order of quality, but almost as well as in complexity)

1) use a proper fulltext search engine (I tried sphinx, lobo solr, both seems to work fine, but are proof of concept, not production ready)

2) have a better backend api. The normal search looks for *name* on shitload of fields. Making something smarter (eg. search on last name*, then on first name*, then on email* seems to work better)

Tried some proof of concept, not too bad but not enough testing

3) the existing hook, replace by name*...
https://github.com/tttp/civicrm_qlookup

Got a branch for 7.x somewhere on a private repo, could push it

This works better in some contexts (>10k contacts...)


Last but not the least, civicrm is way slower if non english US. you don't see too much the difference when you got all the other html parts to build, but you do on ajax calls.

X+

PS. 8 seconds for an autocomplete is obviously insanely high. What's the result on your local machine? Not 100%sure it's running on api, but if it does, check the command and add a ?debug=1 if you have xdebug, will give extra info about the memory used
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Ajax calls slow

This forum was archived on 2017-11-26.