RE: Store client API

From: <anita.sivakumar_at_wipro.com>
Date: Fri, 27 Apr 2012 05:58:33 +0000

Hi Alex,

In my application, there is no request sent to the parent squid.
Actually when the parent squid does some prefetching of links, he will want to send the dns lookups to the child squid automatically after the first object is sent to the child squid.
For this reason, I am looking at directly using the APIs instead of following a request flow.
I will be collecting this dns lookup in a buffer and will be sending it over using either ICP/UDP or some way.
I tried to look up the way the cachemanager works and this is what i found:
The cachemanager is started by the forward::fwdState () method which will invoke stat_ipcache_get(StoreEntry*) to get the statistics.
I tried to call this method directly after creating a store entry and adding it to the storeclient using storeclientAdd() method.
But I don't get the statistics. Instead I get only the reply header in the buffer.
Thats why I am a bit clueless of what else is missing in this flow.

Thanks.

Regards,
Anita

-----Original Message-----
From: Alex Rousskov [mailto:rousskov_at_measurement-factory.com]
Sent: 27 April 2012 10:07
To: Anita Sivakumar (WT01 - GMT-Telecom Equipment)
Cc: squid-dev_at_squid-cache.org
Subject: Re: Store client API

On 04/26/2012 08:21 PM, anita.sivakumar_at_wipro.com wrote:

> I need the data of parent ipcache to be passed on to child. There
> will be an application that will be spawning on the child process
> which will pick this data (we need it for some other purpose).

It sounds like that application should make an HTTP request to the
parent cache using the same Cache Manager interface that squidclient is
using. You can see what "squidclient mgr:ipcache" is sending using
wireshark or a similar tool and reproduce the same kind of request in
the application.

If you are sure that Squid itself should send the request, you may want
to study how Squid sends requests for Cache Digests or perhaps netdb
information. Those requests are sent to other Squids.

In either case, if you cannot find relevant source code, you can find
most of it by using "debug_options ALL,9", sending a single cache
manager request (or waiting for the first Cache Digest exchange, etc.),
and then searching source code for matching lines.

HTH,

Alex.

> It is
> for this reason that I need the data. I will not be able to run the
> squidclient and might have to use the internal APIs to make the call
> directly in the parent squid which is why I am looking for someone to
> give me an insight on how this ipcache stats collection works through
> squidclient.

> -----Original Message-----
> From: Alex Rousskov [mailto:rousskov_at_measurement-factory.com]
> Sent: 26 April 2012 21:30
> To: Anita Sivakumar (WT01 - GMT-Telecom Equipment)
> Cc: squid-dev_at_squid-cache.org
> Subject: Re: Store client API
>
> On 04/25/2012 02:18 AM, anita wrote:
>
>> I would need help in understanding how the store/store_client classes work.
>> I am looking for reading the ipcache and dumping its contents into a file.
>
>
> Hello Anita,
>
> Can you use a Cache Manager request (mgr:ipcache) to request ipcache
> information over HTTP using tools such as squidclient, curl, or wget?
> For example,
>
> $ ./bin/squidclient mgr:ipcache > /tmp/ipcache.out
>
> The store client API is mostly for reading/receiving cached entries. It
> is probably not what you are looking for.
>
>
> Good luck,
>
> Alex.
>
> Please do not print this email unless it is absolutely necessary.
>
> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.
>
> WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
>
> www.wipro.com

Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com
Received on Fri Apr 27 2012 - 05:59:15 MDT

This archive was generated by hypermail 2.2.0 : Sat Apr 28 2012 - 12:00:07 MDT