jmarantz commented on issue #1775: Deadlock in shm statistics
URL: 
https://github.com/apache/incubator-pagespeed-mod/issues/1775#issuecomment-394724374
 
 
   I've always had concerns about using mod_pagespeed with ITK because, IIUC, 
ITK shuts down processes after the request completes, where MPS wants to keep 
running to complete fetches and optimize resources in background threads.
   
   So what happens when ITK kills a child process with MPS running fetches and 
optimizations in background threads?
   
   Nothing good I think.
   
   Http fetches will be aborted mid-stream and have to be repeated.  Also image 
optimizations. This is a waste of cpu and network bandwidth both in MPS and the 
origin server.  LoadFromFile can help here, but will not fully solve the 
problem.
   
   Eventually optimizations may land in cache and the system will start 
providing some benefit.
   
   But I think depending on the timing a subprocess could in theory be killed 
while holding a cross-process lock, resulting in the deadlock you see.
   
   I wonder if there are ways to tell ITK to allow processes to linger for a 
few hundred requests so MPS can get some work done?  That would be the best 
remedy.
   
   Another option is to give MPS very long deadlines to complete its 
optimizations.  Say, 5 or 10 seconds. Then MPS will block delivery of HTML 
until the page is fully optimized, and reduce the likelihood that MPS will be 
active, taking locks, when ITK kills the child process. The drawback is long 
latency for HTML for the first visitor, with a cold server cache.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to