krakjoe / apcu

APCu - APC User Cache
Other
957 stars 193 forks source link

Increase slot limits #480

Closed Kotaro-Shibata closed 1 year ago

Kotaro-Shibata commented 1 year ago

On a server with 2TB of memory, the 983063 slots is too small. So, I want to increase it.

The prime numbers are listed with the following script.

## script
$ cat get-primenumber.bash
#! /bin/bash -

if [ -z "$1" ]; then
    echo "usage: ${0##*/} num1 [num2] ..."
    exit
fi

while [ "$1" != "" ]; do
    NUM="$1"
    seq "$((NUM-100))" "${NUM}" | xargs factor \
    | tr ' ' '\t' \
    | awk 'NF==2{print $1}' \
    | tac | tail -1 | tr -d ':' | tr -d '\n'
    echo ",/* ${NUM} */"
    shift
done

## usage
$ bash get-primenumber.bash 1310720 1474560 1966080 2621440 3276800 3932160 4587520 5242880 6553600 7864320 8847360 9830400 10485760
1310627,/* 1310720 */
1474489,/* 1474560 */
1965983,/* 1966080 */
2621347,/* 2621440 */
3276719,/* 3276800 */
3932063,/* 3932160 */
4587431,/* 4587520 */
5242801,/* 5242880 */
6553511,/* 6553600 */
7864243,/* 7864320 */
8847271,/* 8847360 */
9830321,/* 9830400 */
10485667,/* 10485760 */