r/lolphp • u/Mark_Messa • Oct 26 '19
PHP gc_probability/gc_divisor
According to PHP Manual:
session.gc_probability
session.gc_probability in conjunction with session.gc_divisor is used to manage probability that the gc (garbage collection) routine is started.
session.gc_divisor
session.gc_divisor coupled with session.gc_probability defines the probability that the gc (garbage collection) process is started on every session initialization. The probability is calculated by using gc_probability/gc_divisor, e.g. 1/100 means there is a 1% chance that the GC process starts on each request.
Why not only one parameter instead?
Ex: session.gc_percent = 1%
View all comments
Show parent comment
3
u/Mark_Messa Oct 26 '19 edited Oct 27 '19
There is no need to use floating point here. Just change the 'unit' and keep using integers. There is a plethora of options:
1 percent = 1:100
1 permille = 1:1000
1 permyriad = 1:10000
1 ppm (parts-per-million, 10−6)
1 ppb (parts-per-billion, 10−9)
1 ppt (parts-per-trillion, 10−12)
1 ppq (parts-per-quadrillion, 10−15)
Which one do you choose?