You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by "Sean Cosgrave (JIRA)" <ji...@apache.org> on 2010/01/22 22:38:21 UTC

[jira] Created: (TS-116) TS should have the ability to keep a minimum number of connections active for all keep alive cases

TS should have the ability to keep a minimum number of connections active for all keep alive cases
--------------------------------------------------------------------------------------------------

                 Key: TS-116
                 URL: https://issues.apache.org/jira/browse/TS-116
             Project: Traffic Server
          Issue Type: New Feature
          Components: Core
            Reporter: Sean Cosgrave


Today, TS keeps a keep alive connection to the Origin Server upto the time thats specified in
proxy.config.http.keep_alive_no_activity_timeout_out in the case that the connection hasnt been re-used for that period
of time.
In addition to that, it would be nice to be able to say that if a connection has been opened, keep atleast 'n' number
of connections open to the OS regardless of the fact that the connection hasnt been used for a while.
Obviously 'n' has to be a small number so that we dont end up holding up too many connections to the OS unnecessarily,
since this feature is simply to allow requests that come after that period of time to still enjoy the benefits of YCPI
reducing the impact of TCP's 3-way HandShake (especially over a long distance).
Also, do note, that a connection close event from the Origin Server should obviously be handled correctly and the
connection should be removed from the pool. In that case, no new connections have to be re-opened to maintain 'n'. This
can purely be done on demand.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TS-116) TS should have the ability to keep a minimum number of connections active for all keep alive cases

Posted by "Leif Hedstrom (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12829852#action_12829852 ] 

Leif Hedstrom commented on TS-116:
----------------------------------

+1 on Sean's proposal to set min=max.

> TS should have the ability to keep a minimum number of connections active for all keep alive cases
> --------------------------------------------------------------------------------------------------
>
>                 Key: TS-116
>                 URL: https://issues.apache.org/jira/browse/TS-116
>             Project: Traffic Server
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Sean Cosgrave
>            Assignee: Leif Hedstrom
>             Fix For: 2.0.0a
>
>         Attachments: ka_os_diff.txt
>
>
> Today, TS keeps a keep alive connection to the Origin Server upto the time thats specified in
> proxy.config.http.keep_alive_no_activity_timeout_out in the case that the connection hasnt been re-used for that period
> of time.
> In addition to that, it would be nice to be able to say that if a connection has been opened, keep atleast 'n' number
> of connections open to the OS regardless of the fact that the connection hasnt been used for a while.
> Obviously 'n' has to be a small number so that we dont end up holding up too many connections to the OS unnecessarily,
> since this feature is simply to allow requests that come after that period of time to still enjoy the benefits of YCPI
> reducing the impact of TCP's 3-way HandShake (especially over a long distance).
> Also, do note, that a connection close event from the Origin Server should obviously be handled correctly and the
> connection should be removed from the pool. In that case, no new connections have to be re-opened to maintain 'n'. This
> can purely be done on demand.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TS-116) TS should have the ability to keep a minimum number of connections active for all keep alive cases

Posted by "Sean Cosgrave (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TS-116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sean Cosgrave updated TS-116:
-----------------------------

    Attachment: ka_os_diff.txt

These are the changes that implement the feature request, please review and commit.

> TS should have the ability to keep a minimum number of connections active for all keep alive cases
> --------------------------------------------------------------------------------------------------
>
>                 Key: TS-116
>                 URL: https://issues.apache.org/jira/browse/TS-116
>             Project: Traffic Server
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Sean Cosgrave
>         Attachments: ka_os_diff.txt
>
>
> Today, TS keeps a keep alive connection to the Origin Server upto the time thats specified in
> proxy.config.http.keep_alive_no_activity_timeout_out in the case that the connection hasnt been re-used for that period
> of time.
> In addition to that, it would be nice to be able to say that if a connection has been opened, keep atleast 'n' number
> of connections open to the OS regardless of the fact that the connection hasnt been used for a while.
> Obviously 'n' has to be a small number so that we dont end up holding up too many connections to the OS unnecessarily,
> since this feature is simply to allow requests that come after that period of time to still enjoy the benefits of YCPI
> reducing the impact of TCP's 3-way HandShake (especially over a long distance).
> Also, do note, that a connection close event from the Origin Server should obviously be handled correctly and the
> connection should be removed from the pool. In that case, no new connections have to be re-opened to maintain 'n'. This
> can purely be done on demand.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TS-116) TS should have the ability to keep a minimum number of connections active for all keep alive cases

Posted by "Leif Hedstrom (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12829830#action_12829830 ] 

Leif Hedstrom commented on TS-116:
----------------------------------

