-1

After profiling Drupal site using XHProf. I am seeing variable performance of ob_flush() call which is called only once per page.

First load Page x

Function   Calls  Ex Wall  Wall %
ob_flush   1      1,712ms  39.5%

Second load Page x

Function   Calls  Ex Wall  Wall %
ob_flush   1      270ms    24.5%

Third load Page x

Function   Calls  Ex Wall  Wall %
ob_flush   1      300ms      25.3%

In php.ini settings I have disabled out_buffering = 0 as seems to be suggestion for Drupal

I see other queries on this which don't provide a clear solution.

Is there a way to improve this performance?

Community
  • 1
  • 1
user3043805
  • 245
  • 2
  • 10

1 Answers1

0

It appears ob_flush function is affected heavily by everything after Drupal bootstrap. I had entity cache module enabled which was caching users to APCcache and rest to database (no way to disable it for other entities). The cache meant that the query data either to be sent or retrieved from the database. This slow down is reflected in ob_flush as until the content is not fully generated/cached or retrieved it cannot be flushed.

After disabling entity cache module. Now I see ob_flush consuming below 300ms which is still high but not as variable and extremely high as earlier.

user3043805
  • 245
  • 2
  • 10