Skip to content

Commit 03dfeef

Browse files
authored
Merge pull request #282 from DrDaveD/fix-rock-readme
Fix multiple worker configuration in frontier-squid README and include a full example
2 parents 258e95b + 63bd0f1 commit 03dfeef

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

opensciencegrid/frontier-squid/README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,26 @@ That depends on a lot of RAM defined in $SQUID_CACHE_MEM for efficient operation
6868
To increase the size of `/dev/shm`, add the docker option `--shm-size`, for example `--shm-size=16g` for 16 Gigabytes.
6969
If $SQUID_CACHE_MEM is defined to be too large to fit in `/dev/shm`, frontier-squid will automatically reduce the size.
7070

71-
If you want to avoid overriding the container's configuration environment variables which are used in `/etc/squid/customize.d/10-stdvars.awk`, there's no need to redefine `cache_mem` like the upstream documentation advises, and to set the cache type without the location and size you can use
71+
If you want to avoid overriding the container's configuration environment variables which are used in `/etc/squid/customize.d/10-stdvars.awk`, there's no need to redefine `cache_mem` like the upstream documentation advises, and to set the cache type with the predefined location and size you can use
7272
```
73-
setoptionparameter("cache_dir", 1, "rock")
73+
setoption("cache_dir", "rock '$SQUID_CACHE_DISK_LOCATION $SQUID_CACHE_DISK'")
74+
```
75+
76+
Since at this point you need to pull together information from multiple sources to have a working configuration, here's an example configuration that puts it all together. If you have a machine with 8 cores and 16G of RAM you could use a configuration like this, beginning with a file '20-frontier.awk' with these contents:
77+
```
78+
setoption("cache_dir", "rock '$SQUID_CACHE_DISK_LOCATION $SQUID_CACHE_DISK'")
79+
setoption("maximum_object_size_in_memory", "1 GB")
80+
setoption("workers", 6)
81+
setoption("cpu_affinity_map", "process_numbers=1,2,3,4,5,6 cores=2,3,4,5,6,7")
82+
```
83+
Then start it with:
84+
```
85+
docker run --rm --name frontier-squid -p 3128:3128 \
86+
-v ./20-frontier.awk:/etc/squid/customize.d/20-frontier.awk \
87+
--shm-size=14g -e SQUID_CACHE_MEM="12 GB" \
88+
-e SQUID_CACHE_DISK=50000 \
89+
--ulimit nofile=16384:16384 \
90+
opensciencegrid/frontier-squid:24-upcoming
7491
```
7592

7693

0 commit comments

Comments
 (0)