squid -k rec , seems has problem with ram leakage ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

squid -k rec , seems has problem with ram leakage ?

--Ahmad--
hey folks

i have a Multi instances in squid and i run them and keep use(( -k rec))) option

but it seems after some hours i see ram keep increasing .


i see ram better if i kill squid then run it  normally .


but


 ram keep sucked by squid if i use -k rec option

I’m using squid Squid Cache: Version 3.5.22


any way to help me ?


cheers

_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: squid -k rec , seems has problem with ram leakage ?

Amos Jeffries
Administrator


On 17/02/18 10:53, --Ahmad-- wrote:
> hey folks
>
> i have a Multi instances in squid and i run them and keep use(( -k rec))) option
>

"rec" as in the first characters of the "-k reconfigure" option?

That will only update the running Squid with new config file settings.
Sometimes that can reduce memory, but if the issue is in anyway linked
to the OS report of "maximum _ever_ used" stats for each process, it
will not change a thing - usually make the number higher as Squid must
fork() twice as many helper processes for a reconfigure.


> but it seems after some hours i see ram keep increasing .
>

numbers?

config file(s)?

>
> i see ram better if i kill squid then run it  normally .
>

Which resets everything related to memory and starts clean without any
of the OS and fork() related issues such as the one above.

>
> but
>
>
>  ram keep sucked by squid if i use -k rec option
>
> I’m using squid Squid Cache: Version 3.5.22
>

Does the same problem exist with 3.5.27 ?

PS. If you are using ssl-bump at all, make sure you have the Squid-3
workaround of "sslflags=NO_DEFAULT_CA" on every *_port line using
ssl-bump option to prevent openssl allocating vast amounts of useless
memory.

Amos
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: squid -k rec , seems has problem with ram leakage ?

--Ahmad--
hi amos 

i didnt use the version 3.5.22

 but long time I’m using the 3.5.22 and its fine 

the new thing is I’m using like 100 squid instances .

and  hourly i have cron to change and update squid 

so i just make rec option instead of having session drop .

i don’t have exact mount of statistics to tell you 

but say i have 32 G ram 

if i run 100 squid instances it take about 16 G ram .

if i keep run the cron hourly by time say daily 12 times ( every 2 hours) 

and after 1 week i go to server to see free ram using :

free -m command

i see the free ram be like 5 G free , while I’m supposed to see the free as 16 G

if i kill all instances and run it again 
the free is 16 G


so as i said , by time , by doing many -k rec OPTINOS , there is something not ok either os or squid I’m not sure .

is there any tuning can i do in squid ?

or os ? I’m using centos 6 64 bits and may be option in sysctl to play with ?

here is my config file :
dns_nameservers 8.8.8.8
dns_v4_first off
########################################
http_port 203.164.132.2:${service_name}
include /root/X3/aclhalf${service_name}.conf
include /root/X3/tcphalf${service_name}.conf 
pid_filename /var/run/squid${service_name}.pid
cache_log /var/log/squid/${service_name}-cache.log
access_log  /var/log/squid/${service_name}-access.log
#################
visible_hostname xyz
# Lockdown Procedures
auth_param basic program /lib/squid/basic_ncsa_auth /etc/squid/squid_userX3
acl ncsa_users proxy_auth REQUIRED
http_access allow ncsa_users
#
# Recommended minimum configuration:
#

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
# Add any of your own refresh_pattern entries above these.
#
###################################
#########################################
cache_effective_user squid
cache_effective_group squid
##############


On Feb 17, 2018, at 11:38 AM, Amos Jeffries <[hidden email]> wrote:

3.5.22


_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: squid -k rec , seems has problem with ram leakage ?

Amos Jeffries
Administrator
On 18/02/18 00:57, --Ahmad-- wrote:

> hi amos 
>
> i didnt use the version 3.5.22
>
>  but long time I’m using the 3.5.22 and its fine 
>
> the new thing is I’m using like 100 squid instances .
>
> and  hourly i have cron to change and update squid 
>
> so i just make rec option instead of having session drop .
>
> i don’t have exact mount of statistics to tell you 
>
> but say i have 32 G ram 
>
> if i run 100 squid instances it take about 16 G ram .

