Extremely low speed server response - 6 seconds!

I have installed Bitnami Wampstack and install the SuiteCRM 7.5.3 module.
My server is:
OS: Windows 7 - 64 bit.
CPU: Intel Celeron G1620 2.70GHz
We use a windows based wirless workgroup network.

Now the server response time on the server itself is about 6 seconds and on other clients it goes up to 12 seconds :dry:

What seems to be the problem and solution?

P.S.: When it was first installed the response time was around 0.2 seconds. But now we have entered about 1000 records. If it could be relevant.

If you entered (imported, I suppose) 1000 records there’s a chance that it’s still indexing these records for the AOD Search. This could take hours (some people say weeks, but I find that hard to believe, unless their record-sets were really huge).

If you check the logs you could see this activity. You would also see files getting created and deleted in this directory:

Anyway, checking the logs might give you interesting clues, even if this is not due to indexing.

Make sure you dont have developer mode turned on.

  1. The data was entered one by one over 1 - 2 months.
  2. I checked the log. There is nothing there. I mean for this particular date there is nothing related to response time.
  3. Developer mode is not enabled.

Could the problem be the refresh period of various dashlets?

Ok, let me try some more ideas…:

  1. Why do you mention dashlets? Is this slow response time on the main page, and only on the main page?

  2. Can you turn on the php_errors.log and check that also?

  3. Can you try some queries directly on the database (through phpMyAdmin) to see if the slowness is coming from there?

  4. Do you have any relevant customizations (new entities, new relationships)?

  1. Just a thought. And no, the response time is slow on every page and record.
  2. How can I turn on php_errors.log?
  3. Would you give me a query to test?
  4. I have some customization and relationships. I have just added some fields to some records and changed some “required” fields to “not required”. I have also changed the list view of history sub-panels.

But I should mention that the response time on Admin page is 0.56 Seconds.

It’s normal if the Admin page is quick to load, it doesn’t access the database.

To log PHP errors there are many instructions on Google, for example this one:

What is your SuiteCRM version? There was a bug a few versions back that caused big delays:
… but this fixed now. You can tell from the logs whether you are getting this bug or not.

I have enabled the php_error.log. There is no error.
I am using SuiteCRM 7.5.3.

And the result from a simple query in phpMyAdmin:

SELECT * FROM accounts
Showing rows 0 - 24 (668 total, Query took 0.0010 seconds.)

I’m assuming the php_errors.log is full of stuff (that’s the normal behavior), only it doesn’t have anything that looks relevant. Because if you really have nothing, You’re probably not logging correctly yet.

A few more ideas (but I am running out of ideas!):

  • Another log you can try to examine is the Apache log (google it).

  • If you buy Jim Mackin’s eBook SuiteCRM for Developers, there is a section there on performance, with several things you can try to investigate.

  • You can try profiling the page load times in your browser’s Developer tools, I wonder if the delay are really on the server, or maybe just something timing out in the network / DNS / something.

  • you can see if your database is full of unneeded records: wth field deleted = 1, or with relationships that point to no records at all. I can’t really guide you through solving this, but with a few selects you can at least try to see if it’s happening (for example, you have 1000 contacts but 2000 rows in the contacts_cstm table, stuff like that).

  • you can try upgrading Linux / Apache / MySQL / PHP / SuiteCRM to see if it magically solves your problem

As I checked just now there are lots of errors on php_error.log
The errors which have been repeated a lot are:

[15-Jun-2016 05:16:27 America/Los_Angeles] PHP Notice:  Undefined index: default in C:\Bitnami\wampstack-5.6.18-0\apps\suitecrm\htdocs\modules\Home\UnifiedSearch.php on line 171

[15-Jun-2016 05:16:27 America/Los_Angeles] PHP Notice:  Undefined property: Call::$set_complete in C:\Bitnami\wampstack-5.6.18-0\apps\suitecrm\htdocs\modules\Home\UnifiedSearch.php on line 179

[15-Jun-2016 05:19:51 America/Los_Angeles] PHP Notice:  Undefined property: Contact::$jjwg_maps_address_c in C:\Bitnami\wampstack-5.6.18-0\apps\suitecrm\htdocs\modules\Contacts\ContactFormBase.php on line 518

[15-Jun-2016 05:19:51 America/Los_Angeles] PHP Notice:  Undefined property: Contact::$jjwg_maps_geocode_status_c in C:\Bitnami\wampstack-5.6.18-0\apps\suitecrm\htdocs\modules\Contacts\ContactFormBase.php on line 518

Any clue?

I have now commented out these lines as mentioned in the issue on github, but no change:

Search "        $GLOBALS['log']->info(__METHOD__.' $arguments: '.print_r($arguments, true));" (8 hits in 4 files)
  C:\Bitnami\wampstack-5.6.18-0\apps\suitecrm\htdocs\custom\backup\custom\modules\Accounts\AccountsJjwg_MapsLogicHook.php (2 hits)
	Line 79:         $GLOBALS['log']->info(__METHOD__.' $arguments: '.print_r($arguments, true));
	Line 97:         $GLOBALS['log']->info(__METHOD__.' $arguments: '.print_r($arguments, true));
  C:\Bitnami\wampstack-5.6.18-0\apps\suitecrm\htdocs\custom\backup\custom\modules\Cases\CasesJjwg_MapsLogicHook.php (2 hits)
	Line 28:         $GLOBALS['log']->info(__METHOD__.' $arguments: '.print_r($arguments, true));
	Line 46:         $GLOBALS['log']->info(__METHOD__.' $arguments: '.print_r($arguments, true));
  C:\Bitnami\wampstack-5.6.18-0\apps\suitecrm\htdocs\custom\backup\custom\modules\Opportunities\OpportunitiesJjwg_MapsLogicHook.php (2 hits)
	Line 45:         $GLOBALS['log']->info(__METHOD__.' $arguments: '.print_r($arguments, true));
	Line 63:         $GLOBALS['log']->info(__METHOD__.' $arguments: '.print_r($arguments, true));
  C:\Bitnami\wampstack-5.6.18-0\apps\suitecrm\htdocs\custom\backup\custom\modules\Project\ProjectJjwg_MapsLogicHook.php (2 hits)
	Line 28:         $GLOBALS['log']->info(__METHOD__.' $arguments: '.print_r($arguments, true));
	Line 46:         $GLOBALS['log']->info(__METHOD__.' $arguments: '.print_r($arguments, true));