Good point. I'm thinking though, setting the max ought to have "priority" over the min. But, that's just IMO of course. This is really an error case, it's not a normal use case to have min larger than max (it simply makes no logical sense).

> TS should have the ability to keep a minimum number of connections active for all keep alive cases
> --------------------------------------------------------------------------------------------------
>
>                 Key: TS-116
>                 URL: https://issues.apache.org/jira/browse/TS-116
>             Project: Traffic Server
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Sean Cosgrave
>            Assignee: Leif Hedstrom
>             Fix For: 2.0.0a
>
>         Attachments: ka_os_diff.txt
>
>
> Today, TS keeps a keep alive connection to the Origin Server upto the time thats specified in
> proxy.config.http.keep_alive_no_activity_timeout_out in the case that the connection hasnt been re-used for that period
> of time.
> In addition to that, it would be nice to be able to say that if a connection has been opened, keep atleast 'n' number
> of connections open to the OS regardless of the fact that the connection hasnt been used for a while.
> Obviously 'n' has to be a small number so that we dont end up holding up too many connections to the OS unnecessarily,
> since this feature is simply to allow requests that come after that period of time to still enjoy the benefits of YCPI
> reducing the impact of TCP's 3-way HandShake (especially over a long distance).
> Also, do note, that a connection close event from the Origin Server should obviously be handled correctly and the
> connection should be removed from the pool. In that case, no new connections have to be re-opened to maintain 'n'. This
> can purely be done on demand.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (TS-116) TS should have the ability to keep a minimum number of connections active for all keep alive cases

Posted by "Leif Hedstrom (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TS-116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leif Hedstrom resolved TS-116.
------------------------------

    Resolution: Fixed

> TS should have the ability to keep a minimum number of connections active for all keep alive cases
> --------------------------------------------------------------------------------------------------
>
>                 Key: TS-116
>                 URL: https://issues.apache.org/jira/browse/TS-116
>             Project: Traffic Server
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Sean Cosgrave
>            Assignee: Leif Hedstrom
>             Fix For: 2.0.0a
>
>         Attachments: ka_diff2, ka_os_diff.txt
>
>
> Today, TS keeps a keep alive connection to the Origin Server upto the time thats specified in
> proxy.config.http.keep_alive_no_activity_timeout_out in the case that the connection hasnt been re-used for that period
> of time.
> In addition to that, it would be nice to be able to say that if a connection has been opened, keep atleast 'n' number
> of connections open to the OS regardless of the fact that the connection hasnt been used for a while.
> Obviously 'n' has to be a small number so that we dont end up holding up too many connections to the OS unnecessarily,
> since this feature is simply to allow requests that come after that period of time to still enjoy the benefits of YCPI
> reducing the impact of TCP's 3-way HandShake (especially over a long distance).
> Also, do note, that a connection close event from the Origin Server should obviously be handled correctly and the
> connection should be removed from the pool. In that case, no new connections have to be re-opened to maintain 'n'. This
> can purely be done on demand.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (TS-116) TS should have the ability to keep a minimum number of connections active for all keep alive cases

Posted by "Leif Hedstrom (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TS-116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leif Hedstrom reassigned TS-116:
--------------------------------

    Assignee: Leif Hedstrom

> TS should have the ability to keep a minimum number of connections active for all keep alive cases
> --------------------------------------------------------------------------------------------------
>
>                 Key: TS-116
>                 URL: https://issues.apache.org/jira/browse/TS-116
>             Project: Traffic Server
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Sean Cosgrave
>            Assignee: Leif Hedstrom
>             Fix For: 2.0.0a
>
>         Attachments: ka_os_diff.txt
>
>
> Today, TS keeps a keep alive connection to the Origin Server upto the time thats specified in
> proxy.config.http.keep_alive_no_activity_timeout_out in the case that the connection hasnt been re-used for that period
> of time.
> In addition to that, it would be nice to be able to say that if a connection has been opened, keep atleast 'n' number
> of connections open to the OS regardless of the fact that the connection hasnt been used for a while.
> Obviously 'n' has to be a small number so that we dont end up holding up too many connections to the OS unnecessarily,
> since this feature is simply to allow requests that come after that period of time to still enjoy the benefits of YCPI
> reducing the impact of TCP's 3-way HandShake (especially over a long distance).
> Also, do note, that a connection close event from the Origin Server should obviously be handled correctly and the
> connection should be removed from the pool. In that case, no new connections have to be re-opened to maintain 'n'. This
> can purely be done on demand.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TS-116) TS should have the ability to keep a minimum number of connections active for all keep alive cases

Posted by "Sean Cosgrave (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TS-116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sean Cosgrave updated TS-116:
-----------------------------

    Attachment: ka_diff2

