Discussion:
Help regarding traffic_cts
salil GK
2017-03-28 06:12:43 UTC
Permalink
Hi


I have a doubt regarding the traffic_ctl command. In my setup I am
running two instances of traffic server. This I am doing by specifying two
different directories for configuration. Now when I run traffic_ctl how do
I control the configuration reload. I mean traffic_ctl need to read the
correct configuration file and update the variables of respective instance.
How do I do this ?


How does the trffic*ctl update the configuration variables
of traffic_server* – is it some IPC mechanism ?


Thanks

~S
Alan Carroll
2017-03-28 15:04:22 UTC
Permalink
traffic_ctl does IPC over a UNIX pipe to communicate with traffic_manager which will, if needed, communicate with traffic_server. The file name of the pipe is a compile time constant in traffic_ctl and traffic_manager. Therefore which Traffic Server instance is affected is based on which traffic_ctl binary you use.


On Monday, March 27, 2017, 8:12:56 PM CDT, salil GK <***@gmail.com> wrote:



Hi




  I have a doubt regarding the traffic_ctl command. In my setup I am running two instances of traffic server. This I am doing by specifying two different directories for configuration. Now when I run traffic_ctl  how do I control the configuration reload. I mean traffic_ctl need to read the correct configuration file and update the variables of respective instance. How do I do this ?




How does the trfficctl update the configuration variables of traffic_server – is it some IPC mechanism ?




Thanks

~S
salil GK
2017-03-28 15:43:45 UTC
Permalink
Thanks Alan for the reply

I have done changes to traffic manager source to support two instances of
traffic server to run in the system.
Now I can see two different set of .../var/ files are created the moment I
run traffic_manager. It includes three .sock files too.
I was trying to find out where exactly the IPC call happens from
traffic_control. Could you please help me understand the call sequence from
traffoc_control on how this IPC works - like which library function is
doing this work ? I assume that it is just delivering some message from
traffic_ctl to traffic_manager ( ? )

Thanks
Salil
Post by Alan Carroll
traffic_ctl does IPC over a UNIX pipe to communicate with traffic_manager
which will, if needed, communicate with traffic_server. The file name of
the pipe is a compile time constant in traffic_ctl and traffic_manager.
Therefore which Traffic Server instance is affected is based on which
traffic_ctl binary you use.
Hi
I have a doubt regarding the traffic_ctl command. In my setup I am
running two instances of traffic server. This I am doing by specifying two
different directories for configuration. Now when I run traffic_ctl how do
I control the configuration reload. I mean traffic_ctl need to read the
correct configuration file and update the variables of respective instance.
How do I do this ?
How does the trffic*ctl update the configuration variables
of traffic_server* – is it some IPC mechanism ?
Thanks
~S
salil GK
2017-03-28 16:58:40 UTC
Permalink
so basically I need to tell traffic_ctl to write to socket file in 'my
directory' rather than default build time directory. Which routine does
the notification to traffic_manager ?

Thanks
Salil
Post by salil GK
Thanks Alan for the reply
I have done changes to traffic manager source to support two instances of
traffic server to run in the system.
Now I can see two different set of .../var/ files are created the moment I
run traffic_manager. It includes three .sock files too.
I was trying to find out where exactly the IPC call happens from
traffic_control. Could you please help me understand the call sequence from
traffoc_control on how this IPC works - like which library function is
doing this work ? I assume that it is just delivering some message from
traffic_ctl to traffic_manager ( ? )
Thanks
Salil
Post by Alan Carroll
traffic_ctl does IPC over a UNIX pipe to communicate with traffic_manager
which will, if needed, communicate with traffic_server. The file name of
the pipe is a compile time constant in traffic_ctl and traffic_manager.
Therefore which Traffic Server instance is affected is based on which
traffic_ctl binary you use.
Hi
I have a doubt regarding the traffic_ctl command. In my setup I am
running two instances of traffic server. This I am doing by specifying two
different directories for configuration. Now when I run traffic_ctl how do
I control the configuration reload. I mean traffic_ctl need to read the
correct configuration file and update the variables of respective instance.
How do I do this ?
How does the trffic*ctl update the configuration variables
of traffic_server* – is it some IPC mechanism ?
Thanks
~S
Alan M. Carroll
2017-03-28 17:56:52 UTC
Permalink
I wouldn't think so - it should be baked in to the traffic_ctl binary. Do you mean you are using the same binaries to run both instances? In that case, yes, traffic_ctl would need some indication of which .sock to open. Looks like the the call to TSInit is the magic place, with a first argument of the path to the socket. The current implementation passes nullptr which I presume means "use the built in string" but it should be easy to pass something else there.
so basically I need to tell traffic_ctl to write to socket file in 'my directory' rather than default build time directory. Which routine does the notification to traffic_manager ?
salil GK
2017-03-29 03:17:23 UTC
Permalink
Thanks Alan

I will take a look at that and see if I can do some thing

from my first investigation I guess this would do

if not (socketpath = getenv(TS_RUNTIME_DIR) )
socketpath = TS_BUILDTIME_DIR
Post by Alan M. Carroll
I wouldn't think so - it should be baked in to the traffic_ctl binary. Do
you mean you are using the same binaries to run both instances? In that
case, yes, traffic_ctl would need some indication of which .sock to open.
Looks like the the call to TSInit is the magic place, with a first argument
of the path to the socket. The current implementation passes nullptr which
I presume means "use the built in string" but it should be easy to pass
something else there.
Post by salil GK
so basically I need to tell traffic_ctl to write to socket file in 'my
directory' rather than default build time directory. Which routine does
the notification to traffic_manager ?
Loading...