Those lines you commented out would show on the suitecrm.log, not on php_errors.log. If they were causing problems (if you had circularly related records), the output would be very visible if you scroll through the entire log, but not very visible if you just grep it.

As PHP errors tend to be very numerous, you need to be smart about how much importance you’re going to attribute to each error. Errors of type “Notice” and “Info” are probably safe to ignore, unless their accompanied by some weird behavior in the app. If you have type “error” or type “fatal”, that’s probably more relevant.

If you want to dive into that, I would suggest getting a simple test case, always the same (like listing contacts, or viewing a single contact’s detail page (always the same contact). Then scan the logs for the exact time where you loaded that page.

Commenting out those lines did not change anything. Still the same 7-seconds response time.

There are no “fatal” or “error” in php_error.log.

I followed a simple test and still no errors. But the response time is still around 7 seconds.

I have upgraded 7.5.3 to 7.6.4 hoping that something might change. But no!

I am desperate. Any other suggestions?


this is just an idea …

I had a few years ago also my development environment on Bitnami stack and also had this problem. I then changed to AMPPS. The advantage AMPPS is simply that multiple instances can run simultaneously, which certainly has great advantages. Performance was then again very good and the performance usually takes about 0.2 sec. Maybe you try it. Install AMPPS and suitecrm script and then copy after installing the database and a htdocs directory. If you have problems with the database then use mysqlfront instead myphpadmin. Also check the config.php for the correct path.

quite possible that the problem is due to the configuration of stack

1 Like

I am running on a Bitnami stack and everything is fine and performs well! But anyway Wieland’s suggestion might be worth trying, simply move to a different stack to see if that solves your problem.

The final, in-depth solution is to debug your code. You would have to be able to setup a debug environment, if you don’t already have one. But stepping through code would eventually give you the necessary insight as to what exactly is causing the problem, and where the delays are. It takes some trouble to setup but the advantages for the future are enormous. That’s when you really get all the benefits from working with open source: when you have visibility and power over the source code.

I wouldn’t advise that path if you are not a developer with some experience of debugging, however. It’s a big project and it’s easy to get lost.

1 Like

I am a developer but quite new to php.
Would you tell me how to setup a debug environment for SuiteCRM?

I have googled and found some instructions. Here is an example. Do you approve this?

I’m not an authority on this… anybody who takes the time to write a web article on this probably knows more than me. : - )

XDEBUG is a must. It is basically something you set up in your server (php.ini), and all the other options (which IDE you use, etc.) seem to use XDEBUG. You have to make XDEBUG can communicate between server and IDE, open firewall ports, etc.

Then, what OS are you using for your development machine? Which IDE’s would you prefer or consider using?

I had problems with Eclipse, and since I am on Windows I moved to Microsoft’s Visual Studio 2015 (free and excellent) with PHP Tools (payed for, but not very expensive, and you can trial it first).

You also have to figure out a way to share the source code between the server and the IDE. I’m using a Samba drive on my Linux SuiteCRM server, and connecting to it on Windows through SSH using SFTP Net Drive Free. But I should have set up a proper source control with Git.

1 Like

This is a lot of work. .__.
I tried several servers. I even used a shared Linux server online. Still the response time is around 7 seconds.
I think the server is not the issue. There might be a faulty data in database or customization has made the a problem.
Is there a way to know if the customization has mad the response time to be this high?
These are some customization I have made:

  1. changed the history sub-panel to show “Description”.
  2. added a field to “Account”.
  3. changed the layout of some modules from studio.
  4. added account type to “Account”.
  5. made some changes to .css files for RTLing.


None of your customizations should be having any noticeable effect on performance, they all look simple enough.

  1. Double-check possible network problems. Check your ping times and DNS resolution times. Try accessing your instance through an IP address instead of a domain name.

  2. Yes, setting up a debug environment is a pain but, in terms of being a SuiteCRM developer, it’s like joining the Premier League. It helps you solve this problem, and then it helps you solve the other 27 future problems you’re going to face. It transforms the mysterious and vague into stuff that you can actually know and understand.

Basically, you need to break down your problem. Unless you can see your delay as a collection of steps, you’re never going to find out which step is broken.

The setup I described above is for Remote Debugging. If you can try Local debugging it’s easier to set up (if the IDE is running in the same server as SuiteCRM).

  1. If you can’t do it with proper debugging, then do it “by hand” with the logs:
  • Get the simplest possible use-case that shows the delay and stick to it, no matter what.
  • Increase the logging level to debug.
  • Start paying attention to the timestamps on the logs.
  • Add your own lines into the code to add messages to the log to know what parts of the code are being executed.
  • Eventually you will get to a point in the code where seconds are wasted without any justifiable reason, and the code will lead you to possible causes and solutions.
1 Like