updated diff to reflect comments since my first diff

> TS should have the ability to keep a minimum number of connections active for all keep alive cases
> --------------------------------------------------------------------------------------------------
>
>                 Key: TS-116
>                 URL: https://issues.apache.org/jira/browse/TS-116
>             Project: Traffic Server
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Sean Cosgrave
>            Assignee: Leif Hedstrom
>             Fix For: 2.0.0a
>
>         Attachments: ka_diff2, ka_os_diff.txt
>
>
> Today, TS keeps a keep alive connection to the Origin Server upto the time thats specified in
> proxy.config.http.keep_alive_no_activity_timeout_out in the case that the connection hasnt been re-used for that period
> of time.
> In addition to that, it would be nice to be able to say that if a connection has been opened, keep atleast 'n' number
> of connections open to the OS regardless of the fact that the connection hasnt been used for a while.
> Obviously 'n' has to be a small number so that we dont end up holding up too many connections to the OS unnecessarily,
> since this feature is simply to allow requests that come after that period of time to still enjoy the benefits of YCPI
> reducing the impact of TCP's 3-way HandShake (especially over a long distance).
> Also, do note, that a connection close event from the Origin Server should obviously be handled correctly and the
> connection should be removed from the pool. In that case, no new connections have to be re-opened to maintain 'n'. This
> can purely be done on demand.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TS-116) TS should have the ability to keep a minimum number of connections active for all keep alive cases

Posted by "Leif Hedstrom (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TS-116?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leif Hedstrom updated TS-116:
-----------------------------

    Fix Version/s: 2.0.0a

> TS should have the ability to keep a minimum number of connections active for all keep alive cases
> --------------------------------------------------------------------------------------------------
>
>                 Key: TS-116
>                 URL: https://issues.apache.org/jira/browse/TS-116
>             Project: Traffic Server
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Sean Cosgrave
>             Fix For: 2.0.0a
>
>         Attachments: ka_os_diff.txt
>
>
> Today, TS keeps a keep alive connection to the Origin Server upto the time thats specified in
> proxy.config.http.keep_alive_no_activity_timeout_out in the case that the connection hasnt been re-used for that period
> of time.
> In addition to that, it would be nice to be able to say that if a connection has been opened, keep atleast 'n' number
> of connections open to the OS regardless of the fact that the connection hasnt been used for a while.
> Obviously 'n' has to be a small number so that we dont end up holding up too many connections to the OS unnecessarily,
> since this feature is simply to allow requests that come after that period of time to still enjoy the benefits of YCPI
> reducing the impact of TCP's 3-way HandShake (especially over a long distance).
> Also, do note, that a connection close event from the Origin Server should obviously be handled correctly and the
> connection should be removed from the pool. In that case, no new connections have to be re-opened to maintain 'n'. This
> can purely be done on demand.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TS-116) TS should have the ability to keep a minimum number of connections active for all keep alive cases

Posted by "Sean Cosgrave (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12829797#action_12829797 ] 

Sean Cosgrave commented on TS-116:
----------------------------------

Your suggestion in 2) would not create the same logic as I currently have. My current logic says that if the setup is wrong, and max < min, then don't try and keep a minimum number of connections alive. You suggest I set them to be equal, and don't make the comparison in HttpSessionManager. Setting them equal would mean we would always try and keep the connections alive because we could never get above the min, since it is also the max. I'm not sure that is the behavior we are looking for. I guess it might provide a performance improvement since we would then take advantage of the feature in those cases where max < min originally. The other side effect of the change would be that we would go above the maximum number of connections to an origin set in the config. I think those are both acceptable side effects. 

> TS should have the ability to keep a minimum number of connections active for all keep alive cases
> --------------------------------------------------------------------------------------------------
>
>                 Key: TS-116
>                 URL: https://issues.apache.org/jira/browse/TS-116
>             Project: Traffic Server
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Sean Cosgrave
>            Assignee: Leif Hedstrom
>             Fix For: 2.0.0a
>
>         Attachments: ka_os_diff.txt
>
>
> Today, TS keeps a keep alive connection to the Origin Server upto the time thats specified in
> proxy.config.http.keep_alive_no_activity_timeout_out in the case that the connection hasnt been re-used for that period
> of time.
> In addition to that, it would be nice to be able to say that if a connection has been opened, keep atleast 'n' number
> of connections open to the OS regardless of the fact that the connection hasnt been used for a while.
> Obviously 'n' has to be a small number so that we dont end up holding up too many connections to the OS unnecessarily,
> since this feature is simply to allow requests that come after that period of time to still enjoy the benefits of YCPI
> reducing the impact of TCP's 3-way HandShake (especially over a long distance).
> Also, do note, that a connection close event from the Origin Server should obviously be handled correctly and the
> connection should be removed from the pool. In that case, no new connections have to be re-opened to maintain 'n'. This
> can purely be done on demand.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TS-116) TS should have the ability to keep a minimum number of connections active for all keep alive cases

