Proper separation of multiple squid instances on the same machine

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Proper separation of multiple squid instances on the same machine

Robert Senger
Hi there,

a couple of week ago I've separated a rather complex squid installation
into two instances running on the same machine.

The setup of these two instances is almost identical, despite different
tcp_outgoing_address and stuff like that.

All files on disk and all listening ports are set to different paths /
values, so the instances should not interfere with each other.

However, today I realized that squid creates files in /dev/shm:

root@prokyon:/dev/shm# ls -l
insgesamt 2292
-rw-------. 1 proxy    proxy          8 Nov 28 22:27 squid-cf__metadata.shm
-rw-------. 1 proxy    proxy       8216 Nov 28 22:27 squid-cf__queues.shm
-rw-------. 1 proxy    proxy         36 Nov 28 22:27 squid-cf__readers.shm
-rw-------. 1 proxy    proxy    2103672 Nov 28 22:27 squid-tls_session_cache.shm

These files are created when the first instance starts. When the second
instance starts, the files get updated/recreated (new mtime/ctime).

When any of the running instances is stopped, the files are deleted.

So, the two instances collide here.

My questions:

1. Is this a problem?
2. If so, what must I do?

And yes, I am having issues with browsers failing to load page elements from time to time (mostly images, sometimes styles or scripts).

Thanks for help,

Robert


--
Robert Senger


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

Re: Proper separation of multiple squid instances on the same machine

Alex Rousskov
On 11/28/19 4:34 PM, Robert Senger wrote:

> a couple of week ago I've separated a rather complex squid installation
> into two instances running on the same machine.
>
> The setup of these two instances is almost identical, despite different
> tcp_outgoing_address and stuff like that.
>
> All files on disk and all listening ports are set to different paths /
> values, so the instances should not interfere with each other.
>
> However, today I realized that squid creates files in /dev/shm:
>
> root@prokyon:/dev/shm# ls -l
> insgesamt 2292
> -rw-------. 1 proxy    proxy          8 Nov 28 22:27 squid-cf__metadata.shm
> -rw-------. 1 proxy    proxy       8216 Nov 28 22:27 squid-cf__queues.shm
> -rw-------. 1 proxy    proxy         36 Nov 28 22:27 squid-cf__readers.shm
> -rw-------. 1 proxy    proxy    2103672 Nov 28 22:27 squid-tls_session_cache.shm
>
> These files are created when the first instance starts. When the second
> instance starts, the files get updated/recreated (new mtime/ctime).
>
> When any of the running instances is stopped, the files are deleted.
>
> So, the two instances collide here.



> My questions:

> 1. Is this a problem?

Yes.


> 2. If so, what must I do?

Use different service names for different Squid instances running
concurrently on the same machine. The service name is specified on the
command line using "squid -n".

AFAICT, this trick is poorly documented and is not supported on some
platforms, but I hope it works in your environment.


HTH,

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

Re: Proper separation of multiple squid instances on the same machine

Robert Senger
Thank you Alex, this works fine!

Robert


Am Donnerstag, den 28.11.2019, 18:55 -0500 schrieb Alex Rousskov:

> On 11/28/19 4:34 PM, Robert Senger wrote:
>
> > a couple of week ago I've separated a rather complex squid
> > installation
> > into two instances running on the same machine.
> >
> > The setup of these two instances is almost identical, despite
> > different
> > tcp_outgoing_address and stuff like that.
> >
> > All files on disk and all listening ports are set to different
> > paths /
> > values, so the instances should not interfere with each other.
> >
> > However, today I realized that squid creates files in /dev/shm:
> >
> > root@prokyon:/dev/shm# ls -l
> > insgesamt 2292
> > -rw-------. 1 proxy    proxy          8 Nov 28 22:27 squid-
> > cf__metadata.shm
> > -rw-------. 1 proxy    proxy       8216 Nov 28 22:27 squid-
> > cf__queues.shm
> > -rw-------. 1 proxy    proxy         36 Nov 28 22:27 squid-
> > cf__readers.shm
> > -rw-------. 1 proxy    proxy    2103672 Nov 28 22:27 squid-
> > tls_session_cache.shm
> >
> > These files are created when the first instance starts. When the
> > second
> > instance starts, the files get updated/recreated (new
> > mtime/ctime).
> >
> > When any of the running instances is stopped, the files are
> > deleted.
> >
> > So, the two instances collide here.
>
>
> > My questions:
> > 1. Is this a problem?
>
> Yes.
>
>
> > 2. If so, what must I do?
>
> Use different service names for different Squid instances running
> concurrently on the same machine. The service name is specified on
> the
> command line using "squid -n".
>
> AFAICT, this trick is poorly documented and is not supported on some
> platforms, but I hope it works in your environment.
>
>
> HTH,
>
> Alex.
--
Robert Senger


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