[mythtv-commits] Ticket #8117: Artificial 2 sec delays in all MythWeb requests
MythTV
mythtv at cvs.mythtv.org
Sun Feb 28 20:40:08 UTC 2010
#8117: Artificial 2 sec delays in all MythWeb requests
------------------------------+---------------------------------------------
Reporter: foceni@… | Owner: kormoc
Type: defect | Status: new
Priority: major | Milestone: unknown
Component: Plugin - MythWeb | Version: head
Severity: medium | Mlocked: 0
------------------------------+---------------------------------------------
I've been using MythWeb for a really long time, always trunk, but I began
noticing serious delays associated with each request for the past couple
of weeks (months?).
A moment ago I tried using my old 0.21 version (just changing the protocol
version) and everything was blazing fast again. Trace of the Apache
process showed me two timed out 1 sec poll()'s and I pinned the issue down
to sendCommand() function in MythBackend.php.
There's an "input flushing" receiveData(1) right after connect(), which
causes these delays. In my case, these artificial delays are triggered
when the connection isn't open and connect() has to be called. In other
words - a situation where socket I/O buffer is empty. In such case, this
"insurance" call to receiveData(1) blocks unnecessarily for 1 sec every
time.
I'm attaching a simple patch which introduces an optional millisecond
timeout argument to receiveData(). SendCommand() uses it to wait just 1
msec. It's compatible with the rest of the code, but feel free to fix this
any way you like.
--
Ticket URL: <http://svn.mythtv.org/trac/ticket/8117>
MythTV <http://www.mythtv.org/>
MythTV
More information about the mythtv-commits
mailing list