So that is the amount before much traffic has happened.

When traffic goes through the proxy Squid gains data which uses more
memory for at least all the purposes listed at
<https://wiki.squid-cache.org/SquidFaq/SquidMemory>.


>
> if i keep run the cron hourly by time say daily 12 times ( every 2 hours) 
>
> and after 1 week i go to server to see free ram using :
>
> free -m command
>
> i see the free ram be like 5 G free , while I’m supposed to see the free
> as 16 G


+10GB for 100 instances means each is on average only using ~100 MB more
than you expected. This is also the net difference between when you
started the Squid and the peak traffic load within that whole week.

If you are not already graphing the memory usage I suggest you start
doing so and look at the graphs for patterns. They may show a different
story to what you (or I) are thinking is happening.


Also, Squid provides SNMP data for automated measurements if you want to
check the details rather than just the overall OS free measurement.

For example; comparing OID cacheMemUsage to cacheNumObjCount,
cacheClients and cacheCurrentFileDescrCnt shows roughly the relative
memory usage to each of the major dynamic memory consumers.


Amos
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: squid -k rec , seems has problem with ram leakage ?

--Ahmad--
Hi Amos , 

so you mean that the extra Ram usage is from the instance when it loaded with traffic ?

will that stay even if i have cache men 0 and  and cache deny all  and disabling all HDD caching ?

is there anything can i do ?

or leave it s it is ?

cheers 

On Feb 17, 2018, at 3:20 PM, Amos Jeffries <[hidden email]> wrote:

On 18/02/18 00:57, --Ahmad-- wrote:
hi amos 

i didnt use the version 3.5.22

 but long time I’m using the 3.5.22 and its fine 

the new thing is I’m using like 100 squid instances .

and  hourly i have cron to change and update squid 

so i just make rec option instead of having session drop .

i don’t have exact mount of statistics to tell you 

but say i have 32 G ram 

if i run 100 squid instances it take about 16 G ram .

So that is the amount before much traffic has happened.

When traffic goes through the proxy Squid gains data which uses more
memory for at least all the purposes listed at
<https://wiki.squid-cache.org/SquidFaq/SquidMemory>.



if i keep run the cron hourly by time say daily 12 times ( every 2 hours) 

and after 1 week i go to server to see free ram using :

free -m command

i see the free ram be like 5 G free , while I’m supposed to see the free
as 16 G


+10GB for 100 instances means each is on average only using ~100 MB more
than you expected. This is also the net difference between when you
started the Squid and the peak traffic load within that whole week.

If you are not already graphing the memory usage I suggest you start
doing so and look at the graphs for patterns. They may show a different
story to what you (or I) are thinking is happening.


Also, Squid provides SNMP data for automated measurements if you want to
check the details rather than just the overall OS free measurement.

For example; comparing OID cacheMemUsage to cacheNumObjCount,
cacheClients and cacheCurrentFileDescrCnt shows roughly the relative
memory usage to each of the major dynamic memory consumers.


Amos
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users


_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: squid -k rec , seems has problem with ram leakage ?

Amos Jeffries
Administrator
On 18/02/18 02:38, --Ahmad-- wrote:
> Hi Amos , 
>
> so you mean that the extra Ram usage is from the instance when it loaded
> with traffic ?

Probably. It is small enough in size to be from that. Detailed
inspection is necessary to know for sure.


>
> will that stay even if i have cache men 0 and  and cache deny all 
> and disabling all HDD caching ?

Yes. Memory of various amounts is required simply to process traffic.


>
> is there anything can i do ?
>
> or leave it s it is ?
>

If you are worried you can look into the details I mentioned.

I would try to ensure that you staggered the instance reconfiguring so
that they at least did not all do it at the same time. There is extra
memory and pausing of traffic during reconfigure.


Amos
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: squid -k rec , seems has problem with ram leakage ?

Eliezer Croitoru
In reply to this post by --Ahmad--
Hey Ahmad,

I’m not sure I understand what 100 instances of squid means?
Are you talking about 100 workers?

Eliezer

