Keepalive Settings and SSL and IE - Puzzling

Discussion in 'Bug Reports' started by lhindc, May 4, 2006.

  1. lhindc

    lhindc New Member

    First things first,

    - RHE Linux ES 4
    - Lite Speed Std 2.1.14
    - PHP LSAPI 4.4.2

    When keepalive is set to 0, in both server and vhost onfiguration, it looks like litespeed still uses keep alive. I have tried to set keepalive timout to zero but when the server is started, it automatically changes it to 15 secs.

    The whole thing became a problem when we tried to upload some files through ssl using IE. No matter what you set the keepalive settings to, the server closes connection from the client sending the file at the end of keepalive timout seconds.

    We have tried to use apache's famous setenvif commant to make sure that keepalive is not used and the protocol is downgraded to HTTP1.0 to make it work :

    SetEnvIf User-Agent ".*MSIE.*" \
    nokeepalive ssl-unclean-shutdown \
    downgrade-1.0 force-response-1.0


    It looks like it does not work. With some of our users, the server keeps timouting the connections after the keepalive timeout is reached.

    Is there a workaround for this problem?

    PS: The problem is not consiistent, i.e. the same version of ie could work from one network and it could have the problem mentioned above on another network (Everything is the same on the server side)
  2. mistwang

    mistwang LiteSpeed Staff

    Thank you for the bug report.

    To turn off keepalive, you should set "Max keepalive requests" to 0 or 1, either at server level or at vhost level. changing keepalive timeout will not work.

    The setenvif trick in apache does not work with LSWS. And,we don't find any real problem with using SSL keepalive with IE, maybe it is a bug in somewhere else. Please let us know if the problem persist when keepalive has been turned off. If we can reproduce the bug, we will fix it.

    New bugfix release will be available soon. stay tuned. :)
  3. lhindc

    lhindc New Member

    Some more information

    Thank you for the reply mistwang.
    As you have mentioned in your post, I have tried to turn keepalive to 1 or 0 on both server and virtual host level and conducted some tests with people having the problem before. I have turned on the debug level logging and saw that altough keepalive was turned off, litespeed still closes the connection during ssl file uploads through php at the end of keepalive timeout seconds. It looks like keep alive is still there, or at least that is what seems to be happening in the logs.

    Thanks
  4. mistwang

    mistwang LiteSpeed Staff

    What you observed probably does not related to keepalive, just for some reason the upload stalled and the connection timed out. It is "connection timeout", not the "keepalive timeout".
    You can send chunk of your error log to bug [at] litespeed . com .

    Anyway, we have to be able to reliably reproduce the bug in order to fix it. :)
  5. lhindc

    lhindc New Member

    Error log output

    Mistwang,

    Please find an excerpt from the log file below, I have sent the whole log to the bug email address that you mentioned.

    Code:
    .
    .
    .
    .
    2006-05-03 12:38:52.792 [NOTICE] Toggle debug logging request from admin interface!
    2006-05-03 12:38:52.800 [DEBUG] [UDS://tmp/lshttpd/admin_php.sock] add recycled connection to connection pool!
    2006-05-03 12:38:57.500 [DEBUG] [xxx.xxx.xxx.141:443] New connection from yyy.yyy.yyy.244:21352.
    2006-05-03 12:38:57.501 [DEBUG] [xxx.xxx.xxx.141:443] 1 connections accepted!
    2006-05-03 12:38:57.507 [DEBUG] [xxx.xxx.xxx.141:443] New connection from yyy.yyy.yyy.244:21353.
    2006-05-03 12:38:57.507 [DEBUG] [xxx.xxx.xxx.141:443] 1 connections accepted!
    2006-05-03 12:38:57.507 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:38:57.507 [DEBUG] [yyy.yyy.yyy.244:21352-0] [SSL] SSLAgain()!
    2006-05-03 12:38:57.547 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:38:57.547 [DEBUG] [yyy.yyy.yyy.244:21352-0] [SSL] SSLAgain()!
    2006-05-03 12:38:57.547 [DEBUG] [yyy.yyy.yyy.244:21352-0] [SSL] accepted!
    2006-05-03 12:38:57.548 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:38:57.548 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpConnection::onReadEx(), state: 0!
    2006-05-03 12:38:57.548 [DEBUG] [yyy.yyy.yyy.244:21352-0] readToHeaderBuf(). 
    2006-05-03 12:38:57.549 [DEBUG] [yyy.yyy.yyy.244:21352-0] read 705 bytes to header buffer
    2006-05-03 12:38:57.549 [DEBUG] [yyy.yyy.yyy.244:21352-0] processHeader() return 0, header state: 3. 
    2006-05-03 12:38:57.549 [DEBUG] [yyy.yyy.yyy.244:21352-0] readToHeaderBuf() return 0. 
    2006-05-03 12:38:57.549 [DEBUG] [yyy.yyy.yyy.244:21352-0] New request: 
    	Method=[POST], URI=[/myitems.php],
    	QueryString=[fn=AnswerSave]
    	Content Length=2087640
    2006-05-03 12:38:57.549 [DEBUG] [yyy.yyy.yyy.244:21352-0] Reached maximum requests on keep alive connection, keep-alive off.
    2006-05-03 12:38:57.549 [DEBUG] [yyy.yyy.yyy.244:21352-0] Read Request Body!
    2006-05-03 12:38:57.549 [DEBUG] [yyy.yyy.yyy.244:21352-0] processNewReq() return 0. 
    2006-05-03 12:38:57.550 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:38:57.550 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpConnection::onReadEx(), state: 2!
    2006-05-03 12:38:57.550 [DEBUG] [yyy.yyy.yyy.244:21352-0] Read Request Body!
    2006-05-03 12:38:57.587 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:38:57.587 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpConnection::onReadEx(), state: 2!
    2006-05-03 12:38:57.587 [DEBUG] [yyy.yyy.yyy.244:21352-0] Read Request Body!
    2006-05-03 12:38:57.663 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:38:57.663 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpConnection::onReadEx(), state: 2!
    2006-05-03 12:38:57.663 [DEBUG] [yyy.yyy.yyy.244:21352-0] Read Request Body!
    2006-05-03 12:38:57.779 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:38:57.779 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpConnection::onReadEx(), state: 2!
    2006-05-03 12:38:57.779 [DEBUG] [yyy.yyy.yyy.244:21352-0] Read Request Body!
    2006-05-03 12:38:57.816 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:38:57.816 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpConnection::onReadEx(), state: 2!
    2006-05-03 12:38:57.816 [DEBUG] [yyy.yyy.yyy.244:21352-0] Read Request Body!
    2006-05-03 12:38:59.334 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:38:59.334 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpConnection::onReadEx(), state: 2!
    2006-05-03 12:38:59.334 [DEBUG] [yyy.yyy.yyy.244:21352-0] Read Request Body!
    2006-05-03 12:38:59.334 [DEBUG] [yyy.yyy.yyy.244:21352-0] Finsh request body 8192/2087640 bytes!
    2006-05-03 12:38:59.372 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:38:59.372 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpConnection::onReadEx(), state: 2!
    .
    .
    .
    .
    . This goes on and on and uploads the file, and it ends as following
    .
    .
    
    .
    .
    2006-05-03 12:39:57.387 [DEBUG] [yyy.yyy.yyy.244:21352-0] Read Request Body!
    2006-05-03 12:39:57.387 [DEBUG] [yyy.yyy.yyy.244:21352-0] Finsh request body 1187840/2087640 bytes!
    2006-05-03 12:39:57.425 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:39:57.425 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpConnection::onReadEx(), state: 2!
    2006-05-03 12:39:57.425 [DEBUG] [yyy.yyy.yyy.244:21352-0] Read Request Body!
    2006-05-03 12:39:57.448 [DEBUG] [yyy.yyy.yyy.244:21353-0] Keep-alive timeout, close!
    2006-05-03 12:39:57.448 [DEBUG] [yyy.yyy.yyy.244:21353-0] Shutting down SSL ...
    2006-05-03 12:39:57.448 [DEBUG] [yyy.yyy.yyy.244:21353-0] Close socket ...
    2006-05-03 12:39:57.506 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:39:57.506 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpConnection::onReadEx(), state: 2!
    2006-05-03 12:39:57.506 [DEBUG] [yyy.yyy.yyy.244:21352-0] Read Request Body!
    2006-05-03 12:39:57.506 [DEBUG] [yyy.yyy.yyy.244:21352-0] Shutting down SSL ...
    2006-05-03 12:39:57.506 [DEBUG] [yyy.yyy.yyy.244:21352-0] Shutting down out-bound socket ...
    2006-05-03 12:39:57.579 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:39:57.615 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:39:57.652 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:39:57.688 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:39:57.763 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:39:57.804 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:39:57.846 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:39:57.884 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:39:57.925 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:39:58.469 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:39:58.504 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:39:58.540 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:39:58.612 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:39:58.654 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:39:58.693 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:39:58.730 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:39:58.802 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:39:58.841 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:39:58.879 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:39:58.879 [DEBUG] [yyy.yyy.yyy.244:21352-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:39:59.468 [DEBUG] [yyy.yyy.yyy.244:21352-0] Shutdown time out!
    2006-05-03 12:39:59.468 [DEBUG] [yyy.yyy.yyy.244:21352-0] Close socket ...
    2006-05-03 12:40:43.266 [DEBUG] [xxx.xxx.xxx.141:443] New connection from yyy.yyy.yyy.244:21982.
    2006-05-03 12:40:43.266 [DEBUG] [xxx.xxx.xxx.141:443] 1 connections accepted!
    2006-05-03 12:40:43.268 [DEBUG] [yyy.yyy.yyy.244:21982-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:40:43.268 [DEBUG] [yyy.yyy.yyy.244:21982-0] [SSL] SSLAgain()!
    2006-05-03 12:40:43.308 [DEBUG] [yyy.yyy.yyy.244:21982-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:40:43.308 [DEBUG] [yyy.yyy.yyy.244:21982-0] [SSL] SSLAgain()!
    2006-05-03 12:40:43.308 [DEBUG] [yyy.yyy.yyy.244:21982-0] [SSL] accepted!
    2006-05-03 12:40:43.308 [DEBUG] [yyy.yyy.yyy.244:21982-0] HttpIOLink::handleEvents() events=1!
    2006-05-03 12:40:43.308 [DEBUG] [yyy.yyy.yyy.244:21982-0] HttpConnection::onReadEx(), state: 0!
    2006-05-03 12:40:43.308 [DEBUG] [yyy.yyy.yyy.244:21982-0] readToHeaderBuf(). 
    2006-05-03 12:40:43.308 [DEBUG] [yyy.yyy.yyy.244:21982-0] read 392 bytes to header buffer
    2006-05-03 12:40:43.308 [DEBUG] [yyy.yyy.yyy.244:21982-0] processHeader() return 0, header state: 3. 
    2006-05-03 12:40:43.308 [DEBUG] [yyy.yyy.yyy.244:21982-0] readToHeaderBuf() return 0. 
    
    

    Please note that altough keepalive is set to 0, it timeouts at the end of keepalive timeout secs.

    Thanks,
  6. mistwang

    mistwang LiteSpeed Staff

    Please download 2.1.15 again, the bug should be fixed.

Share This Page