We've been seeing a performance problem on the front-end pages of our site. Before caching, the front page might take 15-20 seconds to load.
After running xhprof, I've noticed there seems to be some serious wait times due to stream_open
, stream_eof
, and stream_read
. See the data below:
S3fsStreamWrapper::stream_open
Calls: 59
Calls%: 0.0%
Incl. Wall Time (microsec): 9,971,939
IWall%: 48.4%
Incl. CPU (microsecs): 408,000
ICpu%: 12.3%
Incl. MemUse (bytes): 2,053,120
IMemUse%: 0.4%
S3fsStreamWrapper::stream_eof
Calls: 1,777
Calls%: 0.5%
Incl. Wall Time (microsec): 5,860,511
IWall%: 28.7%
Incl. CPU (microsecs): 64,000
ICpu%: 2.2%
Incl. MemUse (bytes): 48,464
IMemUse%: 0.0%
S3fsStreamWrapper::stream_read
Calls: 1,779
Calls%: 0.5%
Incl. Wall Time (microsec): 2,434,294
IWall%: 11.7%
Incl. CPU (microsecs): 68,000
ICpu%: 2.3%
Incl. MemUse (bytes): 9,881,688
IMemUse%: 17.6%
Any thoughts on what could be causing this, or ways to mitigate the issue? Can some of this be done asynchronously?
This seems to be a huge amount of time to be waiting. The next largest "wait" after these three is unserialize
, which uses 10x less time than stream_read
.