----
http://ngtech.co.il/lmgtfy/
Linux System Administrator
Mobile: +972-5-28704261
Email: [hidden email]


From: squid-users [mailto:[hidden email]] On Behalf Of --Ahmad--
Sent: Saturday, February 17, 2018 13:58
To: Amos Jeffries <[hidden email]>
Cc: [hidden email]
Subject: Re: [squid-users] squid -k rec , seems has problem with ram leakage ?

hi amos

i didnt use the version 3.5.22

 but long time I’m using the 3.5.22 and its fine

the new thing is I’m using like 100 squid instances .

and  hourly i have cron to change and update squid

so i just make rec option instead of having session drop .

i don’t have exact mount of statistics to tell you

but say i have 32 G ram

if i run 100 squid instances it take about 16 G ram .

if i keep run the cron hourly by time say daily 12 times ( every 2 hours)

and after 1 week i go to server to see free ram using :

free -m command

i see the free ram be like 5 G free , while I’m supposed to see the free as 16 G

if i kill all instances and run it again
the free is 16 G


so as i said , by time , by doing many -k rec OPTINOS , there is something not ok either os or squid I’m not sure .

is there any tuning can i do in squid ?

or os ? I’m using centos 6 64 bits and may be option in sysctl to play with ?

here is my config file :
dns_nameservers 8.8.8.8
dns_v4_first off
########################################
http_port 203.164.132.2:${service_name}
include /root/X3/aclhalf${service_name}.conf
include /root/X3/tcphalf${service_name}.conf
pid_filename /var/run/squid${service_name}.pid
cache_log /var/log/squid/${service_name}-cache.log
access_log  /var/log/squid/${service_name}-access.log
#################
visible_hostname xyz
# Lockdown Procedures
auth_param basic program /lib/squid/basic_ncsa_auth /etc/squid/squid_userX3
acl ncsa_users proxy_auth REQUIRED
http_access allow ncsa_users
#
# Recommended minimum configuration:
#

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
# Add any of your own refresh_pattern entries above these.
#
###################################
#########################################
cache_effective_user squid
cache_effective_group squid
##############


On Feb 17, 2018, at 11:38 AM, Amos Jeffries <mailto:[hidden email]> wrote:

3.5.22


_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: squid -k rec , seems has problem with ram leakage ?

Amos Jeffries
Administrator
On 23/02/18 06:46, Eliezer Croitoru wrote:
> Hey Ahmad,
>
> I’m not sure I understand what 100 instances of squid means?


IIRC, he is using the Squid "-n" feature.

You may know it as "multi-tenant". Running multiple of the "Squid
instance" as defined at
<https://wiki.squid-cache.org/Features/SmpScale#Terminology> within the
same OS environment.


( "${service_name}" usage in this thread squid.conf is the big clue
here. But I am basing my IIRC on older threads across the last year when
he was asking for help on how to set it up. )


Amos
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: squid -k rec , seems has problem with ram leakage ?

Eliezer Croitoru
Thanks Amos,

It might not be my place to say a word but 100 instances on a single machine can only be good for specific cases which he might have under his hands.

I believe that in such cases on the long term he might need a better solution but it's not my place to lectures anyone.

Eliezer

----
Eliezer Croitoru
Linux System Administrator
Mobile: +972-5-28704261
Email: [hidden email]



-----Original Message-----
From: squid-users [mailto:[hidden email]] On Behalf Of Amos Jeffries
Sent: Wednesday, February 28, 2018 06:17
To: [hidden email]
Subject: Re: [squid-users] squid -k rec , seems has problem with ram leakage ?

On 23/02/18 06:46, Eliezer Croitoru wrote:
> Hey Ahmad,
>
> I’m not sure I understand what 100 instances of squid means?


IIRC, he is using the Squid "-n" feature.

You may know it as "multi-tenant". Running multiple of the "Squid
instance" as defined at
<https://wiki.squid-cache.org/Features/SmpScale#Terminology> within the
same OS environment.


( "${service_name}" usage in this thread squid.conf is the big clue
here. But I am basing my IIRC on older threads across the last year when
he was asking for help on how to set it up. )


Amos
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users

_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users