Posted by "Leif Hedstrom (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12829645#action_12829645 ] 

Leif Hedstrom commented on TS-116:
----------------------------------

Looks mostly good, couple of small comments:

1) Instead of using HttpConfig::m_master.origin_max_connections, I wonder if you should do something like this:

HttpConfigParams *http_config_params = HttpConfig::acquire();

// Now you can use http_config_params.origin_max_connections  etc. safely.

HttpConfig::release(http_config_params);


2) In HttpSessionManager.cc you have a comparison

HttpConfig::m_master.origin_max_connections > HttpConfig::m_master.origin_min_keep_alive_connections


I'm thinking this should be moved over to where the configuration is parsed, and if the "min" is larger than the "max", produce a warning, and then set 'max' to 'min'. Then you can eliminate that check entirely in the "run-time" code. I noticed in HttpSM.cc you actually do produce warnings in this case.

3) Similar to  2) except in HttpSM you produce a warning when "min" is larger than "max". Why not move this out to config parse time? Otherwise, won't we fill the error logs with this message pretty darn quick?


My recommendation for both 2) and 3) would be to move the logic over to config loading, produce one warning there, and then set "max" to be the same as "min".




> TS should have the ability to keep a minimum number of connections active for all keep alive cases
> --------------------------------------------------------------------------------------------------
>
>                 Key: TS-116
>                 URL: https://issues.apache.org/jira/browse/TS-116
>             Project: Traffic Server
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Sean Cosgrave
>            Assignee: Leif Hedstrom
>             Fix For: 2.0.0a
>
>         Attachments: ka_os_diff.txt
>
>
> Today, TS keeps a keep alive connection to the Origin Server upto the time thats specified in
> proxy.config.http.keep_alive_no_activity_timeout_out in the case that the connection hasnt been re-used for that period
> of time.
> In addition to that, it would be nice to be able to say that if a connection has been opened, keep atleast 'n' number
> of connections open to the OS regardless of the fact that the connection hasnt been used for a while.
> Obviously 'n' has to be a small number so that we dont end up holding up too many connections to the OS unnecessarily,
> since this feature is simply to allow requests that come after that period of time to still enjoy the benefits of YCPI
> reducing the impact of TCP's 3-way HandShake (especially over a long distance).
> Also, do note, that a connection close event from the Origin Server should obviously be handled correctly and the
> connection should be removed from the pool. In that case, no new connections have to be re-opened to maintain 'n'. This
> can purely be done on demand.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TS-116) TS should have the ability to keep a minimum number of connections active for all keep alive cases

Posted by "Sean Cosgrave (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TS-116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12829846#action_12829846 ] 

Sean Cosgrave commented on TS-116:
----------------------------------

I agree, it is a error case, and probably won't happen that often. I also agree the max should have priority since it was there first, and is more of a problem if we don't obey it. My original code meant we would not try and keep connections alive if the max < min. I think your suggestion is an improvement, but I think you made a typo. You said to set 'max' to 'min' when min > max, but that would increase the max. I think it should go the other way, to honor the originally configured max, set min=max.

> TS should have the ability to keep a minimum number of connections active for all keep alive cases
> --------------------------------------------------------------------------------------------------
>
>                 Key: TS-116
>                 URL: https://issues.apache.org/jira/browse/TS-116
>             Project: Traffic Server
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Sean Cosgrave
>            Assignee: Leif Hedstrom
>             Fix For: 2.0.0a
>
>         Attachments: ka_os_diff.txt
>
>
> Today, TS keeps a keep alive connection to the Origin Server upto the time thats specified in
> proxy.config.http.keep_alive_no_activity_timeout_out in the case that the connection hasnt been re-used for that period
> of time.
> In addition to that, it would be nice to be able to say that if a connection has been opened, keep atleast 'n' number
> of connections open to the OS regardless of the fact that the connection hasnt been used for a while.
> Obviously 'n' has to be a small number so that we dont end up holding up too many connections to the OS unnecessarily,
> since this feature is simply to allow requests that come after that period of time to still enjoy the benefits of YCPI
> reducing the impact of TCP's 3-way HandShake (especially over a long distance).
> Also, do note, that a connection close event from the Origin Server should obviously be handled correctly and the
> connection should be removed from the pool. In that case, no new connections have to be re-opened to maintain 'n'. This
> can purely be done on demand.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.