You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "Scott Beardsley (JIRA)" <ji...@apache.org> on 2016/01/25 21:19:39 UTC
[jira] [Created] (TS-4149) Add milestone for activity before
TS_EVENT_HTTP_SSN_START
Scott Beardsley created TS-4149:
-----------------------------------
Summary: Add milestone for activity before TS_EVENT_HTTP_SSN_START
Key: TS-4149
URL: https://issues.apache.org/jira/browse/TS-4149
Project: Traffic Server
Issue Type: Improvement
Reporter: Scott Beardsley
I ran into a pretty big performance issue in a plugin when it created a mutex in the TS_EVENT_HTTP_SSN_START hook. This caused a significant delay in processing the request. It ended up delaying sending the request to the origin by between 50 and 100ms at the 75%+ percentile! Here is a sample plugin which illustrates the problem:
{noformat}
#include <ts/ts.h>
#include <cstddef>
int globalHandler(TSCont continuation, TSEvent event, void * data) {
TSHttpSsn session = static_cast< TSHttpSsn >(data);
TSHttpSsnReenable(session, TS_EVENT_HTTP_CONTINUE);
return 0;
}
void TSPluginInit(int argc, const char * * argv) {
TSPluginRegistrationInfo info;
info.plugin_name = const_cast< char * >(PLUGIN_TAG);
// If we create a Mutex here there is huge, unaccounted for TTFB latency
TSCont continuation = TSContCreate(globalHandler, TSMutexCreate());
// the following will "fix" this problem assuming you don't actually need the mutex
// TSCont continuation = TSContCreate(globalHandler, NULL);
TSHttpHookAdd(TS_HTTP_SSN_START_HOOK, continuation);
}
{noformat}
What is also bad about this performance problem is that it is not visible in any of the milestone metrics including ttms. It shows up as a delay between in TTFB on the client side. It caused a lot of confusion to not be able to see the latency in slow logs, thus this request to expose the time spent here to the milestones.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)