id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,mlocked 8117,Artificial 2 sec delays in all MythWeb requests,foceni@…,Rob Smith,"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.",defect,closed,major,0.23,Plugin - MythWeb,head,medium,fixed,"mythweb, slow, slower, delay, timeout",foceni@…,0